/* ==========================================================================
   وعد — site chrome: header, footer, phone tab bar. (Homepage sections: waad-home.css)
   ========================================================================== */

:root {
    --w-green: #102D20;
    --w-deep: #092318;
    --w-green-2: #183D2B;
    --w-cream: #F8F0E2;
    --w-ivory: #FFF9EF;
    --w-beige: #EADCC5;
    --w-gold: #C9A45C;
    --w-gold-soft: #E4C27D;
    --w-ink: #24251F;
    --w-muted: #77736B;
    --w-red: #B51626;
    --w-paper: #FFF9EF;
    --font-ui: 'IBM Plex Sans Arabic', 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --font-display: 'Amiri', 'Times New Roman', serif;
    --wrap: 1320px;
    --gutter: 24px;
    --hd-top: 34px;
    --ease: cubic-bezier(.22, .7, .2, 1);
}
@media (max-width: 767.98px) { :root { --gutter: 16px; } }

body { font-family: var(--font-ui); color: var(--w-ink); background: var(--w-cream); }
.wrap { width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); }

/* ------------------------------ header ------------------------------ */
.hd { position: sticky; top: calc(-1 * var(--hd-top)); z-index: 1030; font-family: var(--font-ui); }
.hd-top { height: var(--hd-top); background: var(--w-deep); color: #eadfc4; font-size: .8rem; border-bottom: 1px solid rgba(201, 164, 92, .28); }
.hd-top-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 100%; gap: 1rem; }
.hd-top-acct { display: flex; align-items: center; gap: .7rem; justify-self: start; }
.hd-top-acct a { color: #eadfc4; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; transition: color .2s; }
.hd-top-acct a:hover { color: var(--w-gold-soft); }
.hd-hello { color: var(--w-gold-soft); }
.hd-sep { width: 1px; height: 12px; background: rgba(228, 194, 125, .45); }
.hd-top-msg { margin: 0; display: flex; align-items: center; gap: .7rem; color: #f1e6cb; letter-spacing: .02em; white-space: nowrap; }
.hd-top-msg .dia { width: 6px; height: 6px; background: var(--w-gold); transform: rotate(45deg); flex: none; }
.hd-top-social { display: flex; align-items: center; gap: .35rem; justify-self: end; }
.hd-top-social a { color: #eadfc4; width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; font-size: .78rem; transition: all .2s; text-decoration: none; }
.hd-top-social a:hover { color: var(--w-deep); background: var(--w-gold); }

.hd-main { background: var(--w-cream); border-bottom: 1px solid var(--w-beige); transition: box-shadow .3s; }
.hd.is-stuck .hd-main { box-shadow: 0 10px 28px rgba(16, 45, 32, .12); }
.hd-main-in { display: flex; align-items: center; gap: 1.4rem; min-height: 80px; }
.hd-logo { display: block; flex: none; line-height: 0; }
.brand-wordmark { height: 58px; width: auto; display: block; }
.hd-cart-m, .hd-burger { display: none; }

.hd-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.hd-list { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.hd-item { position: relative; display: flex; align-items: center; }
.hd-link { color: var(--w-green); font-weight: 600; font-size: .98rem; text-decoration: none; padding: 1.7rem .85rem; position: relative; white-space: nowrap; transition: color .2s; display: block; }
.hd-link::after { content: ''; position: absolute; inset-inline: .85rem; bottom: 1.15rem; height: 2px; background: var(--w-gold); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .3s var(--ease); }
.hd-link:hover, .hd-link.is-active { color: var(--w-green); }
.hd-link:hover::after, .hd-link.is-active::after, .hd-dd:hover > .hd-link::after { transform: scaleX(1); }
.hd-link-gold { color: #8a6a22; }
.hd-caret { background: none; border: 0; color: var(--w-green); font-size: .65rem; padding: .5rem .25rem; margin-inline-start: -.7rem; margin-inline-end: .2rem; cursor: pointer; opacity: .7; transition: transform .25s, opacity .2s; }
.hd-dd:hover > .hd-caret, .hd-dd.open > .hd-caret { opacity: 1; }
.hd-dd.open > .hd-caret i, .hd-dd:hover > .hd-caret i { transform: rotate(180deg); }
.hd-caret i { transition: transform .25s; display: inline-block; }

.hd-menu { position: absolute; top: calc(100% - .35rem); inset-inline-start: 0; min-width: 230px; background: var(--w-ivory); border: 1px solid var(--w-beige); border-radius: 14px; box-shadow: 0 22px 48px rgba(9, 35, 24, .22); padding: .5rem; display: none; z-index: 20; }
.hd-menu::before { content: ''; position: absolute; inset-inline-start: 1.4rem; top: -6px; width: 10px; height: 10px; background: var(--w-ivory); border-top: 1px solid var(--w-beige); border-inline-start: 1px solid var(--w-beige); transform: rotate(45deg); }
.hd-dd:hover > .hd-menu, .hd-dd:focus-within > .hd-menu, .hd-dd.open > .hd-menu { display: block; animation: hdMenu .2s var(--ease); }
@keyframes hdMenu { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hd-menu a, .hd-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .85rem; border: 0; background: none; border-radius: 10px; color: var(--w-ink); font: inherit; font-size: .93rem; text-decoration: none; text-align: right; cursor: pointer; transition: background .2s, color .2s; }
.hd-menu a:hover, .hd-menu button:hover { background: var(--w-cream); color: var(--w-green); }
.hd-menu i { color: var(--w-gold); width: 1.1rem; text-align: center; }
.hd-menu-all { color: var(--w-green) !important; font-weight: 700; border-top: 1px solid var(--w-beige); border-radius: 0 0 10px 10px !important; margin-top: .3rem; padding-top: .8rem !important; }
.hd-menu-title { display: block; padding: .5rem .85rem; color: var(--w-muted); font-size: .8rem; border-bottom: 1px solid var(--w-beige); margin-bottom: .3rem; }
.hd-menu-left { inset-inline-start: auto; inset-inline-end: 0; }
.hd-menu-left::before { inset-inline-start: auto; inset-inline-end: 1.2rem; }
.hd-only-m { display: none; }

.hd-tools { display: flex; align-items: center; gap: .55rem; flex: none; }
.hd-icon { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--w-beige); background: #fff; color: var(--w-green); display: inline-grid; place-items: center; font-size: 1.1rem; cursor: pointer; transition: all .2s; text-decoration: none; }
.hd-icon:hover { border-color: var(--w-gold); background: var(--w-ivory); color: var(--w-green); transform: translateY(-1px); }
.hd-acct-dd { position: relative; }

/* cart: always visible, icon + live count + live total */
.hd .hd-cart { height: 46px; padding: 0 .95rem; gap: .55rem; border-radius: 12px; background: var(--w-green); border: 1.5px solid var(--w-green); color: var(--w-cream) !important; font-weight: 700; display: inline-flex; align-items: center; transition: all .25s var(--ease); text-decoration: none; }
.hd .hd-cart:hover { background: var(--w-deep); border-color: var(--w-gold); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(16, 45, 32, .28); }
/* the cart drawer's own stylesheet turns the pill text dark on hover (made for the old gold hover): keep it cream */
.hd .hd-cart:hover, .hd .hd-cart:hover .cart-total-label, .hd .hd-cart:hover .cart-total-label * { color: var(--w-cream) !important; }
.hd .hd-cart:hover .fa-shopping-bag { color: var(--w-gold-soft) !important; }
.hd .hd-cart .fa-shopping-bag { color: var(--w-gold-soft); font-size: 1.15rem; }
.hd .hd-cart .cart-total-label { font-size: .85rem; white-space: nowrap; display: none; }
.hd .hd-cart .cart-badge { background: var(--w-gold); color: var(--w-deep); min-width: 24px; height: 24px; font-size: .8rem; font-weight: 800; box-shadow: none; }
@media (min-width: 1280px) { .hd .hd-cart .cart-total-label { display: inline; } }

/* search (existing live search) restyled: square dark button like the reference */
.hd-tools .nav-search { width: clamp(220px, 20vw, 330px); order: 0; padding: 0; flex: 0 1 auto; }
.hd-tools .wsearch-box { background: #fff; border: 1.5px solid var(--w-beige); border-radius: 12px; padding: 0; overflow: hidden; height: 46px; }
.hd-tools .wsearch-box:focus-within { border-color: var(--w-gold); box-shadow: 0 0 0 3px rgba(201, 164, 92, .25); }
.hd-tools .wsearch-input { font-family: var(--font-ui); font-size: .92rem; padding: 0 .9rem; height: 100%; }
.hd-tools .wsearch-btn { width: 46px; height: 100%; border-radius: 0; padding: 0; background: var(--w-green); color: var(--w-cream); display: grid; place-items: center; font-size: 1rem; transition: background .2s; }
.hd-tools .wsearch-btn:hover { background: var(--w-deep); color: var(--w-gold-soft); }
.hd-tools .wsearch-panel { width: min(540px, 94vw); right: auto; left: 0; }

@media (max-width: 1199.98px) {
    .hd-link { padding-inline: .6rem; font-size: .93rem; }
    .hd-link::after { inset-inline: .6rem; }
    .hd-tools .nav-search { width: clamp(180px, 18vw, 250px); }
}

/* ---- tablet / phone header ---- */
@media (max-width: 991.98px) {
    :root { --hd-top: 30px; }
    .hd { position: relative; top: 0; }   /* on phones the tab bar is the persistent navigation: no tall sticky header */
    .hd-top { font-size: .72rem; }
    .hd-top-in { grid-template-columns: 1fr; justify-items: center; }
    .hd-top-acct, .hd-top-social { display: none; }
    .hd-main-in { flex-wrap: wrap; min-height: 0; padding-block: .55rem .6rem; gap: .5rem; justify-content: space-between; }
    .hd-cart-m { display: grid; order: 1; position: relative; width: 44px; height: 44px; place-items: center; color: var(--w-green) !important; font-size: 1.3rem; text-decoration: none; }
    .hd-cart-m .cart-badge { position: absolute; top: 2px; right: 0; background: var(--w-gold) !important; color: var(--w-deep) !important; min-width: 20px; height: 20px; font-size: .72rem; box-shadow: none; animation: none; }
    .hd-logo { order: 2; margin-inline: auto; }
    .brand-wordmark { height: 46px; }
    .hd-burger { order: 3; display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; align-items: center; background: none; border: 0; cursor: pointer; }
    .hd-burger span { width: 24px; height: 2px; background: var(--w-green); border-radius: 2px; transition: transform .3s, opacity .2s; }
    .hd.nav-open .hd-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hd.nav-open .hd-burger span:nth-child(2) { opacity: 0; }
    .hd.nav-open .hd-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .hd-tools { order: 5; flex: 1 1 100%; }
    .hd-tools .nav-search { width: 100%; flex: 1 1 100%; }
    .hd-tools .hd-acct, .hd-tools .hd-acct-dd, .hd-tools .hd-cart { display: none; }
    .hd-nav { order: 6; flex: 1 1 100%; display: none; justify-content: stretch; }
    .hd.nav-open .hd-nav { display: block; animation: hdMenu .25s var(--ease); }
    .hd-list { flex-direction: column; align-items: stretch; gap: 0; background: var(--w-ivory); border: 1px solid var(--w-beige); border-radius: 16px; padding: .4rem; box-shadow: 0 18px 36px rgba(9, 35, 24, .16); max-height: 70vh; overflow-y: auto; }
    .hd-item { flex-wrap: wrap; }
    .hd-link { flex: 1; padding: .85rem 1rem; border-radius: 10px; }
    .hd-link::after { display: none; }
    .hd-link.is-active { background: var(--w-cream); box-shadow: inset 3px 0 0 var(--w-gold); }
    .hd-caret { margin: 0; padding: .85rem 1rem; font-size: .8rem; }
    .hd-menu, .hd-dd:hover > .hd-menu, .hd-dd:focus-within > .hd-menu { position: static; display: none; width: 100%; box-shadow: none; border: 0; background: var(--w-cream); border-radius: 12px; margin: 0 .3rem .4rem; min-width: 0; animation: none; }
    .hd-dd.open > .hd-menu { display: block; }
    .hd-menu::before { display: none; }
    .hd-only-m { display: flex; }
    .hd-sep-row { height: 1px; background: var(--w-beige); margin: .3rem .6rem; }
    .hd-item .fa-user, .hd-item .fa-receipt, .hd-item .fa-book-reader { color: var(--w-gold); margin-inline-end: .5rem; }
}

/* ------------------------------ phone tab bar ------------------------------ */
.mtabs { display: none; }
@media (max-width: 991.98px) {
    .mtabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 1600; background: var(--w-ivory); border-top: 1px solid var(--w-beige); box-shadow: 0 -10px 28px rgba(9, 35, 24, .12); padding-bottom: env(safe-area-inset-bottom); font-family: var(--font-ui); }
    .mtabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; color: var(--w-muted); text-decoration: none; font-size: .72rem; font-weight: 600; transition: color .2s; -webkit-tap-highlight-color: transparent; }
    .mtabs a i { font-size: 1.2rem; }
    .mtabs a.is-active { color: var(--w-green); }
    .mtabs a.is-active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; background: var(--w-gold); border-radius: 0 0 4px 4px; }
    .mtabs .cart-badge { position: absolute; top: 6px; margin-inline-start: 22px; background: var(--w-gold) !important; color: var(--w-deep) !important; min-width: 18px; height: 18px; font-size: .68rem; padding: 0 4px; box-shadow: none; animation: none; right: auto; left: auto; inset-inline-start: calc(50% + 6px); }
    body:has(.mtabs) { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
    /* keep the existing persistent cart summary, lifted above the tab bar and slimmer */
    body:has(.mtabs) .wc-bar { bottom: calc(58px + env(safe-area-inset-bottom)); padding: .35rem .75rem; z-index: 1550; }
    body:has(.mtabs).has-cart-bar { padding-bottom: calc(58px + 58px + env(safe-area-inset-bottom)); }
    body:has(.mtabs) .scroll-top { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
    body:has(.mtabs).has-cart-bar .scroll-top { bottom: calc(134px + env(safe-area-inset-bottom)) !important; }
    .wc-bar-main { min-height: 40px; }
    .wc-bar-cta { padding: .5rem .9rem; min-height: 40px; }
}

/* ------------------------------ footer ------------------------------ */
.ft { position: relative; background: radial-gradient(120% 140% at 100% 0%, #123626 0%, var(--w-deep) 55%, #07190f 100%); color: #d6c9ad; margin-top: 5rem; border-top: 3px solid var(--w-gold); overflow: hidden; font-family: var(--font-ui); }
.ft-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(500px 260px at 0% 100%, rgba(201, 164, 92, .12), transparent 70%), radial-gradient(420px 220px at 100% 0%, rgba(201, 164, 92, .08), transparent 70%); }
.ft-in { position: relative; padding-block: 3.6rem 1.2rem; }
.ft-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.35fr; gap: 2.4rem; }
.ft-logo { height: 86px; width: auto; display: block; margin-bottom: 1rem; }
.ft-brand p { color: #c4b799; line-height: 2; max-width: 34ch; margin: 0; font-size: .93rem; }
.ft h3 { font-family: var(--font-display); color: var(--w-gold-soft); font-size: 1.25rem; font-weight: 700; margin: 0 0 1.1rem; padding-bottom: .7rem; position: relative; }
.ft h3::after { content: ''; position: absolute; inset-inline-start: 0; bottom: 0; width: 42px; height: 2px; background: linear-gradient(270deg, var(--w-gold), transparent); }
.ft ul { list-style: none; margin: 0; padding: 0; }
.ft li { margin-bottom: .7rem; font-size: .93rem; }
.ft a { color: #e6d9bd; text-decoration: none; transition: color .2s, padding .2s; }
.ft-col:not(.ft-contact) a:hover { color: var(--w-gold-soft); padding-inline-start: .3rem; }
.ft-contact li { display: flex; align-items: center; gap: .7rem; }
.ft-contact i { color: var(--w-gold); width: 1.2rem; text-align: center; flex: none; }
.ft-contact a:hover { color: var(--w-gold-soft); }
.ft-social { display: flex; align-items: center; gap: .55rem; margin-top: 1.2rem; }
.ft-social span { font-size: .88rem; color: #c4b799; margin-inline-end: .3rem; }
.ft-social a { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid rgba(201, 164, 92, .5); color: var(--w-gold-soft); transition: all .25s; padding: 0 !important; }
.ft-social a:hover { background: var(--w-gold); color: var(--w-deep); transform: translateY(-3px); }
.ft-bottom { margin-top: 2.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(201, 164, 92, .28); text-align: center; }
.ft-bottom p { margin: 0; font-size: .82rem; color: #a99d84; }
@media (max-width: 1199.98px) { .ft-grid { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; } .ft-col:nth-child(4) { display: none; } }
@media (max-width: 767.98px) {
    .ft { margin-top: 3.2rem; }
    .ft-in { padding-block: 2.6rem 1rem; }
    .ft-grid { grid-template-columns: 1fr 1fr; gap: 1.8rem 1.2rem; }
    .ft-brand, .ft-contact { grid-column: 1 / -1; }
    .ft-col:nth-child(4) { display: block; }
    .ft-logo { height: 74px; }
    .ft-bottom { margin-bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) { .hd-menu { animation: none !important; } .hd-link::after { transition: none; } }
