/* ==========================================================================
   TIRAZ — Layout : announcement bar, header, mega-nav, footer
   Structure mirrors estore.iq (topbar → header w/ search + icons → nav bar)
   ========================================================================== */

/* ============ 1. Announcement bar ============ */
.topbar {
  background: var(--ink);
  color: #E8E1D6;
  font-size: var(--fs-xs);
  position: relative;
  z-index: calc(var(--z-header) + 2);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); height: 38px; }

.topbar__ticker { position: relative; flex: 1; height: 38px; overflow: hidden; min-width: 0; }
.topbar__msg {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(100%); transition: opacity .5s var(--e-out), transform .5s var(--e-out);
  white-space: nowrap;
}
.topbar__msg.on { opacity: 1; transform: none; }
.topbar__msg.out { opacity: 0; transform: translateY(-100%); }
.topbar__msg svg { width: 14px; height: 14px; color: var(--brass-2); flex: none; }
.topbar__msg b { color: var(--brass-2); font-weight: 600; }

.topbar__aside { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.topbar__sep { width: 1px; height: 14px; background: rgba(255,255,255,.16); }
.topbar__btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px;
  border-radius: var(--r-sm); color: #CFC6B8; transition: var(--t-fast); font-size: var(--fs-xs);
}
.topbar__btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.topbar__btn svg { width: 13px; height: 13px; }
.topbar__btn .flag { font-size: 12px; line-height: 1; }

@media (max-width: 780px) { .topbar__aside .t-hide { display: none; } }

/* ============ 2. Header ============ */
.header {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: var(--z-header);
  transition: box-shadow var(--t-med), background var(--t-med);
}
.header.stuck { box-shadow: var(--sh-3); background: rgba(255,255,255,.96); }

.header__main { display: flex; align-items: center; gap: var(--sp-6); height: var(--header-h); }

/* --- Logo --- */
.logo { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.logo__mark { width: 40px; height: 40px; flex: none; transition: transform var(--t-med); }
.logo:hover .logo__mark { transform: rotate(-6deg) scale(1.05); }
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__ar {
  font-family: var(--f-display); font-size: 22px; font-weight: 600;
  color: var(--ink); letter-spacing: .01em;
}
.logo__en {
  font-family: var(--f-latin); font-size: 8.5px; font-weight: 500;
  letter-spacing: .42em; color: var(--brass); margin-top: 3px;
}

/* --- Search (estore-style: category select + input + button) --- */
.search {
  flex: 1; max-width: 620px; position: relative;
  display: flex; align-items: stretch; height: 44px;
  background: var(--bone); border: 1px solid var(--line);
  border-radius: var(--r-full); overflow: hidden;
  transition: var(--t-fast);
}
.search:focus-within { background: #fff; border-color: var(--brass); box-shadow: 0 0 0 4px var(--brass-glow); }
.search__cat {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding-inline: 18px 32px; font-size: var(--fs-sm); color: var(--text-soft);
  max-width: 150px; flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237E766A' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 13px; background-position: left 14px center;
}
[dir="ltr"] .search__cat { background-position: right 14px center; padding-inline: 18px 32px; }
.search__div { width: 1px; background: var(--line); margin-block: 10px; flex: none; }
.search__input { flex: 1; min-width: 0; border: 0; background: transparent; padding-inline: 16px; font-size: var(--fs-base); }
.search__input::placeholder { color: var(--muted); }
.search__input:focus { outline: none; }
.search__btn {
  flex: none; width: 52px; display: grid; place-items: center;
  background: var(--ink); color: #fff; transition: var(--t-fast);
}
.search__btn:hover { background: var(--brass); }
.search__btn svg { width: 17px; height: 17px; }

/* Live suggestions */
.search__panel {
  position: absolute; top: calc(100% + 10px); inset-inline: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-4); padding: var(--sp-2); z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: var(--t-fast); max-height: 420px; overflow-y: auto;
}
.search__panel.open { opacity: 1; visibility: visible; transform: none; }
.search__group-title {
  font-size: var(--fs-xs); color: var(--muted); letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 12px 6px; font-family: var(--f-latin);
}
.sugg { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-md); transition: background var(--t-fast); }
.sugg:hover, .sugg.active { background: var(--bone); }
.sugg__img { width: 46px; height: 56px; border-radius: var(--r-sm); background: var(--bone); overflow: hidden; flex: none; }
.sugg__name { font-size: var(--fs-sm); font-weight: 500; }
.sugg__meta { font-size: var(--fs-xs); color: var(--muted); }
.sugg__price { margin-inline-start: auto; font-size: var(--fs-sm); font-weight: 600; color: var(--brass); font-family: var(--f-latin); }
.search__empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* --- Header actions --- */
.hactions { display: flex; align-items: center; gap: 2px; flex: none; margin-inline-start: auto; }
.iconbtn {
  position: relative; width: 42px; height: 42px; border-radius: var(--r-md);
  display: grid; place-items: center; color: var(--ink-3); transition: var(--t-fast);
}
.iconbtn:hover { background: var(--bone); color: var(--brass); }
.iconbtn svg { width: 20px; height: 20px; stroke-width: 1.6; }
.iconbtn__badge {
  position: absolute; top: 4px; inset-inline-end: 4px;
  min-width: 17px; height: 17px; padding-inline: 4px;
  background: var(--brass); color: #fff; border-radius: var(--r-full);
  font-family: var(--f-latin); font-size: 10px; font-weight: 600;
  display: grid; place-items: center; border: 2px solid #fff;
  transform: scale(0); transition: transform .3s var(--e-out);
}
.iconbtn__badge.on { transform: scale(1); }
.iconbtn__badge.bump { animation: badgeBump .45s var(--e-out); }
@keyframes badgeBump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.35); } }

.hactions__account {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 8px;
  border-radius: var(--r-md); transition: var(--t-fast);
}
.hactions__account:hover { background: var(--bone); }
.hactions__account svg { width: 20px; height: 20px; stroke-width: 1.6; color: var(--ink-3); }
.hactions__account .lbl { display: flex; flex-direction: column; line-height: 1.25; }
.hactions__account .lbl b { font-size: var(--fs-sm); font-weight: 600; }
.hactions__account .lbl span { font-size: 10.5px; color: var(--muted); }

.burger { display: none; }

@media (max-width: 1100px) { .search__cat, .search__div { display: none; } }
@media (max-width: 980px) {
  .header__main { gap: var(--sp-3); }
  .search { order: 3; flex-basis: 100%; max-width: none; height: 40px; margin-bottom: 12px; }
  .header__main { height: auto; flex-wrap: wrap; padding-top: 12px; }
  .hactions__account .lbl { display: none; }
  .burger { display: grid; }
}

/* ============ 3. Nav bar + mega menu ============ */
.navbar { border-top: 1px solid var(--line-2); background: transparent; }
.navbar__inner { display: flex; align-items: center; gap: var(--sp-1); height: 50px; }

.nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 15px; height: 50px; font-size: var(--fs-base); font-weight: 500;
  color: var(--ink-3); transition: color var(--t-fast); white-space: nowrap;
}
.nav__link::after {
  content: ''; position: absolute; bottom: 0; inset-inline: 15px; height: 2px;
  background: var(--brass); transform: scaleX(0); transform-origin: var(--o, right);
  transition: transform var(--t-med);
}
[dir="ltr"] .nav__link::after { --o: left; }
.nav__link:hover, .nav__link.active { color: var(--brass); }
.nav__link:hover::after, .nav__link.active::after { transform: scaleX(1); }
.nav__link .chev { width: 13px; height: 13px; transition: transform var(--t-fast); }
.nav__item.open .nav__link .chev { transform: rotate(180deg); }
.nav__link .dot { width: 5px; height: 5px; border-radius: 99px; background: var(--sale); }

.nav__item { position: static; }
.nav__spacer { flex: 1; }

.nav__cta {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding-inline: 14px;
  border: 1px solid var(--line); border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); transition: var(--t-fast);
}
.nav__cta:hover { border-color: var(--brass); color: var(--brass); background: #fff; }
.nav__cta svg { width: 15px; height: 15px; color: var(--brass); }

/* Mega panel */
.mega {
  position: absolute; inset-inline: 0; top: 100%;
  background: #fff; border-top: 1px solid var(--line-2); box-shadow: var(--sh-4);
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med);
  z-index: 30;
}
.nav__item.open .mega { opacity: 1; visibility: visible; transform: none; }
.mega__grid { display: grid; grid-template-columns: repeat(4, 1fr) 300px; gap: var(--sp-7); padding-block: var(--sp-7) var(--sp-8); }
.mega__col-title {
  font-family: var(--f-latin); font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass); margin-bottom: var(--sp-4); padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
[dir="rtl"] .mega__col-title { font-family: var(--f-body); letter-spacing: .06em; }
.mega__link {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
  font-size: var(--fs-base); color: var(--text-soft); transition: var(--t-fast);
}
.mega__link:hover { color: var(--brass); transform: translateX(var(--tx, -4px)); }
[dir="ltr"] .mega__link:hover { --tx: 4px; }
.mega__link .tag {
  font-size: 9.5px; font-family: var(--f-latin); font-weight: 600; letter-spacing: .06em;
  padding: 2px 6px; border-radius: var(--r-xs); background: #FCEEEF; color: var(--sale); text-transform: uppercase;
}
.mega__link .tag.new { background: #EDF3EE; color: var(--success); }

.mega__promo {
  border-radius: var(--r-lg); overflow: hidden; position: relative;
  background: var(--ink); min-height: 250px; display: flex; align-items: flex-end;
}
.mega__promo svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mega__promo-body { position: relative; padding: var(--sp-5); color: #fff; }
.mega__promo-body .eyebrow { color: var(--brass-3); }
.mega__promo-body h4 { font-size: var(--fs-lg); margin: 6px 0 10px; color: #fff; }
.mega__promo-body .link { font-size: var(--fs-sm); color: var(--brass-3); border-bottom: 1px solid currentColor; padding-bottom: 2px; }

@media (max-width: 1140px) { .mega__grid { grid-template-columns: repeat(3, 1fr); } .mega__promo { display: none; } }
@media (max-width: 980px) { .navbar { display: none; } }

/* ============ 4. Mobile drawer nav ============ */
.mnav {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: min(88vw, 380px);
  background: #fff; z-index: var(--z-drawer); box-shadow: var(--sh-5);
  transform: translateX(var(--tx-out, -100%)); transition: transform .38s var(--e-out);
  display: flex; flex-direction: column;
}
[dir="rtl"] .mnav { --tx-out: 100%; }
.mnav.open { transform: none; }
.mnav__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line-2); }
.mnav__body { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-4) var(--sp-8); }
.mnav__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 12px; border-radius: var(--r-md); font-size: var(--fs-md); font-weight: 500;
  transition: var(--t-fast);
}
.mnav__link:hover { background: var(--bone); color: var(--brass); }
.mnav__link svg { width: 16px; height: 16px; color: var(--muted); transition: transform var(--t-fast); }
.mnav__sub { overflow: hidden; max-height: 0; transition: max-height .35s var(--e-out); }
.mnav__group.open .mnav__sub { max-height: 620px; }
.mnav__group.open > .mnav__link svg { transform: rotate(180deg); color: var(--brass); }
.mnav__sub a { display: block; padding: 9px 12px; margin-inline-start: 12px; font-size: var(--fs-sm); color: var(--text-soft); border-inline-start: 1px solid var(--line); }
.mnav__sub a:hover { color: var(--brass); border-color: var(--brass); }
.mnav__foot { padding: var(--sp-5); border-top: 1px solid var(--line-2); display: grid; gap: var(--sp-3); }

/* ============ 5. Footer ============ */
.footer { background: var(--ink); color: #B8AFA1; margin-top: var(--sp-11); position: relative; overflow: hidden; }
.footer::before {
  content: ''; position: absolute; inset-inline: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass), var(--brass-3), var(--brass), transparent);
}
.footer__pattern { position: absolute; inset: 0; opacity: .045; pointer-events: none; }

/* Newsletter strip */
.fnews { border-bottom: 1px solid rgba(255,255,255,.09); position: relative; }
.fnews__inner {
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-7);
  align-items: center; padding-block: var(--sp-8);
}
.fnews h3 { color: #fff; font-size: var(--fs-xl); margin-bottom: 6px; }
.fnews p { font-size: var(--fs-sm); max-width: 52ch; }
.fnews__form { display: flex; gap: 10px; min-width: min(440px, 100%); }
.fnews__form input {
  flex: 1; height: 50px; padding-inline: 18px; border-radius: var(--r-full);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #fff;
  transition: var(--t-fast);
}
.fnews__form input::placeholder { color: #8A8175; }
.fnews__form input:focus { outline: none; border-color: var(--brass); background: rgba(255,255,255,.1); }

/* Footer columns */
.footer__grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: var(--sp-8);
  padding-block: var(--sp-9); position: relative;
}
.footer h4 {
  color: #fff; font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--sp-5);
  position: relative; padding-bottom: 12px;
}
.footer h4::after { content: ''; position: absolute; bottom: 0; inset-inline-start: 0; width: 28px; height: 2px; background: var(--brass); }
.footer a { transition: var(--t-fast); }
.footer__links li { margin-bottom: 11px; }
.footer__links a { font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 8px; }
.footer__links a::before {
  content: ''; width: 0; height: 1px; background: var(--brass); transition: width var(--t-fast);
}
.footer__links a:hover { color: #fff; }
.footer__links a:hover::before { width: 12px; }

.footer__about p { font-size: var(--fs-sm); line-height: 1.85; margin-bottom: var(--sp-5); max-width: 40ch; }
.footer .logo__ar { color: #fff; }
.footer .logo__en { color: var(--brass-2); }

.fcontact li { display: flex; gap: 12px; margin-bottom: var(--sp-4); font-size: var(--fs-sm); align-items: flex-start; }
.fcontact svg { width: 17px; height: 17px; color: var(--brass); flex: none; margin-top: 3px; }
.fcontact b { display: block; color: #fff; font-weight: 500; }
.fcontact span { font-size: var(--fs-xs); color: #8A8175; }

.fsocial { display: flex; gap: 9px; margin-top: var(--sp-5); }
.fsocial a {
  width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09);
  color: #B8AFA1; transition: var(--t-med);
}
.fsocial a:hover { background: var(--brass); border-color: var(--brass); color: #fff; transform: translateY(-3px); }
.fsocial svg { width: 17px; height: 17px; }

.fapps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--sp-5); }
.fapp {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-md); transition: var(--t-fast);
}
.fapp:hover { border-color: var(--brass); background: rgba(255,255,255,.04); }
.fapp svg { width: 22px; height: 22px; color: #fff; }
.fapp span { line-height: 1.2; }
.fapp small { display: block; font-size: 9.5px; color: #8A8175; }
.fapp b { font-size: var(--fs-sm); color: #fff; font-weight: 500; font-family: var(--f-latin); }

/* Footer bottom */
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.09); padding-block: var(--sp-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap;
  font-size: var(--fs-xs); position: relative;
}
.footer__bottom a:hover { color: #fff; }
.fpay { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fpay__chip {
  height: 28px; padding-inline: 10px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-latin); font-size: 10px; font-weight: 600; letter-spacing: .04em; color: #D8D0C3;
}
.fpay__chip svg { width: 15px; height: 15px; color: var(--brass-2); }

@media (max-width: 1040px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-7); } }
@media (max-width: 780px) {
  .fnews__inner { grid-template-columns: 1fr; }
  .fnews__form { min-width: 0; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; text-align: center; }
}

/* ============ 6. Back to top ============ */
.totop {
  position: fixed; bottom: 26px; inset-inline-end: 26px; width: 46px; height: 46px;
  border-radius: var(--r-full); background: var(--ink); color: #fff; display: grid; place-items: center;
  box-shadow: var(--sh-4); z-index: 500; opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: var(--t-med);
}
.totop.on { opacity: 1; visibility: visible; transform: none; }
.totop:hover { background: var(--brass); transform: translateY(-3px); }
.totop svg { width: 19px; height: 19px; }

/* WhatsApp float */
.wa {
  position: fixed; bottom: 84px; inset-inline-end: 26px; width: 46px; height: 46px;
  border-radius: var(--r-full); background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: var(--sh-4); z-index: 500; transition: var(--t-med);
}
.wa:hover { transform: translateY(-3px) scale(1.06); }
.wa svg { width: 24px; height: 24px; }
@media (max-width: 560px) { .totop, .wa { inset-inline-end: 14px; } .totop { bottom: 14px; } .wa { bottom: 70px; } }
