/* Shared header: isolated from page-specific themes and utility frameworks.
   Тайминги и кривые Безье сняты с globalheader.css на apple.com:
   --sh-d: .24s, плавность cubic-bezier(.4,0,.6,1), каскад пунктов 20мс,
   задержка наведения (hover-intent) 80мс. */
 :root { --sh-d: .24s; --sh-ease: cubic-bezier(.4,0,.6,1); --sh-sheet-ease: cubic-bezier(.4,0,.6,1); --sh-rate: 420ms; --sh-stagger: 20ms; --sh-intent: 80ms; --sh-close: 420ms; }
body #siteHeader { position: sticky; top: 0; z-index: 1000; width: 100%; background: #fff !important; color: #243e4a; border: 0; border-bottom: 1px solid #e2e9ec !important; box-shadow: 0 4px 24px #142b3b06 !important; font: 500 14px/1.45 "FB Inter", Inter, system-ui, sans-serif; letter-spacing: normal; }
#siteHeader *, #siteHeader *::before, #siteHeader *::after { box-sizing: border-box; }
body #siteHeader #headerInner { max-width: 1280px; margin: 0 auto; padding: 14px 24px !important; display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 76px; }
#siteHeader a { text-decoration: none; color: inherit; }
#siteHeader button { font: inherit; cursor: pointer; margin: 0; }
#siteHeader .sh-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; color: currentColor; }
#siteHeader .sh-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#siteHeader .sh-brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #126f68; color: #fff; font-size: 25px; font-weight: 750; }
#siteHeader .sh-brand-name { font-size: 23px; font-weight: 750; letter-spacing: -.7px; color: #18333f; }
#siteHeader .sh-nav, #siteHeader .sh-actions { display: flex; align-items: center; gap: 8px; }
#siteHeader .dropdown { position: static; display: flex; align-items: center; border-radius: 10px; }
body #siteHeader .sh-nav-link, body #siteHeader .dropdown-toggle, #siteHeader .sh-account { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: #f3f6f7 !important; color: #334b59 !important; white-space: nowrap; font-size: 14px; font-weight: 550; }
body #siteHeader .dropdown > .sh-nav-link { border-radius: 10px 0 0 10px; padding-right: 7px; }
body #siteHeader .dropdown-toggle { border-radius: 0 10px 10px 0; padding: 10px 6px; }
#siteHeader .dropdown:hover > .sh-nav-link,
#siteHeader .dropdown:hover > .dropdown-toggle,
#siteHeader .dropdown:focus-within > .sh-nav-link,
#siteHeader .dropdown:focus-within > .dropdown-toggle { background: #e8f4f1 !important; color: #076a62 !important; }
#siteHeader .dropdown-toggle .sh-icon { width: 16px; height: 16px; flex-basis: 16px; }
#siteHeader .sh-nav-link > .sh-icon, #siteHeader .sh-tile, #siteHeader .mobile-dropdown-toggle .sh-icon:first-child { color: #087f75; }
body #siteHeader .sh-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px !important; height: 44px !important; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid #dae5e7 !important; border-radius: 12px !important; background: #fff !important; color: #334b59 !important; box-shadow: none !important; transform: none; flex-shrink: 0; }
body #siteHeader .sh-order { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid #087f75; border-radius: 12px; background: #087f75; color: #fff; font-weight: 650; white-space: nowrap; }
body #siteHeader :is(.sh-tool,.sh-nav-link,.dropdown-toggle,.sh-account,.sh-item,.mobile-dropdown-toggle):hover { background: #e8f4f1 !important; color: #076a62 !important; }
#siteHeader .sh-order:hover { background: #06665f; }
#siteHeader :is(a,button):focus-visible { outline: 3px solid #239c91 !important; outline-offset: 3px; }
.sh-veil { position: fixed; inset: 0; z-index: 990; background: rgba(0,0,0,.48); opacity: 0; visibility: hidden; pointer-events: none; }
 #siteHeader.sh-curtain-open + .sh-veil { opacity: 1; visibility: visible; transition: opacity .32s var(--sh-ease) 80ms, visibility 0s linear 80ms; }
 #siteHeader.sh-curtain-close + .sh-veil { opacity: 0; visibility: hidden; transition: opacity .32s var(--sh-ease) 80ms, visibility 0s linear .4s; }
#siteHeader .sh-curtain { position: absolute; left: 0; right: 0; top: 100%; z-index: 2; height: 0; overflow: hidden; background: transparent; border: 0; box-shadow: none; pointer-events: none; }
#siteHeader .sh-curtain.sh-run { pointer-events: auto; height: var(--sh-h, 0px); }
#siteHeader .sh-sheet { position: absolute; left: 0; right: 0; top: 0; height: var(--sh-h, 0px); background: #fafafc; border-bottom: 1px solid #d2d2d7; box-shadow: 0 18px 40px #00000014; transform: translate3d(0, -101%, 0); transition: transform var(--sh-close) var(--sh-sheet-ease); backface-visibility: hidden; }
#siteHeader.sh-curtain-open .sh-sheet { transform: translate3d(0, 0, 0); transition: transform var(--sh-rate) var(--sh-sheet-ease); }
#siteHeader .dropdown-menu { display: none; position: relative; margin: 0; background: transparent; border: 0; box-shadow: none; opacity: 1 !important; visibility: visible !important; transform: none !important; pointer-events: auto !important; }
#siteHeader .dropdown-menu.sh-on { display: block; }
#siteHeader .dropdown-panel { max-width: 1024px; margin: 0 auto; padding: 28px 24px 34px; border: 0; background: transparent; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2px 28px; }
#siteHeader .dropdown-panel > :nth-child(1) { --sh-i: 0; }
#siteHeader .dropdown-panel > :nth-child(2) { --sh-i: 1; }
#siteHeader .dropdown-panel > :nth-child(3) { --sh-i: 2; }
#siteHeader .dropdown-panel > :nth-child(4) { --sh-i: 3; }
#siteHeader .dropdown-panel > :nth-child(5) { --sh-i: 4; }
#siteHeader .dropdown-panel > :nth-child(6) { --sh-i: 5; }
#siteHeader .dropdown-panel > :nth-child(7) { --sh-i: 6; }
#siteHeader .dropdown-panel > :nth-child(8) { --sh-i: 7; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(1) { --sh-t: 0; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(1) { --sh-t: 1; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(3), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(3):nth-last-child(1) { --sh-t: 2; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(4), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(3), #siteHeader .dropdown-panel > :nth-child(3):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(4):nth-last-child(1) { --sh-t: 3; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(5), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(4), #siteHeader .dropdown-panel > :nth-child(3):nth-last-child(3), #siteHeader .dropdown-panel > :nth-child(4):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(5):nth-last-child(1) { --sh-t: 4; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(6), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(5), #siteHeader .dropdown-panel > :nth-child(3):nth-last-child(4), #siteHeader .dropdown-panel > :nth-child(4):nth-last-child(3), #siteHeader .dropdown-panel > :nth-child(5):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(6):nth-last-child(1) { --sh-t: 5; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(7), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(6), #siteHeader .dropdown-panel > :nth-child(3):nth-last-child(5), #siteHeader .dropdown-panel > :nth-child(4):nth-last-child(4), #siteHeader .dropdown-panel > :nth-child(5):nth-last-child(3), #siteHeader .dropdown-panel > :nth-child(6):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(7):nth-last-child(1) { --sh-t: 6; }
#siteHeader .dropdown-panel > :nth-child(1):nth-last-child(8), #siteHeader .dropdown-panel > :nth-child(2):nth-last-child(7), #siteHeader .dropdown-panel > :nth-child(3):nth-last-child(6), #siteHeader .dropdown-panel > :nth-child(4):nth-last-child(5), #siteHeader .dropdown-panel > :nth-child(5):nth-last-child(4), #siteHeader .dropdown-panel > :nth-child(6):nth-last-child(3), #siteHeader .dropdown-panel > :nth-child(7):nth-last-child(2), #siteHeader .dropdown-panel > :nth-child(8):nth-last-child(1) { --sh-t: 7; }
 #siteHeader.sh-curtain-open .dropdown-panel > * { animation: sh-item .16s var(--sh-ease) both !important; animation-delay: calc(40ms + var(--sh-i, 0) * 12ms) !important; }
@keyframes sh-item { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes sh-veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sh-veil-out { from { opacity: 1; } to { opacity: 0; } }
#siteHeader .dropdown-arrow { transition: transform var(--sh-d) var(--sh-ease); transition-delay: var(--sh-intent); }
#siteHeader .dropdown:hover .dropdown-arrow,
#siteHeader .dropdown:focus-within .dropdown-arrow,
#siteHeader .dropdown.active .dropdown-arrow { transform: rotate(180deg); }
#siteHeader .sh-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px; border-radius: 10px; font-size: 14px; transition: background-color .18s cubic-bezier(.32,.72,0,1), transform .18s cubic-bezier(.32,.72,0,1); }
#siteHeader .sh-item:hover { transform: translateX(2px); }
#siteHeader .sh-tile { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: #edf5f3; }
#siteHeader .sh-tile img { display: block; width: 32px; height: 32px; border-radius: 8px; }
#siteHeader .sh-item-title { display: block; font-weight: 600; }
#siteHeader .sh-sub { display: block; color: #627681; font-size: 12px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
#siteHeader .sh-mobile-tools, #siteHeader #mobileMenu { display: none; }
/* Плавное переключение иконок бургер ↔ крестик */
#siteHeader #mobileMenuBtn .sh-menu-lines, #siteHeader #mobileMenuBtn .sh-close-lines { transition: opacity .3s ease; }
#siteHeader #mobileMenuBtn .sh-close-lines { opacity: 0; }
#siteHeader #mobileMenuBtn[aria-expanded="true"] .sh-menu-lines { opacity: 0; }
#siteHeader #mobileMenuBtn[aria-expanded="true"] .sh-close-lines { opacity: 1; }
#siteHeader .cart-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 20px; background: #087f75; color: #fff; font-size: 10px; line-height: 18px; text-align: center; }
#siteHeader .cart-badge:empty { display: none; }
@media(max-width: 1199px) {
  body #siteHeader #headerInner { height: 68px; padding: 12px 20px !important; }
  #siteHeader .sh-nav, #siteHeader .sh-actions, #siteHeader .sh-desktop-search { display: none; }
  #siteHeader .sh-mobile-tools { display: flex; align-items: center; gap: 8px; }
  /* Свёрнутое состояние: меню зафиксировано под шапкой и сдвинуто вверх на свою
     высоту. Анимация на transform/opacity (compositor-only), а не на max-height —
     поэтому выезд и сворачивание плавные, как у apple.com. */
  #siteHeader #mobileMenu { display: block; position: fixed; top: 68px; left: 0; right: 0; max-height: calc(100dvh - 68px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border-top: 1px solid #e2e9ec; opacity: 0; visibility: hidden; transform: translateY(-102%); transition: transform var(--sh-d) var(--sh-ease), opacity var(--sh-d) var(--sh-ease), visibility 0s linear var(--sh-d); }
  /* Раскрытие: короткая пауза (0.18s) под морфинг иконки, затем плавный выезд */
  #siteHeader #mobileMenu.open:not(.hidden) { opacity: 1; visibility: visible; transform: translateY(0); transition: transform .32s var(--sh-ease) .18s, opacity var(--sh-d) var(--sh-ease) .18s, visibility 0s linear .18s; }
  #siteHeader #mobileMenu > nav { max-width: 640px; margin: auto; padding: 16px; display: grid; gap: 8px; }
  #siteHeader .mobile-dropdown-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px; min-height: 48px; border: 0; border-radius: 10px; background: #f3f6f7; color: #334b59; text-align: left; }
  #siteHeader .mobile-dropdown-toggle > span { display: flex; align-items: center; gap: 12px; }
  #siteHeader .mobile-dropdown-menu { padding: 6px 0 6px 16px; }
  #siteHeader .mobile-dropdown-menu.hidden { display: none; }
  #siteHeader .mobile-dropdown-menu:not(.hidden) { display: block; }
}
@media(max-width: 480px) {
  body #siteHeader #headerInner { padding: 12px !important; gap: 8px; }
  #siteHeader .sh-brand { gap: 7px; }
  #siteHeader .sh-brand-name { font-size: 19px; }
  #siteHeader .sh-mobile-tools { gap: 4px; }
}
@media(max-width: 374px) { #siteHeader .sh-brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
body #sellers .jq-btn-coral,
body #maps .home-map-buy,
body .home-map-buy {
  background: #e50914 !important;
  background-image: none !important;
  border-color: #b20710 !important;
  color: #fff !important;
}
body #sellers .jq-btn-coral:hover,
body #maps .home-map-buy:hover,
body .home-map-buy:hover {
  background: #b20710 !important;
  background-image: none !important;
  border-color: #991b1b !important;
}
@media (prefers-reduced-motion: reduce) {
  #siteHeader #mobileMenu { transition: none !important; transform: none !important; }
  #siteHeader #mobileMenuBtn .sh-menu-lines, #siteHeader #mobileMenuBtn .sh-close-lines { transition: none; }
  #siteHeader .sh-curtain { animation: none !important; }
}
