/* =====================================================================
   BirTool.az — Global Shell  ·  css/shell.css
   Header · top utility bar · search · mega-menu · footer · mobile nav
   Depends on css/style.css tokens. Plain CSS, no build step.
   ===================================================================== */

/* keep the sticky header above page content */
:root { --shell-z-bar: 60; --shell-z-mega: 70; --shell-z-drawer: 90; --shell-z-float: 50; }

.shell-page { min-height: 100vh; display: flex; flex-direction: column; }
.shell-main { flex: 1; }

/* ========================= TOP UTILITY BAR ========================= */
.topbar {
  background: var(--navy-900);
  color: var(--text-on-dark-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.topbar__in {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar__group { display: flex; align-items: center; gap: 22px; }
.topbar a { color: var(--text-on-dark-muted); display: inline-flex; align-items: center; gap: 7px; transition: color var(--dur) var(--ease); }
.topbar a:hover { color: #fff; }
.topbar a svg { width: 14px; height: 14px; }
.topbar .accent-link { color: #fff; }
.topbar .accent-link svg { color: var(--whatsapp); }
.topbar__phone { color: #fff; font-weight: var(--fw-bold); }
.topbar .dot-sep { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.25); }

/* language switcher */
.lang { display: inline-flex; background: rgba(255,255,255,.08); border-radius: var(--radius-full); padding: 3px; }
.lang button {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-on-dark-muted); font-weight: var(--fw-bold); font-size: 11px;
  padding: 4px 11px; border-radius: var(--radius-full); letter-spacing: .04em;
  transition: all var(--dur) var(--ease);
}
.lang button.is-active { background: #fff; color: var(--navy-900); }
.lang button:not(.is-active):hover { color: #fff; }

/* ============================== HEADER ============================= */
.shell-sticky { position: sticky; top: 0; z-index: var(--shell-z-bar); }
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur) var(--ease);
}
.is-stuck .header { box-shadow: var(--shadow-md); }
.header__in {
  max-width: 1280px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 28px;
}

/* logo (red square BT) */
.logo { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.logo__mark {
  width: 46px; height: 46px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(229,48,27,.30);
  color: #fff; font-weight: var(--fw-black); font-size: 1.05rem; letter-spacing: -0.04em;
}
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__name { font-size: 1.32rem; font-weight: var(--fw-black); letter-spacing: -0.025em; color: var(--text-strong); }
.logo__name .accent { color: var(--primary); }
.logo__tag { font-size: 10px; font-weight: var(--fw-bold); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }

/* search (central, prominent) */
.search { flex: 1; max-width: 640px; }
.search__form { display: flex; align-items: stretch; position: relative; }
.search__field { position: relative; flex: 1; display: flex; align-items: center; }
.search__field > svg { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--gray-400); pointer-events: none; }
.search__input {
  width: 100%; font: inherit; font-weight: var(--fw-medium);
  color: var(--text-strong); background: var(--gray-50);
  border: 1.5px solid var(--border-strong);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 14px 16px 14px 46px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.search__input::placeholder { color: var(--gray-400); }
.search__form:focus-within .search__input { background: #fff; border-color: var(--primary); }
.search__btn {
  flex: none; border: 1.5px solid var(--primary); background: var(--primary); color: #fff;
  padding: 0 22px; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-weight: var(--fw-bold); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur) var(--ease);
}
.search__btn svg { width: 18px; height: 18px; }
.search__btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.search__btn .label { display: inline; }

/* header actions */
.header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.action {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius-md); cursor: pointer;
  color: var(--gray-600); background: transparent; border: none; min-width: 64px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.action:hover { background: var(--gray-100); color: var(--text-strong); }
.action svg { width: 24px; height: 24px; }
.action__label { font-size: 11px; font-weight: var(--fw-bold); }
.action--cart:hover { color: var(--primary); }
.count-badge {
  position: absolute; top: 2px; right: 8px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: var(--fw-black); line-height: 18px; text-align: center;
  border-radius: var(--radius-full); box-shadow: 0 0 0 2px var(--surface);
}
.count-badge--wish { background: var(--navy-700); }

/* ===================== CATEGORY NAV / MEGA-MENU ==================== */
.catnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.catnav__in { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: stretch; gap: 4px; }

.megabtn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--primary); color: #fff;
  font-weight: var(--fw-bold); font-size: var(--fs-sm);
  padding: 14px 22px; border: none; cursor: pointer;
  margin-right: 12px; border-radius: 0;
  transition: background var(--dur) var(--ease);
}
.megabtn svg.bars { width: 18px; height: 18px; }
.megabtn .chev { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.megabtn:hover { background: var(--primary-hover); }
.megabtn[aria-expanded="true"] { background: var(--primary-active); }
.megabtn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.catnav__links { display: flex; align-items: stretch; gap: 2px; overflow: hidden; }
.catnav__links a {
  display: inline-flex; align-items: center; padding: 14px 14px;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text);
  border-bottom: 3px solid transparent; white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.catnav__links a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ----- mega panel ----- */
.mega-overlay {
  position: fixed; inset: 0; background: rgba(15,19,31,.45);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur);
  z-index: var(--shell-z-mega);
}
.mega-overlay.is-open { opacity: 1; visibility: visible; }

.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  z-index: calc(var(--shell-z-mega) + 1);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden;
  display: none;
}
.catnav { position: relative; }
.mega.is-open { display: block; }
.mega__grid { display: grid; grid-template-columns: 290px 1fr; min-height: 420px; }

.mega__rail { background: var(--gray-50); border-right: 1px solid var(--border); padding: 12px; }
.mega__cat {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: var(--radius-md); cursor: pointer;
  background: transparent; border: none; text-align: left;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mega__cat .ic { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--navy-600); transition: all var(--dur) var(--ease); }
.mega__cat .ic svg { width: 20px; height: 20px; }
.mega__cat .arrow { margin-left: auto; width: 16px; height: 16px; color: var(--gray-300); opacity: 0; transition: opacity var(--dur) var(--ease); }
.mega__cat:hover, .mega__cat.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.mega__cat.is-active .ic, .mega__cat:hover .ic { background: var(--red-50); border-color: var(--red-200); color: var(--primary); }
.mega__cat.is-active .arrow { opacity: 1; color: var(--primary); }
.mega__cat .count { font-size: 11px; color: var(--gray-400); font-weight: var(--fw-semibold); }
.mega__cat.is-active .count, .mega__cat:hover .count { color: var(--red-300); }

.mega__panel { padding: 28px 32px; display: none; }
.mega__panel.is-active { display: block; }
.mega__panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mega__panel-title { font-size: var(--fs-h4); font-weight: var(--fw-black); color: var(--text-strong); letter-spacing: -0.01em; }
.mega__panel-all { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.mega__panel-all svg { width: 16px; height: 16px; }
.mega__subs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 20px; }
.mega__subs a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--gray-600);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mega__subs a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gray-300); flex: none; transition: background var(--dur) var(--ease); }
.mega__subs a:hover { background: var(--gray-50); color: var(--primary); }
.mega__subs a:hover::before { background: var(--primary); }

.mega__promo { margin-top: 24px; display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: radial-gradient(130% 150% at 92% 0%, var(--navy-600), var(--navy-900)); border-radius: var(--radius-md); color: #fff; }
.mega__promo .pi { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); border-radius: var(--radius-md); color: var(--red-300); }
.mega__promo .pi svg { width: 24px; height: 24px; }
.mega__promo b { display: block; font-size: var(--fs-base); }
.mega__promo span { font-size: var(--fs-sm); color: rgba(255,255,255,.7); }
.mega__promo .btn { margin-left: auto; }

/* ============================= FOOTER ============================= */
.footer { background: var(--navy-800); color: var(--text-on-dark-muted); margin-top: auto; }

/* trust strip */
.footer__trust { border-bottom: 1px solid rgba(255,255,255,.08); }
.footer__trust-in { max-width: 1280px; margin: 0 auto; padding: 28px 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.ftrust { display: flex; align-items: center; gap: 14px; }
.ftrust__ic { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: rgba(229,48,27,.14); border: 1px solid rgba(229,48,27,.25); border-radius: var(--radius-md); color: var(--red-400); }
.ftrust__ic svg { width: 24px; height: 24px; }
.ftrust__t { color: #fff; font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.ftrust__s { font-size: var(--fs-xs); color: var(--text-on-dark-muted); }

/* columns */
.footer__cols { max-width: 1280px; margin: 0 auto; padding: 48px 24px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px; }
.fcol__title { color: #fff; font-size: var(--fs-sm); font-weight: var(--fw-black); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 18px; }
.fcol ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.fcol a { color: var(--text-on-dark-muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); transition: color var(--dur) var(--ease); }
.fcol a:hover { color: #fff; }

.footer__brand .logo__name { color: #fff; }
.footer__brand p { font-size: var(--fs-sm); line-height: var(--lh-relaxed); color: var(--text-on-dark-muted); max-width: 320px; margin: 18px 0 22px; }
.footer__social { display: flex; gap: 10px; }
.footer__social a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); transition: all var(--dur) var(--ease); }
.footer__social a:hover { background: var(--primary); color: #fff; }
.footer__social svg { width: 20px; height: 20px; }

.fcontact li { display: flex; align-items: flex-start; gap: 11px; }
.fcontact svg { width: 18px; height: 18px; flex: none; color: var(--red-400); margin-top: 1px; }
.fcontact .v { color: #fff; font-weight: var(--fw-semibold); }
.fcontact .v small { display: block; color: var(--text-on-dark-muted); font-weight: var(--fw-medium); font-size: var(--fs-xs); margin-top: 2px; }
.fcontact .wa-btn { margin-top: 6px; }

/* payment / reassure row */
.footer__pay { border-top: 1px solid rgba(255,255,255,.08); }
.footer__pay-in { max-width: 1280px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__pay .reassure { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: #fff; }
.footer__pay .reassure svg { width: 20px; height: 20px; color: var(--whatsapp); }
.paychips { display: flex; gap: 8px; flex-wrap: wrap; }
.paychip { padding: 7px 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-sm); font-size: 11px; font-weight: var(--fw-bold); color: #fff; letter-spacing: .03em; }

.footer__bottom { background: var(--navy-900); }
.footer__bottom-in { max-width: 1280px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: var(--fs-xs); }
.footer__bottom a { color: var(--text-on-dark-muted); }
.footer__bottom a:hover { color: #fff; }
.footer__bottom-links { display: flex; gap: 22px; }

/* ===================== MOBILE: drawer + bottom nav ================ */
.hamburger, .mobile-search-toggle { display: none; }

/* category drawer (mobile mega-menu) */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,19,31,.5); opacity: 0; visibility: hidden; transition: opacity var(--dur), visibility var(--dur); z-index: var(--shell-z-drawer); }
.drawer-overlay.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 360px);
  background: var(--surface); z-index: calc(var(--shell-z-drawer) + 1);
  transform: translateX(-100%); transition: transform .26s var(--ease);
  display: flex; flex-direction: column; box-shadow: var(--shadow-xl);
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer__close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; color: var(--gray-600); }
.drawer__close svg { width: 20px; height: 20px; }
.drawer__lang { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer__lang .lang { background: var(--gray-100); }
.drawer__lang .lang button { color: var(--gray-500); }
.drawer__lang .lang button.is-active { background: var(--primary); color: #fff; }
.drawer__body { flex: 1; overflow-y: auto; padding: 10px 12px; }
.dcat { border-bottom: 1px solid var(--border); }
.dcat__btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 8px; background: none; border: none; cursor: pointer; font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--text-strong); text-align: left; }
.dcat__btn .ic { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--red-50); border-radius: var(--radius-sm); color: var(--primary); }
.dcat__btn .ic svg { width: 19px; height: 19px; }
.dcat__btn .chev { margin-left: auto; width: 18px; height: 18px; color: var(--gray-400); transition: transform var(--dur) var(--ease); }
.dcat.is-open .dcat__btn .chev { transform: rotate(180deg); }
.dcat__subs { display: none; flex-direction: column; padding: 0 8px 12px 54px; gap: 2px; }
.dcat.is-open .dcat__subs { display: flex; }
.dcat__subs a { padding: 9px 8px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--gray-600); border-radius: var(--radius-sm); }
.dcat__subs a:hover { background: var(--gray-50); color: var(--primary); }
.drawer__foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

/* bottom nav */
.bottomnav { display: none; }
.botnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--shell-z-bar);
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15,19,31,.08);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(4, 1fr);
}
.botnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--gray-500); position: relative;
  font-size: 10.5px; font-weight: var(--fw-bold);
}
.botnav a svg { width: 24px; height: 24px; }
.botnav a.is-active { color: var(--primary); }
.botnav a.botnav--wa { color: var(--whatsapp); }
.botnav .count-badge { top: -2px; right: calc(50% - 22px); }

/* floating WhatsApp */
.fab-wa {
  position: fixed; right: 16px; z-index: var(--shell-z-float);
  bottom: 84px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--whatsapp); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(33,193,91,.45);
  border: none; cursor: pointer;
  animation: fab-pulse 2.6s ease-out infinite;
}
.fab-wa svg { width: 28px; height: 28px; }
@keyframes fab-pulse { 0% { box-shadow: 0 8px 24px rgba(33,193,91,.45), 0 0 0 0 rgba(33,193,91,.4);} 70%{ box-shadow: 0 8px 24px rgba(33,193,91,.45), 0 0 0 14px rgba(33,193,91,0);} 100%{ box-shadow: 0 8px 24px rgba(33,193,91,.45), 0 0 0 0 rgba(33,193,91,0);} }

/* ============================ RESPONSIVE ========================== */
@media (max-width: 1080px){
  .catnav__links a { padding: 14px 10px; }
  .search { max-width: 460px; }
}

@media (max-width: 860px){
  /* hide desktop-only chrome */
  .topbar { display: none; }
  .catnav { display: none; }
  .search__btn .label { display: none; }
  .search__btn { padding: 0 16px; }

  .header__in { gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
  .logo__mark { width: 40px; height: 40px; }
  .logo__name { font-size: 1.15rem; }
  .logo__tag { display: none; }

  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: none; order: -1;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    color: var(--text-strong); cursor: pointer;
  }
  .hamburger svg { width: 22px; height: 22px; }

  /* search drops to full-width second row */
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search__input { padding-top: 12px; padding-bottom: 12px; }

  /* keep only cart in header top row; wishlist moves to bottom nav */
  .header__actions { gap: 2px; }
  .action__label { display: none; }
  .action { min-width: 44px; padding: 8px; }
  .action--wishlist, .action--products { display: none; }

  /* footer collapses */
  .footer__trust-in { grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 24px 16px; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding: 32px 16px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__pay-in { flex-direction: column; align-items: flex-start; }
  .footer__bottom-in { flex-direction: column; align-items: center; text-align: center; }

  /* show mobile nav */
  .botnav { display: grid; }
  .fab-wa { display: flex; }
  .shell-main { padding-bottom: 76px; } /* clear bottom nav */
}

@media (max-width: 460px){
  .footer__cols { grid-template-columns: 1fr; }
  .mega__subs { grid-template-columns: 1fr; }
}

/* desktop: never show mobile-only bits */
@media (min-width: 861px){
  .drawer, .drawer-overlay, .botnav, .fab-wa { display: none !important; }
}
