/* Header, mega menu, mobile menu, bottom nav, footer, floating WhatsApp
   WORDPRESS: header.php / footer.php */

/* Top bar */
.topbar { background: var(--color-dark); color: var(--color-on-dark-muted); font-size: 12.5px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 38px; }
.topbar__info { display: flex; gap: var(--space-6); align-items: center; }
.topbar__info span { display: inline-flex; align-items: center; gap: 7px; }
.topbar__info svg { color: #DCC9FB; }
.topbar__links { display: flex; gap: var(--space-5); }
.topbar a { color: #fff; font-weight: 500; }
.topbar a:hover { color: #DCC9FB; }
.topbar__promo { color: #FFC49A !important; }

/* Sticky header */
.header { position: sticky; top: 0; z-index: var(--z-header); background: #fff; transition: box-shadow var(--dur) var(--ease); }
.header.is-stuck { box-shadow: 0 6px 24px rgba(22, 24, 43, 0.08); }
.header__main { border-bottom: 1px solid var(--color-border); }
.header__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-6); min-height: var(--header-h); }
.header__menu-btn { display: none; }
.logo { display: block; flex: none; }
.logo img { height: 68px; width: auto; max-width: 250px; object-fit: contain; }

/* Search */
.search { position: relative; max-width: 760px; width: 100%; grid-column: 2; }
.search__form { display: flex; align-items: center; height: 50px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: #fff; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.search__form:focus-within { border-color: var(--color-primary); box-shadow: var(--ring); }
.search__cat { position: relative; flex: none; height: 100%; border-right: 1px solid var(--color-border); }
.search__cat select { height: 100%; border: 0; background-color: var(--color-surface); border-radius: var(--radius-md) 0 0 var(--radius-md); padding: 0 34px 0 14px; font-size: var(--fs-sm); font-weight: 500; max-width: 170px; min-height: 0; }
.search__cat select:focus { box-shadow: none; }
.search__input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0 14px; background: transparent; font-size: var(--fs-base); }
.search__input:focus { outline: none; }
.search__submit { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 40px; margin-right: 4px; border-radius: 9px; background: var(--color-primary); color: #fff; transition: background var(--dur-fast); }
.search__submit:hover { background: var(--color-primary-hover); }
.search__results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: var(--z-dropdown); background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px; max-height: min(70vh, 520px); overflow: auto; }
.search__item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); color: var(--color-text); }
.search__item:hover, .search__item.is-active { background: var(--color-surface); color: var(--color-text); }
.search__item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--color-surface); }
.search__item-title { font-weight: 500; font-size: var(--fs-sm); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search__item-cat { font-size: var(--fs-xs); color: var(--color-muted); }
.search__item-price { font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.search__all { display: block; padding: 10px 8px 6px; margin-top: 4px; border-top: 1px solid var(--color-border); font-weight: 600; font-size: var(--fs-sm); }
.search__empty { padding: 14px 10px; color: var(--color-muted); font-size: var(--fs-sm); }
.search mark { background: none; color: var(--color-primary); font-weight: 600; }

/* Support + actions */
.header__support { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--color-muted); line-height: 1.3; }
.header__support svg { color: var(--color-primary); }
.header__support strong { display: block; font-size: var(--fs-sm); color: var(--color-text); font-weight: 600; }
.header__actions { display: flex; align-items: center; gap: 20px; grid-column: 3; }
.haction { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 60px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--color-text); font-size: 11.5px; font-weight: 500; }
.haction:hover { color: var(--color-primary); background: var(--color-surface); }
.haction__count { position: absolute; top: 1px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--color-primary); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.haction__count:empty, .haction__count[data-count="0"] { display: none; }
.haction--cart .haction__count { background: var(--color-accent); }
.hbump { animation: gg-bump 400ms var(--ease); }
@keyframes gg-bump { 30% { transform: scale(1.25); } }

/* Nav bar */
.nav { border-bottom: 1px solid var(--color-border); background: #fff; }
.nav__row { display: flex; align-items: stretch; gap: var(--space-6); min-height: 50px; }
.nav__links { display: flex; align-items: stretch; gap: var(--space-5); flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__link { position: relative; display: flex; align-items: center; white-space: nowrap; color: var(--color-text); font-weight: 500; font-size: 14px; }
.nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--color-primary); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.nav__link:hover { color: var(--color-primary); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { font-weight: 600; }
.nav__link--deal { color: var(--color-accent-text); font-weight: 600; }
.nav__link--deal::after { background: var(--color-accent); }
.nav__link--deal:hover { color: var(--color-accent-text); }
.nav__aside { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--color-muted); white-space: nowrap; }

/* All categories + mega */
.cats { position: relative; flex: none; display: flex; }
.cats__btn { display: flex; align-items: center; gap: 10px; padding: 0 22px; min-width: 230px; height: 52px; background: var(--color-primary); color: #fff; font-family: var(--font-heading); font-weight: 600; font-size: 15px; }
.cats__btn .chev { margin-left: auto; transition: transform var(--dur) var(--ease); }
.cats__btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.cats__panel { position: absolute; top: 100%; left: 0; z-index: var(--z-dropdown); width: 270px; background: #fff; border: 1px solid var(--color-border); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px 0; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur); }
.cats.is-open .cats__panel { opacity: 1; visibility: visible; transform: none; }
.cats__item { list-style: none; }
.cats__link { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: var(--color-text); font-size: 14px; }
.cats__link .chev-r { margin-left: auto; color: var(--color-subtle); }
.cats__item:hover > .cats__link, .cats__item:focus-within > .cats__link { background: var(--color-surface); color: var(--color-primary); }
.cats__count { margin-left: auto; font-size: var(--fs-xs); color: var(--color-subtle); }
.mega { position: absolute; left: 100%; top: -1px; min-height: calc(100% + 1px); width: min(760px, calc(100vw - 340px)); background: #fff; border: 1px solid var(--color-border); border-radius: 0 var(--radius-md) var(--radius-md) 0; box-shadow: var(--shadow-lg); padding: var(--space-6); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-6); opacity: 0; visibility: hidden; transform: translateX(-6px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur); }
.cats__item:hover > .mega, .cats__item:focus-within > .mega { opacity: 1; visibility: visible; transform: none; }
.mega__col h4 { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.mega__col ul { list-style: none; display: grid; gap: 7px; }
.mega__col a { color: var(--color-muted); font-size: 14px; }
.mega__col a:hover { color: var(--color-primary); }
.mega__banner { grid-column: 1 / -1; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; border-radius: var(--radius-md); background: var(--color-primary-wash); color: var(--color-text); }
.mega__banner img { width: 160px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
.mega__banner strong { display: block; font-family: var(--font-heading); font-size: var(--fs-md); margin-bottom: 4px; }

/* Mobile drawer menu */
.overlay { position: fixed; inset: 0; z-index: var(--z-overlay); visibility: hidden; }
.overlay.is-open { visibility: visible; }
.overlay__backdrop { position: absolute; inset: 0; background: rgba(9, 11, 34, 0.48); opacity: 0; transition: opacity var(--dur) var(--ease); }
.overlay.is-open .overlay__backdrop { opacity: 1; }
.drawer { position: absolute; top: 0; bottom: 0; width: min(400px, 92vw); background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-overlay); transition: transform 300ms var(--ease); }
.drawer--left { left: 0; transform: translateX(-100%); }
.drawer--right { right: 0; transform: translateX(100%); }
.overlay.is-open .drawer { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.drawer__head h2 { font-size: var(--fs-lg); letter-spacing: -0.01em; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer__foot { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-border); display: grid; gap: 10px; }
.mmenu__quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.mmenu__quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text); font-size: var(--fs-xs); font-weight: 500; }
.mmenu__title { padding: 16px 18px 6px; }
.mmenu__list { list-style: none; }
.mmenu__row { display: flex; align-items: center; border-bottom: 1px solid var(--color-border); }
.mmenu__row > a { flex: 1; padding: 13px 18px; color: var(--color-text); font-weight: 500; min-height: 48px; }
.mmenu__row > button { width: 52px; align-self: stretch; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--color-border); color: var(--color-muted); }
.mmenu__row > button svg { transition: transform var(--dur) var(--ease); }
.mmenu__row > button[aria-expanded="true"] svg { transform: rotate(180deg); }
.mmenu__sub { background: var(--color-surface); padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.mmenu__sub h4 { padding: 10px 30px 4px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.mmenu__sub a { display: block; padding: 9px 30px; color: var(--color-text); font-size: 14px; }

/* Bottom nav (mobile) */
.bottom-nav { display: none; }

/* Footer */
.footer { background: var(--color-dark); color: var(--color-on-dark-muted); margin-top: var(--space-section); font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) 1.4fr; gap: var(--space-8); padding-block: 56px 36px; }
.footer__logo { display: block; margin-bottom: 16px; }
.footer__logo img { height: 42px; width: auto; }
.footer h3 { color: #fff; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin-bottom: 14px; }
.footer ul { list-style: none; display: grid; gap: 9px; }
.footer a { color: var(--color-on-dark-muted); }
.footer a:hover { color: #fff; }
.footer__about p { max-width: 34ch; margin-bottom: 14px; }
.footer__contact { display: grid; gap: 8px; }
.footer__contact span { display: flex; gap: 8px; align-items: flex-start; }
.footer__contact svg { flex: none; margin-top: 3px; color: #DCC9FB; }
.footer__news { display: flex; gap: 8px; margin: 4px 0 16px; }
.footer__news .input { background: var(--color-dark-deep); border-color: var(--color-dark-line); color: #fff; min-height: 44px; }
.footer__news .input::placeholder { color: #8A94A6; }
.footer__social { display: flex; gap: 8px; }
.footer__social a { width: 38px; height: 38px; border: 1px solid var(--color-dark-line); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.footer__social a:hover { border-color: var(--color-primary); color: #fff; }
.footer__bottom { border-top: 1px solid var(--color-dark-line); padding-block: 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: #8A94A6; }
.footer__pay { display: flex; flex-wrap: wrap; gap: 6px; }
.footer__pay span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; background: var(--color-dark-deep); border: 1px solid var(--color-dark-line); color: #D0D5DD; font-size: 11.5px; font-weight: 600; }
.footer__legal { display: flex; gap: 18px; }

/* Floating WhatsApp — single button */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-bottom-nav); width: 54px; height: 54px; border-radius: 50%; background: #1FA855; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(31, 168, 85, 0.35); transition: transform var(--dur) var(--ease); }
.wa-float:hover { transform: translateY(-2px); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .header__support { display: none; }
  .header__row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__about { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  :root { --header-h: 68px; }
  .topbar__info span:nth-child(n+2) { display: none; }
  .nav { display: none; }
  .header__menu-btn { display: inline-flex; border: 0; }
  .header__row { grid-template-columns: 1fr auto 1fr; grid-template-areas: "menu logo actions" "search search search"; column-gap: var(--space-3); row-gap: 10px; padding-block: 10px 12px; }
  .header__menu-btn { grid-area: menu; justify-self: start; }
  .logo { grid-area: logo; justify-self: center; }
  .header__actions { grid-area: actions; justify-self: end; }
  .header__row .search { grid-area: search; padding-bottom: 0; max-width: none; }
  .logo img { height: auto; width: 128px; max-height: none; object-fit: contain; }
  .hide-md { display: none !important; }
  .haction { min-width: 44px; padding: 6px; }
  .haction__label { display: none; }
  .haction__count { right: 0; }
  .search__form { height: 56px; border-radius: 15px; }
  .search__input { padding-inline: 18px; }
  .search__submit { width: 48px; height: 44px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bottom-nav); height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--color-border); box-shadow: 0 -4px 20px rgba(22, 24, 43, 0.06); }
  .bottom-nav a, .bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--color-muted); font-size: 11px; font-weight: 500; }
  .bottom-nav .is-active { color: var(--color-primary); }
  .bottom-nav .haction__count { top: 6px; right: calc(50% - 20px); }
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .wa-float { right: 12px; bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); width: 44px; height: 44px; opacity: 0.94; }
  .wa-float svg { width: 22px; height: 22px; }
  .footer__bottom { padding-bottom: 18px; }
}
@media (max-width: 767px) {
  .topbar__links a:not(.topbar__promo) { display: none; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); padding-top: 40px; padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom)); }
  .footer__about { grid-column: 1 / -1; text-align: center; display: flex; flex-direction: column; align-items: center; }
  .footer__logo { margin-inline: auto; }
  .footer__logo img { height: 36px; max-width: 150px; }
  .footer__about p { max-width: 40ch; margin-inline: auto; }
  .footer__contact { justify-items: center; text-align: left; max-width: 280px; margin-inline: auto; }
  .footer__news-col { grid-column: 1 / -1; }
  .search__cat { display: none; }
}
@media (max-width: 480px) {
  .topbar__info { font-size: 12px; }
  .logo img { width: 112px; max-height: none; }
  .hide-sm { display: none !important; }
}
