/*
 Theme Name: Wecansource Child
 Template: wecansource
 Version: 1.0
*/

/* When menu is opened, disable scrolling */
/* Disable scroll everywhere when menu is open */
/* Freeze the entire page when menu is open */

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    display: block !important;
}

/* ============================================
 * Static Dual-Price Display (inc + ex VAT)
 * Replaces the old VAT toggle system
 * ============================================ */

/* Hide VAT toggle switches in header (desktop + mobile) */
.tax-switch {
    display: none !important;
}

/* Hide legacy toggle price spans the parent theme still outputs */
.wecansource-price-incl-tax,
.wecansource-price-excl-tax {
    display: none !important;
}

/* Main inc-VAT price — inherits existing weight/size from theme */
.wcsi-price-main {
    display: inline;
}

/* Ex-VAT price in brackets — smaller, muted, on its own line by default */
.wcsi-price-ex-vat {
    display: block;
    font-size: 0.82em;
    color: #6F7A93;
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.4;
}

/* Single product page — ex-VAT on its own line beneath the main price */
.wecansource-product-single-page-item .wcsi-price-ex-vat {
    display: block;
    margin-left: 0;
    margin-top: 3px;
}

/* Very narrow screens — tighten further */
@media (max-width: 380px) {
    .wcsi-price-ex-vat {
        font-size: 0.72em;
    }
}
/* ============================================
 * CLS Prevention — reserve space for images
 * before they load or Slick initialises
 * ============================================ */

/* Hide all slides except first before Slick initializes */
.header-slider-one:not(.slick-initialized) > .header-area.header-bg:not(:first-child) {
    display: none !important;
}

/* Hero banner — reserve height so content below doesn't shift */
.header-carousel-wrapper {
    min-height: 420px;
}
.header-area .thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}
@media (max-width: 991px) {
    .header-carousel-wrapper { min-height: 520px; }
}
@media (max-width: 576px) {
    .header-carousel-wrapper { min-height: 380px; }
}

/* Header logo — 3000 × 694 intrinsic */
.navbar-area .site-logo img {
    width: 180px;
    height: auto;
    aspect-ratio: 3000 / 694;
}

/* Footer logo — 158 × 40 intrinsic */
.footer-section .site-logo img,
.about-us-widget .site-logo img {
    width: 180px;
    height: auto;
    aspect-ratio: 158 / 40;
}

/* Social icons in footer */
.social_share .single-info-item a img {
    width: 16px;
    height: 16px;
    aspect-ratio: 1 / 1;
}

/* Product category thumbnails — homepage + mega menu */
.product-category-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}
.mega-menu-content .category-image img {
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
}

/* WooCommerce product card thumbnails — contain portrait images cleanly */
.wecansource-single-product-item .woocommerce-thumbnail-wrap {
    background: #fff;
}
.wecansource-single-product-item .woocommerce-thumbnail-wrap > a {
    display: block;
    height: auto;
}
.wecansource-single-product-item .woocommerce-thumbnail-wrap img {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}
/* Force variations table to stack on mobile */
@media (max-width: 768px) {
    table.variations,
    table.variations tbody,
    table.variations tr,
    table.variations td,
    table.variations th {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    table.variations tr {
        margin-bottom: 15px;
    }
    
    table.variations td.label {
        padding-bottom: 5px;
        font-weight: 600;
    }
    
    table.variations td.value,
    table.variations td select {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Catch any overflow from the form itself */
    .variations_form.cart {
        max-width: 100% !important;
        overflow: hidden;
    }
}
/* Mega Menu – contain horizontal overflow from un-initialised Slick
   on the list itself, not the parent (which must stay visible for the dropdown) */
.mega-menu .top-level-menu {
  overflow: hidden;
}

/* Ensure .mega-menu.desktop is the positioning parent */
.mega-menu.desktop {
  position: relative !important;
}

/* Anchor the dropdown holder below the menu bar */
.mega-menu.desktop .mega-menu-content-holder {
  top: 100% !important;
  left: 0 !important;
  z-index: 9999 !important;
  position: absolute !important;
}

/* Mega Menu Fix - More Specific Selectors */
.mega-menu-content .subcategories-columns {
  display: flex !important;
  gap: 40px;
}

.mega-menu-content .subcategory-column {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.mega-menu-content .subcategory-column a {
  display: block !important;
  color: #333;
  text-decoration: none;
  padding: 5px 0;
}

.mega-menu-content .subcategory-column a:hover {
  color: #6c5ce7;
}

.mega-menu-content .category-image {
  flex-shrink: 0;
  max-width: 300px;
}

.mega-menu-content .category-image img {
  max-width: 100%;
  height: auto;
}

/* ============================================
 * Checkout & Cart Trust/Widget Styling
 * Supports Fluid Checkout widget-area trust badges
 * Added: March 2026
 * ============================================ */

/* Trust badges styling (Fluid Checkout widget areas) */
.wcsi-trust-badges {
    flex-wrap: wrap;
}

.wcsi-checkout-trust {
    font-family: inherit;
}

/* Improve payment step messaging */
.wc_payment_method .payment_box p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ============================================
 * Secure Checkout Header Badge (John Lewis style)
 * Padlock + "Secure Checkout" in distraction-free header
 * Added: March 2026
 * ============================================ */

.fc-checkout-header__inner {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

.fc-checkout-header__inner::after {
    content: 'Secure Checkout';
    font-size: 14px;
    font-weight: 600;
    color: #17062C;
    letter-spacing: 0.01em;
    padding-left: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23884DF8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 16px 16px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Hide on mobile — clashes with order summary toggle button in header */
@media (max-width: 768px) {
    .fc-checkout-header__inner::after {
        display: none;
    }
}

/* ============================================
 * Add-to-Cart Toast Notification
 * Brief confirmation popup — top-right, WCSI brand
 * ============================================ */

.wcsi-cart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    background: #884DF8;
    color: #fff;
    padding: 14px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(136, 77, 248, 0.35);
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    font-family: inherit;
    line-height: 1.4;
}

.wcsi-cart-toast--visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.wcsi-cart-toast__link {
    color: #fff !important;
    text-decoration: underline;
    margin-left: 8px;
    font-weight: 400;
}

.wcsi-cart-toast__link:hover {
    color: #EFE6FE !important;
}

@media (max-width: 480px) {
    .wcsi-cart-toast {
        left: 12px;
        right: 12px;
        top: 12px;
        text-align: center;
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* Hide VAT toggle - high specificity override */
label.tax-switch,
label.tax-switch.hide-on-mobile,
label.tax-switch.hide-on-desktop {
    display: none !important;
    visibility: hidden !important;
}

/* Ex VAT price sizing */
.wcsi-price-ex-vat {
    font-size: 0.75em !important;
}

/* 01 May 2026 — Add breathing room around product/category images
   Source files are pre-cropped squares (300x300), so this padding
   gives the visual effect of whitespace without re-shooting product photography */
.product-category-item img,
.wecansource-single-product-item .woocommerce-thumbnail-wrap img {
    padding: 8%;
    box-sizing: border-box;
    background: #fff;
}

/* 01 May 2026 — Add breathing room around product/category images
   Source files are pre-cropped squares (300x300), so this padding
   gives the visual effect of whitespace without re-shooting product photography */
.product-category-item img,
.wecansource-single-product-item .woocommerce-thumbnail-wrap img {
    padding: 8%;
    box-sizing: border-box;
    background: #fff;
}
