/* ==========================================================
   Green Jofiyat — Header & Navigation
   ========================================================== */

/* Announcement bar */
.gj-announce {
    background: var(--gradient-earth);
    color: #fff;
    font-size: var(--text-sm);
    text-align: center;
    padding: 0.5rem 0;
}

/* Header shell */
.gj-header {
    position: sticky; top: 0;
    z-index: var(--z-header);
    background: rgba(250, 246, 238, 0.85);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--gj-border);
    transition: box-shadow var(--transition-base), background var(--transition-base);
}
.gj-header.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
}
/* Keep the sticky header below the WP admin bar for logged-in users */
body.admin-bar .gj-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .gj-header { top: 46px; } }
.gj-header__inner {
    display: flex; align-items: center; gap: var(--space-lg);
    min-height: var(--header-height);
}

/* Logo */
.gj-logo { display: inline-flex; align-items: center; gap: 0.6rem; }
.gj-logo__mark { color: var(--gj-primary); width: 34px; height: 34px; }
.gj-logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.gj-logo__text strong { font-size: var(--text-xl); color: var(--gj-primary-dark); font-weight: 800; }
.gj-logo__text em { font-size: var(--text-xs); color: var(--gj-text-muted); font-style: normal; }
.gj-logo--light .gj-logo__text strong { color: #fff; }

/* Custom logo (logo1) */
.gj-header .custom-logo-link { display: inline-flex; align-items: center; }
.gj-header .custom-logo { height: 52px; width: auto; }

/* Secondary / partner logo (logo2) in header */
.gj-header__partner { display: flex; align-items: center; padding-inline-start: 14px; margin-inline-start: 14px; border-inline-start: 1px solid var(--gj-border); }
.gj-header__partner img { height: 40px; width: auto; }
@media (max-width: 1100px) { .gj-header__partner { display: none; } }

/* Primary nav — centered in the header */
.gj-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.gj-nav__list { display: flex; align-items: center; gap: var(--space-lg); }
.gj-nav__list > li > a {
    font-weight: 600; font-size: var(--text-base);
    padding: 0.4rem 0; position: relative; color: var(--gj-text);
}
.gj-nav__list > li > a::after {
    content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 2px;
    background: var(--gj-primary); transform: scaleX(0); transform-origin: center;
    transition: transform var(--transition-base);
}
.gj-nav__list > li > a:hover::after,
.gj-nav__list > li.current-menu-item > a::after { transform: scaleX(1); }

/* Actions */
.gj-header__actions { display: flex; align-items: center; gap: 0.25rem; }
.gj-action {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: var(--radius-circle);
    color: var(--gj-text); transition: background var(--transition-fast), color var(--transition-fast);
    font-weight: 700; font-size: var(--text-sm);
}
.gj-action:hover { background: rgba(46,125,79,0.10); color: var(--gj-primary); }
.gj-action .gj-icon { width: 22px; height: 22px; }
.gj-cart-count {
    position: absolute; top: 2px; inset-inline-end: 2px;
    min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--gj-gold); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: var(--radius-pill); display: grid; place-items: center;
}

/* Burger (mobile) */
.gj-header__burger { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; color: var(--gj-text); }
.gj-header__burger .gj-icon { width: 26px; height: 26px; }

/* Mobile drawer */
.gj-menu-backdrop {
    position: fixed; inset: 0; background: rgba(26,74,48,0.45);
    opacity: 0; visibility: hidden; transition: opacity var(--transition-base); z-index: var(--z-overlay);
}
.gj-menu-backdrop.is-open { opacity: 1; visibility: visible; }
.gj-mobile-menu {
    position: fixed; top: 0; left: 0; right: auto; height: 100dvh; width: min(320px, 86vw);
    background: var(--gj-bg-white); z-index: var(--z-mobile-menu);
    transform: translateX(-100%); transition: transform var(--transition-base);
    padding: var(--space-lg); overflow-y: auto; box-shadow: var(--shadow-xl);
    will-change: transform;
}
/* RTL: anchor right and hide off the right edge */
html[dir="rtl"] .gj-mobile-menu { left: auto; right: 0; transform: translateX(100%); }
/* Open state wins for both directions (higher specificity, declared last) */
.gj-mobile-menu.is-open { transform: translateX(0); }
.gj-mobile-menu__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); padding-bottom: var(--space-md); border-bottom: 1px solid var(--gj-border); }
.gj-mobile-menu__list { display: flex; flex-direction: column; gap: 0.25rem; }
.gj-mobile-menu__list a { display: block; padding: 0.85rem 0.5rem; font-weight: 600; border-radius: var(--radius-md); }
.gj-mobile-menu__list a:hover { background: var(--gj-bg-alt); color: var(--gj-primary); }

body.gj-no-scroll { overflow: hidden; }

@media (max-width: 991px) {
    .gj-nav { display: none; }
    .gj-header__burger { display: inline-flex; }
    .gj-header__brand { margin-inline-end: auto; }
}
