/*
 * QATARSHOES THEME - CUSTOM CSS OVERRIDES
 * This file is loaded on EVERY page template!
 */

/* ============================================
   TYPOGRAPHY SYSTEM - CSS VARIABLES
   ============================================ */
:root {
    /* Font Families */
    --font-display: 'Canela Text', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-accent: 'Haas Grot Disp R', 'Helvetica Neue', Arial, sans-serif;

    /* Backward compatibility aliases */
    --font-primary: var(--font-body);
    --font-primary-medium: var(--font-body);
}

/* ============================================
   HERO IMAGE GENDER SWITCHING
   ============================================ */

/* Hero image base styles */
.hero-image {
    transition: background 0.5s ease-in-out !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Gender-specific hero backgrounds */
body.dept-women .hero-image {
    background: var(--hero-women-image) center/cover no-repeat !important;
}

body.dept-men .hero-image {
    background: var(--hero-men-image) center/cover no-repeat !important;
}

/* ============================================
   QATAR SHOES BRANDING
   ============================================ */

/* Hide legacy SVG logo (rendered by React/JS) */
.qatarshoes-logo-container svg,
.logo.jsx-f20bdc55fc53c205 svg,
#logo-img svg,
a[aria-label="qatarshoes logo"] svg,
svg[viewbox="0 0 128 47"],
svg[viewBox="0 0 128 47"] {
    display: none !important;
    visibility: hidden !important;
}

/* Hide logo completely inside jsx-1401438402 container (no SVG, no background) */
.jsx-1401438402.qatarshoes-logo-container svg {
    display: none !important;
    visibility: hidden !important;
}
.jsx-1401438402.qatarshoes-logo-container #logo-img,
.jsx-1401438402.qatarshoes-logo-container a[aria-label="Qatar Shoes logo"] {
    background-image: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

/* Show Qatar Shoes logo via background-image on anchor */
#logo-img,
a[aria-label="qatarshoes logo"] {
    display: block !important;
    background-image: url('https://qtrshoe.com/wp-content/uploads/2025/12/Qtrshoe-logo-black--e1767178505601.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Header logo dimensions */
.logo.jsx-f20bdc55fc53c205 #logo-img,
.logo.jsx-f20bdc55fc53c205 a[aria-label="qatarshoes logo"] {
    width: 100px !important;
    height: 37px !important;
    min-width: 100px !important;
    min-height: 37px !important;
}

/* Footer logo dimensions (larger) */
.jsx-980088968.section-item #logo-img,
.jsx-980088968.section-item a[aria-label="qatarshoes logo"],
footer #logo-img,
footer a[aria-label="qatarshoes logo"] {
    width: 152px !important;
    height: 55px !important;
    min-width: 152px !important;
    min-height: 55px !important;
}

/* Show any img tag inside logo-img */
#logo-img img {
    display: block !important;
    visibility: visible !important;
    max-width: 100%;
    height: auto;
}

/* Hide country selector */
.wrapper.jsx-2328171715,
.country-and-flag-wrapper,
.country-iso-code,
.second-lang {
    display: none !important;
}

/* Hide Kids toggle if exists */
[data-dept="kids"],
.department-text[title="Kids"],
span[title="Kids"] {
    display: none !important;
}

/* ============================================
   HIDE REACT/LEGACY MOBILE DRAWER CONTENT
   Keep only WordPress injected menu
   ============================================ */

/* Hide ALL React drawer navigation - WordPress menu replaces it */
[role="dialog"] [class*="jsx"]:not(.wp-drawer-tabs):not(.wp-injected-menu):not([class*="close"]):not([class*="Close"]) > a[href*="Homepage"],
[role="dialog"] [class*="jsx"]:not(.wp-drawer-tabs):not(.wp-injected-menu) > a:contains("Homepage") {
    display: none !important;
}

/* Hide any duplicate "Women" / "Men" tab buttons that aren't from WordPress */
[role="dialog"] [class*="jsx"] button[class*="jsx"]:not(.wp-drawer-tab):not(.wp-drawer-expand-btn) {
    display: none !important;
}

/* Force hide ALL sibling content after WordPress menu wrapper */
[role="dialog"] .wp-drawer-tabs ~ *:not(.wp-injected-menu),
[role="dialog"] .wp-injected-menu ~ * {
    display: none !important;
}

/* Ensure WordPress drawer takes full height and hides overflow */
[role="dialog"]:has(.wp-drawer-tabs) > div {
    overflow: hidden !important;
}

[role="dialog"] > div > div:first-child:has(.wp-drawer-tabs) {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* Hide the original React menu when WordPress menu exists */
[role="dialog"]:has(.wp-drawer-tabs) > div > div:not(:first-child) {
    display: none !important;
}

/* ============================================
   SHOPIFY PRODUCTS LOADING STATES
   Shows shimmer while Shopify products load
   ============================================ */

/* Show loading placeholder shimmer until Shopify products load */
.products-container:not(.shopify-loaded)::before {
    content: '';
    display: block;
    width: 100%;
    min-height: 300px;
    background: linear-gradient(90deg, #f5f5f5 25%, #ebebeb 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: products-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes products-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Remove shimmer when Shopify products are loaded */
.products-container.shopify-loaded::before {
    display: none !important;
    border-radius: 4px;
}

/* Shimmer for product-grid-container (used on collection pages) */
.product-grid-container:not(.shopify-loaded)::before {
    content: '';
    display: block;
    width: 100%;
    min-height: 400px;
    background: linear-gradient(90deg, #f5f5f5 25%, #ebebeb 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: products-shimmer 1.5s infinite;
    border-radius: 4px;
    grid-column: 1 / -1;
}

.product-grid-container.shopify-loaded::before {
    display: none !important;
}

/* Ensure all Shopify-loaded products are visible */
.products-container.shopify-loaded > *,
.product-grid-container.shopify-loaded > *,
.product-grid.shopify-loaded > * {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    border-radius: 4px;
}

/* Product card visibility - use flex for vertical alignment */
.shopify-loaded .product-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Product card wrapper needs flex for vertical alignment */
.shopify-loaded .product-card-wrapper {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Product link needs flex for vertical alignment */
.shopify-loaded .product-card-wrapper > a[href*="/product/"] {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Image visibility in loaded containers */
.shopify-loaded img {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Primary image display */
.shopify-loaded .image-container img.firstImage {
    display: block !important;
}

/* Secondary/hover images (controlled by JS on hover) */
.shopify-loaded .image-container img:not(.firstImage) {
    display: none !important;
}

/* ============================================
   HIDE UNCONFIGURED SECTIONS
   Based on collection configuration per gender
   ============================================ */

/* Hide sections when current gender doesn't have collection configured */
body.dept-women .homepage-section[data-has-women="false"] {
    display: none !important;
}

body.dept-men .homepage-section[data-has-men="false"] {
    display: none !important;
}

/* ============================================
   HOMEPAGE PRODUCT SECTIONS - 2x2 GRID ON MOBILE
   ============================================ */

/* Mobile: 2 columns grid - Override jsx styles */
@media (max-width: 1023px) {
    /* Override ALL products-container jsx classes to 2x2 grid */
    .products-container.jsx-3213987687,
    .products-container.jsx-2630333056,
    .products-container.jsx-2492920896,
    .homepage-section .products-container,
    .featured-products-container .products-container,
    .gift-products-container .products-container,
    .new-arriaval-products-container .products-container,
    .trending-products-container .products-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, 1fr) !important;
        grid-template-areas: "a b" "c d" !important;
        gap: 1px !important;
        border-radius: 24px !important;
        overflow: hidden !important;
        background: #E0DCD3 !important;
    }

    /* IMPORTANT: Override jsx rules that hide grid-area:a products */
    .jsx-2630333056[style*="grid-area:a"],
    .jsx-2492920896[style*="grid-area:a"],
    .products-container > div[style*="grid-area:a"],
    .products-container > div[style*="grid-area: a"] {
        display: flex !important;
    }

    /* Product card grid areas - reassign based on child position */
    .products-container > div:nth-child(1) {
        grid-area: a !important;
    }
    .products-container > div:nth-child(2) {
        grid-area: b !important;
    }
    .products-container > div:nth-child(3) {
        grid-area: c !important;
    }
    .products-container > div:nth-child(4) {
        grid-area: d !important;
    }

    /* Show only first 4 products (2x2 grid) */
    .products-container > *:nth-child(n+5) {
        display: none !important;
    }
}

/* ============================================
   HIDE BREADCRUMBS ON COLLECTION & PRODUCT PAGES
   ============================================ */

.collection-page .breadcrumbs,
.product-page .breadcrumbs {
    display: none !important;
}

/* ============================================
   HOMEPAGE SECTION — FIGMA HOME.HTML REDESIGN
   ============================================ */

/* === SECTION WRAPPER: full padding + gap between heading and grid === */
@media (min-width: 1024px) {
    .new-arriaval-products-container.jsx-1401438402,
    .best-sellers-products-container.jsx-1401438402,
    .gift-products-container.jsx-1401438402,
    .featured-products-container.jsx-1401438402 {
        padding: 40px !important;
    }

    /* New Arrivals: transparent where it overlaps the hero (first 80vh),
       solid white below the hero image (hero=150vh, content starts at 70vh → 80vh overlap) */
    .new-arriaval-products-container.jsx-1401438402 {
        padding: 0 40px !important;
        background: linear-gradient(to bottom, transparent 0vh, transparent 50vh, #ffffff 50vh) !important;
    }
    .showcase-section {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
    }
}

/* === SECTION HEADING ROW: remove old border style === */
.showcase-section-heading-row {
    background: white !important;
    border: none !important;
    padding: 0 !important;
    height: auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    display: flex !important;
}

/* === SECTION TITLE: 32px bold dark === */
.showcase-section-heading {
    font-size: 32px !important;
    font-weight: 600 !important;
    font-family: Inter, sans-serif !important;
    color: #2d1f1f !important;
    text-transform: capitalize !important;
    line-height: 28px !important;
}

/* === CTA BUTTON: solid dark pill (all sections default) === */
.jsx-2551956705.button {
    height: 48px !important;
    border-radius: 900px !important;
    border: none !important;
    background: #2d1f1f !important;
    padding: 18px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
}

.jsx-1999640959.button-content,
.jsx-3286509370.button-content {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.jsx-1999640959.view-more,
.jsx-3286509370.view-more {
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: white !important;
    font-family: Arial, sans-serif !important;
    line-height: 1 !important;
}

/* === HERO IMAGE MASK: dark overlay at top, fades to transparent === */
/* === DESKTOP HERO MASK: white gradient from bottom to top ===
   Fully transparent at the top so the image shows clearly,
   fading to solid white at the bottom edge of the hero. */
.jsx-3970551290.hero-image-mask,
.hero-image-mask {
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 1.00)  15%,
        rgba(255, 255, 255, 0.60) 20%,
        rgba(255, 255, 255, 0.00) 25%
    ) !important;
}

/* === MOBILE HERO MASK: white gradient from bottom to top === */
@media (max-width: 1023px) {
    .jsx-3970551290.hero-image-mask,
    .hero-image-mask {
        background: linear-gradient(
            to top,
            rgba(255, 255, 255, 1.00)  0%,
            rgba(255, 255, 255, 0.80) 20%,
            rgba(255, 255, 255, 0.00) 55%
        ) !important;
    }
}



/* === MOBILE: main sections wrapper — transparent at top (hero gradient shows through),
   white from 25vh down. Targets only the direct child wrapper, not child containers
   that also carry the jsx-1401438402 class (they inherit the white from their parent). */
@media (max-width: 1023px) {
    .full-height-flex > .jsx-1401438402 {
        background: linear-gradient(
            to bottom,
            transparent 0vh,
            #ffffff 25vh
        ) !important;
    }
}

/* === MOBILE: explicit white on all section containers below New Arrivals ===
   Prevents body's fixed background PNG from bleeding through on mobile. */
@media (max-width: 1023px) {
    .best-sellers-products-container,
    .home-featured-section,
    .gift-products-container,
    .featured-products-container,
    .trending-products-container,
    .jsx-1844652196.vertical-spacer {
        background: #ffffff !important;
    }
}

/* === WHITE BACKGROUND: spacer + Best Sellers container only ===
   Covers the hero bleed-through between New Arrivals and the marquee */
@media (min-width: 1024px) {
    .new-arriaval-products-container + .jsx-1844652196,
    .best-sellers-products-container,
    .best-sellers-products-container + .jsx-1844652196 {
        background: #ffffff !important;
    }
}

/* === NEW ARRIVALS: glass wrapper over hero === */
.new-arriaval-products-container .showcase-section {
    gap: 0 !important;
    border-radius: 16px 24px !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.10) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    margin-bottom: 40px !important;
}

/* === NEW ARRIVALS: plain transparent heading row === */
.new-arriaval-products-container .showcase-section-heading-row {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    padding: 16px 24px !important;
}

.new-arriaval-products-container .showcase-section-heading {
    color: white !important;
    font-size: 24px !important;
    font-weight: 600 !important;
}

/* New Arrivals button: solid white, dark text */
.new-arriaval-products-container .jsx-2551956705.button {
    background: white !important;
}

.new-arriaval-products-container .jsx-1999640959.view-more {
    color: #2d1f1f !important;
}

/* === EXPLORE BY CATEGORY — Tab pills === */
.category-explore-heading-row {
    flex-wrap: wrap !important;
    gap: 16px !important;
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-tab {
    height: 48px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: Inter, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    outline: 1px rgba(45, 31, 31, 0.10) solid;
    outline-offset: -1px;
    color: #2d1f1f;
    background: transparent;
    line-height: 24px;
    white-space: nowrap;
}

.category-tab.category-tab--active {
    background: #1a1a1a;
    color: white;
    font-weight: 600;
    text-transform: capitalize;
    outline: none;
}

/* "View More" button centered below the products grid */
.category-section-footer {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* ============================================
   MOBILE NEW ARRIVALS — FIGMA REDESIGN
   Solid white card below hero, centered title
   ============================================ */
@media (max-width: 1023px) {

    /* Same horizontal spacing as other sections */
    .new-arriaval-products-container.jsx-1401438402 {
        padding: 0 15px !important;
    }

    /* Dark blurry wrapper */
    .new-arriaval-products-container .showcase-section {
        background: rgba(30, 30, 30, 0.72) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-radius: 26px !important;
        overflow: hidden !important;
        padding: 0px;
        margin-bottom: 0 !important;
    }

    /* Heading row: transparent — inherits dark bg */
    .new-arriaval-products-container .showcase-section-heading-row {
        background: transparent !important;
        border-radius: 0 !important;
        justify-content: center !important;
        padding: 24px 16px 16px !important;
    }

    /* Title: large bold white, centered — matches Figma */
    .new-arriaval-products-container .showcase-section-heading {
        color: #ffffff !important;
        text-align: center !important;
        font-size: 20px !important;
        font-weight: 700 !important;
    }

    /* Hide View More button from heading row */
    .new-arriaval-products-container .showcase-section-heading-row .jsx-2551956705.button {
        display: none !important;
    }

    /* Product grid: rounded corners, no side margin */
    .new-arriaval-products-container .products-container {
        border-radius: 24px !important;
        margin: 0 !important;
    }
}

/* === PRODUCTS GRID: beige bg, rounded corners, 1px card dividers === */
@media (min-width: 1024px) {
    /* New Arrivals: big card LEFT, 2×2 small cards RIGHT */
    .new-arriaval-products-container .products-container.jsx-2630333056 {
        grid-template-areas: "a a b c" "a a d e" !important;
    }

    /* Explore by Category: uniform 4×3 grid (12 products, all equal size) */
    .trending-products-container .products-container.jsx-2492920896 {
        grid-template-areas: unset !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    }
    .trending-products-container .products-container.jsx-2492920896 > * {
        grid-area: auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
        display: flex !important;
    }

    /* New Arrivals products grid — inherits 24px border-radius from general rule */
    .new-arriaval-products-container .products-container {
        border-radius: 24px !important;
    }

    .products-container {
        border-radius: 24px !important;
        overflow: hidden !important;
        background: #E0DCD3 !important;
        outline: 1px #E0DCD3 solid !important;
        outline-offset: -1px !important;
        gap: 1px !important;
        padding: 1px !important;
    }
}
