/* ============================================================
   Modern storefront overrides — tight Shopify/Apple-style
   Loaded after style.css so these rules take precedence.
   ============================================================ */

:root {
    --m-bg: #FAFAF7;
    --m-surface: #FFFFFF;
    --m-border: #ECECE7;
    --m-border-strong: #D9D9D2;
    --m-text: #111111;
    --m-text-muted: #6E6E6E;
    --m-shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04);
    --m-shadow-md: 0 4px 16px rgba(17, 17, 17, 0.06);
    --m-shadow-lg: 0 10px 30px rgba(17, 17, 17, 0.08);
    --m-radius: 12px;
    --m-radius-sm: 8px;
    --m-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Lift the dark green page background — it's now a neutral canvas.
   The header and hero section keep their own backgrounds. */
body {
    background-color: var(--m-bg) !important;
    color: var(--m-text);
}
body::before { display: none !important; }

/* ============================================================
   Products listing page
   ============================================================ */

.products-header-modern {
    background: var(--m-surface) !important;
    border-bottom: 1px solid var(--m-border);
    padding: 2.5rem 0 1.5rem !important;
    margin: 0 !important;
}
.products-header-modern::before,
.products-header-modern::after { display: none !important; }

.breadcrumb-modern {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.85rem;
}
.breadcrumb-modern .breadcrumb-item,
.breadcrumb-modern .breadcrumb-item a {
    color: var(--m-text-muted) !important;
    text-decoration: none;
}
.breadcrumb-modern .breadcrumb-item.active { color: var(--m-text) !important; }

.page-title-modern {
    color: var(--m-text) !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    margin: 0 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

.products-modern-container {
    padding-top: 2rem !important;
    padding-bottom: 4rem !important;
    background: transparent !important;
}

/* Results / sort bar — synthesized via the existing row markup */
.products-row {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

/* ============================================================
   Filter sidebar — clean, sticky, no heavy shadows
   ============================================================ */

.filter-card-modern {
    border: 1px solid var(--m-border) !important;
    border-radius: var(--m-radius) !important;
    box-shadow: none !important;
    background: var(--m-surface) !important;
    position: sticky;
    top: 100px;
}

.filter-header-modern {
    background: transparent !important;
    color: var(--m-text) !important;
    padding: 1.25rem 1.25rem 0.75rem !important;
    border-bottom: 1px solid var(--m-border) !important;
}
.filter-header-modern h5 {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--m-text) !important;
    letter-spacing: 0.01em;
}
.filter-header-modern h5 i { color: var(--gold); }

.filter-body-modern { padding: 1rem 1.25rem 1.25rem !important; }
.filter-body-modern h6 {
    color: var(--m-text-muted) !important;
    font-size: 0.72rem !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600 !important;
    margin-bottom: 0.6rem !important;
}

.custom-category-list .list-group-item,
.filter-body-modern .list-group-item {
    border: 1px solid transparent !important;
    border-radius: var(--m-radius-sm) !important;
    margin-bottom: 2px !important;
    background: transparent !important;
    color: var(--m-text) !important;
    font-weight: 500 !important;
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem !important;
    transition: background-color 0.18s var(--m-ease), color 0.18s var(--m-ease) !important;
}
.custom-category-list .list-group-item:hover,
.filter-body-modern .list-group-item:hover {
    background: #F4F4EE !important;
    color: var(--m-text) !important;
    transform: none !important;
}
.custom-category-list .list-group-item.active,
.filter-body-modern .list-group-item.active {
    background: var(--primary) !important;
    color: #FFF !important;
    box-shadow: none !important;
    border-color: var(--primary) !important;
}
.custom-category-list .list-group-item.active i,
.filter-body-modern .list-group-item.active i { color: var(--gold) !important; }

/* ============================================================
   Product card — minimal, fast hover, square-ish image
   ============================================================ */

.product-card-modern {
    border: 1px solid var(--m-border) !important;
    border-radius: var(--m-radius) !important;
    background: var(--m-surface) !important;
    box-shadow: none !important;
    overflow: hidden;
    transition: transform 0.25s var(--m-ease), box-shadow 0.25s var(--m-ease), border-color 0.25s var(--m-ease) !important;
}
.product-card-modern:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--m-shadow-md) !important;
    border-color: var(--m-border-strong) !important;
}

/* Strip the gold corner ornament — too heavy for this aesthetic */
.product-card-modern.ornament-corner::before,
.product-card-modern.ornament-corner::after { display: none !important; }

.product-card-modern .product-image-container {
    background: #F4F4EE;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.product-card-modern .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--m-ease) !important;
}
.product-card-modern:hover .product-image {
    transform: scale(1.04) !important;
}

.product-card-modern .card-body {
    padding: 0.9rem 1rem 1.1rem !important;
}
.product-card-modern .card-title {
    color: var(--m-text) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    line-height: 1.35;
    margin-bottom: 0.4rem !important;
    letter-spacing: -0.005em;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-modern .product-meta {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.product-card-modern .product-price {
    color: var(--m-text) !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
}
.product-card-modern .product-old-price {
    color: var(--m-text-muted) !important;
    text-decoration: line-through;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
}
.product-card-modern .product-size,
.product-card-modern .product-size-separator {
    color: var(--m-text-muted) !important;
    font-size: 0.8rem !important;
}

/* Favorite button */
.product-card-modern .btn-favorite {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid var(--m-border) !important;
    width: 34px !important;
    height: 34px !important;
    box-shadow: var(--m-shadow-sm) !important;
    backdrop-filter: blur(6px);
}
.product-card-modern .btn-favorite i { color: var(--m-text-muted); font-size: 0.95rem; }
.product-card-modern .btn-favorite.active i,
.product-card-modern .btn-favorite:hover i { color: #E0445B; }

/* New / code badge */
.product-card-modern .product-new-badge .badge-new {
    background: var(--m-text) !important;
    color: #FFF !important;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
}
.product-card-modern .product-code-badge {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #FFF !important;
    font-size: 0.7rem !important;
    backdrop-filter: blur(4px);
}

/* ============================================================
   Size chips — pill-row at the top of the listing
   ============================================================ */

.sizes-horizontal-scroll {
    background: transparent !important;
    padding: 0 !important;
}
.size-chip {
    background: var(--m-surface) !important;
    border: 1px solid var(--m-border) !important;
    color: var(--m-text) !important;
    border-radius: 999px !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: background-color 0.18s var(--m-ease), border-color 0.18s var(--m-ease) !important;
}
.size-chip:hover {
    background: #F4F4EE !important;
    border-color: var(--m-border-strong) !important;
    color: var(--m-text) !important;
}
.size-chip.active {
    background: var(--primary) !important;
    color: #FFF !important;
    border-color: var(--primary) !important;
}

/* ============================================================
   Pagination — minimal numeric pills
   ============================================================ */

.pagination .page-link {
    border: 1px solid var(--m-border) !important;
    color: var(--m-text) !important;
    border-radius: var(--m-radius-sm) !important;
    margin: 0 3px;
    padding: 0.5rem 0.85rem !important;
    font-weight: 500;
    background: var(--m-surface) !important;
}
.pagination .page-link:hover {
    background: #F4F4EE !important;
    border-color: var(--m-border-strong) !important;
}
.pagination .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #FFF !important;
}
.pagination .page-item.disabled .page-link {
    background: transparent !important;
    color: var(--m-border-strong) !important;
}

/* ============================================================
   Floating filter button (mobile)
   ============================================================ */
.floating-filter-btn {
    background: var(--primary) !important;
    color: #FFF !important;
    border-radius: 999px !important;
    box-shadow: var(--m-shadow-md) !important;
    border: none !important;
}
.floating-filter-btn i { color: var(--gold) !important; }

/* ============================================================
   Reduce motion / heavy effects
   ============================================================ */
.animate-stagger-1, .animate-stagger-2, .animate-stagger-3,
.animate-stagger-4, .animate-stagger-5 { animation-duration: 0.4s !important; }

/* ============================================================
   Header — Option C: compact logo + icon-tile nav
   ============================================================ */

/* Brand: vertically centered, double-sized logo (76px) */
.header-ultra-modern .brand-section,
.header-ultra-modern .brand-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;   /* fill full pill height */
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
}
.header-ultra-modern .brand-section .logo-image {
    height: 76px !important;
    width: auto !important;
    display: block;
    margin: 0 auto !important;
    /* The logo image has empty space at the top — pull the visual
       content upward so the artwork's optical centre sits in the pill's centre. */
    object-fit: contain;
    object-position: center;
}
.header-ultra-modern .brand-section .brand-text {
    font-size: 1.4rem !important;
    line-height: 1;
    margin: 0;
}
/* Force the pill to be tall enough that logo + breathing room is visible
   and centring is unambiguous. */
.header-ultra-modern .nav-container {
    align-items: stretch !important;
    min-height: 100px;
    padding: 8px 14px !important;
}
.header-ultra-modern .nav-menu,
.header-ultra-modern .actions-section {
    align-items: center !important;
    align-self: center !important;
}

/* Each nav item becomes a vertical tile: icon-on-top, label-below */
.header-ultra-modern .nav-link-modern {
    flex-direction: column !important;
    gap: 0.25rem !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: 12px !important;
    line-height: 1 !important;
    min-width: 78px;
    text-align: center;
    transition: transform 0.2s var(--m-ease), background-color 0.2s var(--m-ease) !important;
}

/* The kill rule on the underline pseudo — tiles don't use it */
.header-ultra-modern .nav-link-modern::before,
.header-ultra-modern .nav-link-modern.active::before {
    display: none !important;
}

/* Icon — wrap visually in a gold circle */
.header-ultra-modern .nav-link-modern i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15) 0%, rgba(201, 168, 76, 0.08) 100%);
    color: var(--gold);
    border-radius: 50%;
    font-size: 1rem;
    transition: background-color 0.2s var(--m-ease), color 0.2s var(--m-ease), transform 0.2s var(--m-ease);
}

/* Label below the icon */
.header-ultra-modern .nav-link-modern span {
    font-size: 0.78rem !important;
    font-weight: 600;
    color: var(--primary, #1A3A2E);
    letter-spacing: 0.01em;
}

/* Hover/active — fill the circle with brand gold and lift the whole tile */
.header-ultra-modern .nav-link-modern:hover {
    color: inherit !important;          /* override the original color: gold */
    background: rgba(201, 168, 76, 0.07);
    transform: translateY(-2px);
}
.header-ultra-modern .nav-link-modern:hover i {
    background: var(--gold);
    color: #FFFFFF;
    transform: scale(1.05);
}
.header-ultra-modern .nav-link-modern.active i {
    background: var(--primary, #1A3A2E);
    color: var(--gold);
}
.header-ultra-modern .nav-link-modern.active span {
    color: var(--primary, #1A3A2E);
}

/* Nav menu container — increase gap between tiles for breathing room */
.header-ultra-modern .nav-menu {
    gap: 0.5rem;
}

/* Mobile (≤768) — fall back to a single-row compact pill */
@media (max-width: 768px) {
    .header-ultra-modern .nav-link-modern {
        flex-direction: row !important;
        min-width: 0;
        gap: 0.4rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    .header-ultra-modern .nav-link-modern i {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
    .header-ultra-modern .nav-link-modern span {
        font-size: 0.78rem !important;
    }
}

/* ============================================================
   Storefront text contrast fix
   The body bg was forest green; my override turned it cream.
   Sections that relied on the dark bg still force white text
   on their headings — make them dark for the new light canvas.
   Sections that have their OWN dark background (gradient/var(--primary))
   are unaffected because the selectors below only target the
   transparent-bg sections.
   ============================================================ */

.recent-products-section .section-heading-display,
.recent-products-section h2,
.recent-products-section .recent-heading h2 {
    color: var(--text-primary, #1A1410) !important;
}
.recent-products-section .eyebrow,
.recent-products-section .recent-heading .eyebrow {
    color: var(--gold-dark, #A8873A) !important;
}
.recent-products-section .section-subtitle,
.recent-products-section p {
    color: var(--text-secondary, #4A3F35) !important;
}

/* Empty-state line in the recent section */
.recent-products-section .recent-empty,
.recent-products-section .empty-state,
.recent-products-section small {
    color: var(--text-secondary, #4A3F35) !important;
    opacity: 0.85;
}

/* Generic safety net: any heading/lead on a section that has no explicit
   dark background gets dark text. The brand-showcase / hero sections still
   set their own white color directly on their elements, which wins. */
section:not([class*="hero"]):not([class*="primary"]):not([class*="brand-showcase"]) > .container h2,
section:not([class*="hero"]):not([class*="primary"]):not([class*="brand-showcase"]) > .container h3 {
    color: var(--text-primary, #1A1410);
}

/* ============================================================
   Product card — switch from absolute overlay to flow layout
   The legacy products.php stacks card-body absolutely over the
   image with a 20%-black backdrop. With the modern text colours
   this becomes unreadable. Force a traditional image-above /
   text-below layout so the title and price are clearly visible.
   ============================================================ */
.product-card-modern {
    min-height: 0 !important;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
}
.product-card-modern .product-image-container {
    position: relative !important;   /* not absolute */
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    z-index: 1;
}
.product-card-modern .card-body {
    position: relative !important;   /* not absolute */
    background: transparent !important;
    backdrop-filter: none !important;
    text-align: right !important;
    padding: 0.9rem 1rem 1.1rem !important;
    z-index: 1;
}
.product-card-modern .card-title {
    color: var(--m-text, #111) !important;
    text-shadow: none !important;
    text-align: right !important;
    font-size: 0.95rem !important;
    margin-bottom: 0.4rem !important;
}
.product-card-modern .product-meta {
    justify-content: flex-start !important;
    margin-top: 0 !important;
}

/* ============================================================
   "Why Diwan Al-Amir" / brand-story section text contrast
   The headline was hard-set white for the original dark body —
   re-darken it now that the canvas is cream.
   ============================================================ */
.brand-story-title,
.brand-story-title.heading-display {
    color: var(--text-primary, #1A1410) !important;
}
.brand-story-text {
    color: var(--text-secondary, #4A3F35) !important;
}
.brand-story-label {
    color: var(--gold-dark, #A8873A) !important;
    background: rgba(201, 168, 76, 0.10) !important;
    border-color: rgba(201, 168, 76, 0.25) !important;
}
.brand-feature strong {
    color: var(--text-primary, #1A1410) !important;
}
.brand-feature span {
    color: var(--text-secondary, #4A3F35) !important;
}

/* ============================================================
   Header user pill — show name + status with readable contrast
   The legacy stylesheet hides the user info at ≤992px and the
   text colour was relying on inheritance. Force visibility and
   dark theme colours on any viewport ≥640px.
   ============================================================ */
@media (min-width: 640px) {
    .header-ultra-modern .user-btn .user-info {
        display: flex !important;
    }
}
.header-ultra-modern .user-btn,
.header-ultra-modern .user-btn .user-name,
.header-ultra-modern .user-btn .user-status {
    color: var(--primary, #1A3A2E) !important;
}
.header-ultra-modern .user-btn .user-name {
    font-weight: 600 !important;
    font-size: 0.92rem !important;
}
.header-ultra-modern .user-btn .user-status {
    color: var(--gold-dark, #A8873A) !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}
.header-ultra-modern .user-btn {
    background: #ffffff !important;
    border-color: var(--m-border, #ECECE7) !important;
}
.header-ultra-modern .user-btn:hover {
    border-color: var(--gold, #C9A84C) !important;
    background: #FAFAF7 !important;
}

/* ============================================================
   Title/heading font uniformity
   Every page-level title or section heading uses the brand
   display font (Amiri/Reem Kufi). Some classes were inheriting
   the body font (Tajawal); this rule lines them all up.
   ============================================================ */
.about-title,
.section-title,
.section-heading-display,
.section-subtitle,
.brand-story-title,
.page-title-modern,
.page-title,
.hero-title,
.slide-title,
.variants-section-title,
.empty-state-title,
.recent-card-title,
.recent-heading h2,
.recent-products-section h2,
.brand-narrative h2,
.brand-showcase h2,
section h1, section h2, section h3 {
    font-family: var(--font-display, 'Amiri', 'Reem Kufi', serif) !important;
    letter-spacing: -0.005em;
}

/* ============================================================
   ONE FONT FOR THE WHOLE SITE
   Override every element — body, headings, buttons, inputs, nav.
   Beats every existing font-family declaration via !important on a
   universal selector.
   ============================================================ */
html, body,
html body *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]):not([class*="icon-"]):not(.material-icons):not(.material-symbols-outlined),
h1, h2, h3, h4, h5, h6,
p, span, div, a, li,
button, input, select, textarea, label,
.about-title, .section-title, .section-heading-display, .brand-story-title,
.page-title-modern, .hero-title, .slide-title, .variants-section-title,
.empty-state-title, .recent-card-title, .card-title, .nav-link-modern,
.btn-mensonly, .btn-hero-primary, .btn-hero-secondary,
.product-price, .product-old-price, .eyebrow, .brand-story-label {
    font-family: 'Tajawal', 'Droid Arabic Kufi', sans-serif !important;
}

/* Never override icon-font families — they carry the glyphs */
i[class*="fa-"], .fa, .fas, .far, .fab, .fal, .fad,
i[class*="fa-"]::before, .fa::before, .fas::before, .far::before, .fab::before, .fal::before, .fad::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Brands", FontAwesome !important;
}
.fab, .fab::before { font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important; }
[class*="icon-"]:not([class*="fa-"]) { font-family: inherit; }
