/* =====================================================
   ЕвроМедИмпорт — styles.css
   ===================================================== */

/* ── Variables ── */
:root {
  --clr-primary:       #1565C0;
  --clr-primary-dark:  #0D47A1;
  --clr-primary-light: #EEF4FF;
  --clr-accent:        #1E88E5;
  --clr-text:          #1A1A2E;
  --clr-text-2:        #5f6368;
  --clr-text-muted:    #9aa0a6;
  --clr-white:         #ffffff;
  --clr-bg:            #f7f9ff;
  --clr-border:        #dde4ef;
  --clr-green:         #2E7D32;
  --clr-orange:        #E65100;
  --clr-red:           #C62828;
  --clr-footer:        #1A2540;
  --shadow-sm:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:         0 4px 14px rgba(0,0,0,.10);
  --shadow-lg:         0 8px 28px rgba(21,101,192,.18);
  --radius-sm:         6px;
  --radius-md:         10px;
  --radius-lg:         16px;
  --max-w:             1400px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--clr-text);
  background: var(--clr-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img  { max-width: 100%; display: block; }
a    { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
ul, ol { list-style: none; }
input  { font-family: inherit; border: none; outline: none; background: transparent; }
svg    { display: block; flex-shrink: 0; }

/* ── Scrollbar (site-wide, thin + themed) ──
   Firefox uses scrollbar-width/scrollbar-color; every Chromium browser (Chrome,
   Edge, Opera) and Safari use the ::-webkit-scrollbar* pseudo-elements instead —
   both are declared so every major engine gets the same slim, low-contrast bar. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--clr-border) transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-muted); }
::-webkit-scrollbar-corner { background: transparent; }

/* ── PJAX progress bar (assets/js/pjax.js) ──
   Thin trickle bar shown at the very top of the viewport while an AJAX
   navigation is in flight — width/opacity are driven entirely from JS. */
#pjaxProgress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-primary));
  opacity: 0;
  z-index: 10000;
  pointer-events: none;
}

/* ── Container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Section utilities ── */
.section        { padding: 52px 0; }
.section--gray  { background: var(--clr-bg); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title { font-size: 20px; font-weight: 700; color: var(--clr-text); }
.section-title--center { text-align: center; margin-bottom: 32px; }

.section-more {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--clr-primary);
  white-space: nowrap;
  transition: opacity .18s;
}
.section-more:hover { opacity: .75; }
.section-more svg { width: 15px; height: 15px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
  border: 1.5px solid transparent;
}
.btn--primary  { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }
.btn--primary:hover { background: var(--clr-primary-dark); border-color: var(--clr-primary-dark); }
.btn--outline  { background: transparent; color: var(--clr-primary); border-color: var(--clr-primary); }
.btn--outline:hover { background: var(--clr-primary-light); }
.btn--lg { padding: 12px 28px; font-size: 15px; }
.btn--whatsapp  { background: #25D366; color: #fff; border-color: #25D366; }
.btn--whatsapp:hover { background: #1fb855; border-color: #1fb855; }
.btn--telegram  { background: #229ED9; color: #fff; border-color: #229ED9; }
.btn--telegram:hover { background: #1a8bc2; border-color: #1a8bc2; }
.btn--max       { background: #7C3AED; color: #fff; border-color: #7C3AED; }
.btn--max:hover { background: #6a2fd0; border-color: #6a2fd0; }
.btn--vk        { background: #0077FF; color: #fff; border-color: #0077FF; }
.btn--vk:hover  { background: #0062d1; border-color: #0062d1; }
.btn--whatsapp svg, .btn--telegram svg, .btn--max svg, .btn--vk svg { width: 17px; height: 17px; flex-shrink: 0; border-radius: 4px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}
.badge--green  { background: var(--clr-green);  color: #fff; }
.badge--orange { background: var(--clr-orange); color: #fff; }
.badge--red    { background: var(--clr-red);    color: #fff; }

/* ── Logo ── */
.logo { display: flex; align-items: center; flex-shrink: 1; min-width: 0; cursor: pointer; }
.logo__img { height: 28px; width: auto; max-width: 100%; display: block; }

/* ── Carousel arrow (shared) ── */
.carousel-arrow {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--clr-text-2);
  transition: background .2s, border-color .2s, color .2s;
}
.carousel-arrow:hover { background: var(--clr-primary); border-color: var(--clr-primary); color: #fff; }
.carousel-arrow svg { width: 16px; height: 16px; }
.carousel-arrow:disabled { opacity: .35; pointer-events: none; }

/* =====================================================
   TOP HEADER
   ===================================================== */
.top-header { background: var(--clr-white); border-bottom: 1px solid var(--clr-border); padding: 10px 0; }
.top-header__inner { display: flex; align-items: center; gap: 18px; }
.top-header__tagline {
  font-size: 12px; color: var(--clr-text-2); line-height: 1.45;
  border-left: 1px solid var(--clr-border); padding-left: 18px; flex: 1; min-width: 0;
}
.top-header__contacts { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.contact-item { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1; transition: opacity .18s; }
.contact-item:hover { opacity: .75; }
.contact-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.contact-item--phone { font-size: 14px; font-weight: 600; color: var(--clr-text); }
.contact-item--phone svg { color: #25A244; }
.contact-item--email { color: var(--clr-accent); }
.contact-item--email svg { color: var(--clr-accent); }
.top-header__hours { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--clr-text-2); flex-shrink: 0; border-left: 1px solid var(--clr-border); padding-left: 16px; }

/* =====================================================
   MAIN NAV
   ===================================================== */
.main-nav {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  padding: 10px 0;
  position: relative;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}
.main-nav.is-stuck {
  position: fixed;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
#navSpacer { height: 0; }
.main-nav__inner { display: flex; align-items: center; gap: 12px; }
.logo--nav { display: none; }

.catalog-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--clr-primary); color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  transition: background .2s;
  position: relative;
}
.catalog-btn:hover, .catalog-btn.is-active { background: var(--clr-primary-dark); }
.catalog-btn svg { width: 16px; height: 16px; }

/* ── Search wrap ── */
.search-wrap { flex: 1; position: relative; min-width: 0; }
.search-bar {
  width: 100%;
  display: flex; align-items: center;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--clr-white);
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--clr-primary); }
.search-bar__input { flex: 1; padding: 9px 13px; font-size: 13px; color: var(--clr-text); min-width: 0; }
.search-bar__input::placeholder { color: var(--clr-text-muted); }
.search-bar__btn { padding: 9px 11px; border-left: 1px solid var(--clr-border); color: var(--clr-text-2); transition: color .2s; display: flex; align-items: center; }
.search-bar__btn:hover { color: var(--clr-primary); }
.search-bar__btn svg { width: 17px; height: 17px; }

/* ── Nav actions ── */
.nav-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.nav-action { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 10px; border-radius: var(--radius-sm); transition: background .2s; cursor: pointer; position: relative; }
.nav-action:hover { background: var(--clr-bg); }
.nav-action svg { width: 21px; height: 21px; color: var(--clr-text-2); }
.nav-action > span { font-size: 10.5px; color: var(--clr-text-2); white-space: nowrap; }
.nav-action__icon-wrap { position: relative; display: inline-flex; }
.cart-badge {
  position: absolute; top: -6px; right: -8px;
  background: var(--clr-primary); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; border: 1.5px solid var(--clr-white);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}

/* ── Burger ── */
.burger-btn { display: none; flex-direction: column; justify-content: space-between; width: 24px; height: 17px; flex-shrink: 0; }
.burger-btn span { display: block; height: 2px; background: var(--clr-text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.burger-btn.is-active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger-btn.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.is-active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* =====================================================
   MOBILE MENU
   ===================================================== */
.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--clr-white); border-bottom: 1px solid var(--clr-border);
  padding: 18px 20px; z-index: 199;
  flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .25s, transform .25s;
  /* JS sets max-height to the remaining viewport space below the nav bar —
     without this, an expanded category accordion grows the menu past the
     screen edge and the whole page scrolls instead of the menu itself. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu__nav { display: flex; flex-direction: column; }
.mobile-menu__nav a { font-size: 15px; font-weight: 500; color: var(--clr-text); padding: 11px 0; border-bottom: 1px solid var(--clr-border); display: flex; align-items: center; gap: 10px; transition: color .18s; }
.mobile-menu__nav a:hover { color: var(--clr-primary); }
.mobile-menu__contacts { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu__contacts a { font-size: 14px; color: var(--clr-primary); }
.mobile-menu__hours { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--clr-border); }
.mobile-menu__hours span { font-size: 12.5px; color: var(--clr-text-2); }

/* ── Mobile catalog accordion ── */
.mobile-catalog { border-bottom: 1px solid var(--clr-border); }
.mobile-catalog__toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 15px; font-weight: 500; color: var(--clr-text); cursor: pointer; }
.mobile-catalog__chevron { margin-left: auto; transition: transform .22s; }
.mobile-catalog__toggle.is-open .mobile-catalog__chevron { transform: rotate(180deg); }
.mobile-catalog__list { display: none; flex-direction: column; gap: 0; padding-bottom: 8px; }
.mobile-catalog__list.is-open { display: flex; }
.mobile-catalog__item { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px 9px 8px; border-radius: 6px; font-size: 13.5px; color: var(--clr-text); transition: background .15s, color .15s; }
.mobile-catalog__item:hover { background: var(--clr-primary-light); color: var(--clr-primary); }
.mobile-catalog__item span { font-size: 11px; color: var(--clr-text-muted); }

/* =====================================================
   MOBILE CATALOG OVERLAY
   ===================================================== */
.mob-cat-overlay {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 88%; max-width: 340px;
  background: var(--clr-white);
  z-index: 400; overflow-y: auto;
  transform: translateX(-105%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 6px 0 28px rgba(0,0,0,.18);
}
.mob-cat-overlay.is-open { transform: translateX(0); }
.mob-cat-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,20,40,.5);
  z-index: 399;
  opacity: 0; pointer-events: none;
  transition: opacity .28s;
}
.mob-cat-backdrop.is-open { opacity: 1; pointer-events: auto; }
.mob-cat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--clr-primary);
  position: sticky; top: 0; z-index: 1;
}
.mob-cat-head__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #fff; }
.mob-cat-head__close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: rgba(255,255,255,.88); border-radius: 6px; transition: background .15s; flex-shrink: 0; }
.mob-cat-head__close:hover { background: rgba(255,255,255,.15); }
.mob-cat-head__close svg { width: 19px; height: 19px; }
.mob-cat-list { padding: 4px 0; }
.mob-cat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  font-size: 14px; color: var(--clr-text);
  border-bottom: 1px solid var(--clr-border);
  transition: background .15s;
  text-decoration: none;
}
.mob-cat-item:last-child { border-bottom: none; }
.mob-cat-item:active { background: var(--clr-bg); }
.mob-cat-item svg { width: 20px; height: 20px; color: var(--clr-primary); flex-shrink: 0; }
.mob-cat-item__name { flex: 1; font-weight: 500; }
.mob-cat-item__count { font-size: 11px; color: var(--clr-text-muted); white-space: nowrap; }

/* =====================================================
   CATALOG MEGA-MENU PANEL
   ===================================================== */
.catalog-panel {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  background: var(--clr-white);
  border-bottom: 2px solid var(--clr-border);
  box-shadow: 0 12px 40px rgba(0,0,0,.14);
  z-index: 198;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .22s, transform .22s;
}
.catalog-panel.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.catalog-panel__inner {
  display: flex;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  min-height: 320px;
  max-height: 480px;
}
.catalog-panel__cats {
  width: 224px; flex-shrink: 0;
  border-right: 1px solid var(--clr-border);
  padding: 10px 0;
  overflow-y: auto;
}
.catalog-cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 1px 6px;
  border-radius: 7px;
  font-size: 13px; color: var(--clr-text);
  cursor: pointer;
  transition: background .15s, color .15s;
  user-select: none;
}
.catalog-cat-item:hover, .catalog-cat-item.is-active { background: var(--clr-primary-light); color: var(--clr-primary); }
.catalog-cat-item svg { width: 18px; height: 18px; color: var(--clr-primary); opacity: .65; flex-shrink: 0; }
.catalog-cat-item img { width: 18px; height: 18px; object-fit: contain; opacity: .65; flex-shrink: 0; }
.catalog-cat-item:hover img, .catalog-cat-item.is-active img { opacity: 1; }
.catalog-cat-item.is-active svg { opacity: 1; }
.catalog-cat-item .cat-label { flex: 1; font-weight: 500; }
.catalog-cat-item .cat-count { font-size: 10.5px; color: var(--clr-text-muted); }
.catalog-cat-item.is-active .cat-count { color: rgba(21,101,192,.55); }

.catalog-panel__contents { flex: 1; overflow: hidden; }
.catalog-panel__content { display: none; padding: 18px 24px; }
.catalog-panel__content.is-active { display: block; }
.catalog-sub-title {
  font-size: 16px; font-weight: 700; color: var(--clr-text);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--clr-border);
}
.catalog-sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 12px; margin-bottom: 16px; }
.catalog-sub-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; color: var(--clr-text);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.catalog-sub-item:hover { background: var(--clr-bg); color: var(--clr-primary); }
.catalog-sub-item::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--clr-primary); flex-shrink: 0; opacity: .4; transition: opacity .15s; }
.catalog-sub-item:hover::before { opacity: 1; }
.catalog-view-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--clr-primary); font-weight: 500;
  padding: 6px 10px; border-radius: 6px;
  transition: background .15s;
}
.catalog-view-all:hover { background: var(--clr-primary-light); }
.catalog-view-all svg { width: 14px; height: 14px; }

/* =====================================================
   HERO
   ===================================================== */
.hero { background: linear-gradient(135deg, #EEF5FF 0%, #F5F9FF 55%, #FEFFFF 100%); padding: 52px 0 0; overflow: hidden; }
.hero__inner {
  position: relative;
  padding-bottom: 52px;
}
/* Two stacked layers instead of a single background-image on .hero__inner —
   site.js (updateHeroBanner()) paints the next slide's image onto whichever
   layer is currently hidden, then crossfades opacity while a slow Ken Burns
   zoom plays on the incoming layer, instead of the old instant swap. */
.hero__banner-layer {
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 84%;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1s ease;
  pointer-events: none;
}
.hero__banner-layer.is-active {
  opacity: 1;
  animation: heroBannerZoom 7s ease-out forwards;
}
@keyframes heroBannerZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__banner-layer { transition: opacity .3s ease; }
  .hero__banner-layer.is-active { animation: none; }
}
.hero__content { position: relative; z-index: 1; max-width: 590px; }
/* Title/subtitle fade+rise briefly between slides (site.js render()) instead
   of an instant text swap — the dots stay outside this wrapper so they keep
   updating immediately. */
.hero__slider-text { transition: opacity .3s ease, transform .3s ease; }
.hero__slider-text.is-fading { opacity: 0; transform: translateY(6px); }
.hero__title { font-size: 30px; font-weight: 700; color: var(--clr-text); line-height: 1.22; margin-bottom: 10px; text-wrap: pretty; }
/* Applied by site.js when a slide's title+accent wraps to 3+ lines at the base
   size — keeps every slide's rendered height close to the others instead of
   the rare long slide stretching the reserved box (and running into the photo). */
.hero__title--sm { font-size: 25px; }
.hero__title-accent { color: var(--clr-accent); }
.hero__subtitle { font-size: 14px; color: var(--clr-text-2); margin-bottom: 24px; }
/* Flex column so the dots row can be pinned to the bottom of the reserved box
   (see margin-top:auto below) — otherwise, since title/subtitle height varies
   per slide while the box height is fixed (site.js reserveHeight()), the dots
   would float at whatever height that slide's content happens to end, jumping
   up/down on every rotation instead of staying put. */
.hero__slider { display: flex; flex-direction: column; min-height: 132px; cursor: grab; touch-action: pan-y; }
.hero__slider.is-dragging { cursor: grabbing; user-select: none; }
.hero__slider-dots { display: flex; gap: 7px; margin-top: auto; margin-bottom: 24px; }
.hero__slider-dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%; background: var(--clr-border); cursor: pointer; transition: background .2s, width .2s; }
.hero__slider-dot.is-active { width: 22px; border-radius: 4px; background: var(--clr-primary); }
.hero__badges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; margin-bottom: 28px; }
.hero__badge { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--clr-text); line-height: 1.4; }
.hero__badge svg { width: 26px; height: 26px; color: var(--clr-primary); flex-shrink: 0; margin-top: 1px; }
.hero__buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================================================
   HBANNER — full-bleed photo hero, built independently from .hero above
   (own markup in includes/hero_new.php, own JS block in site.js — not a
   reskin of .hero__banner-layer's technique). Photo is the entire slide
   ("Hero Slider Variants" doc, option 1g), dark gradient on the left holds
   the text. Every slide is server-rendered as ONE stacked absolutely-
   positioned unit (photo+overlay+text+button together) and crossfades as a
   whole via inline opacity set directly by JS (site.js) — sidesteps any
   class-toggle specificity ambiguity. Fixed frame height (not min-height)
   so switching slides never resizes the frame; site.js additionally shrinks
   each slide's own title/text font-size to fit so a long slide doesn't
   overflow into the nav row and every slide reads at a consistent scale.
   Toggle variants in index.php via $heroVariant.
   ===================================================== */
.hbanner { padding: 36px 0; }
/* display:grid + every slide on grid-area 1/1 (instead of position:absolute)
   is what lets the mobile layout below auto-size the frame to whichever
   slide's content is tallest, with no JS height measurement: a grid track
   with an indefinite (auto) size sizes itself to its tallest item's own
   intrinsic content height. Desktop still sets an explicit pixel height
   below, which simply overrides the auto-sizing (an explicit size always
   wins over content-based sizing), so this is a no-op there. */
.hbanner__frame { position: relative; display: grid; height: 480px; overflow: hidden; border-radius: var(--radius-lg); background: #0D2A57; cursor: grab; touch-action: pan-y; }
.hbanner__frame.is-dragging { cursor: grabbing; user-select: none; }
.hbanner__slide {
  grid-area: 1 / 1;
  position: relative;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease;
}
.hbanner__slide.is-active { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  .hbanner__slide { transition: opacity .2s ease; }
}
/* Desktop: photo fills the entire slide, panel overlaid on top of it (both
   position:absolute, see below). Mobile overrides .hbanner__photo to a
   fixed-height block in NORMAL FLOW instead (see the phone breakpoint) —
   that's what gives .hbanner__slide (and so the whole grid row) a genuine
   content height to auto-size against on mobile. */
.hbanner__photo { position: absolute; inset: 0; }
.hbanner__slide-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hbanner__overlay {
  position: absolute; inset: 0;
  /* Per-slide override: hero_new.php sets --hbanner-overlay inline when a
     slide's own photo (e.g. a ready-made ad banner with its own background/
     text baked in) needs a different treatment than the default navy fade —
     falls back to that default when the slide doesn't set one. */
  background: var(--hbanner-overlay, linear-gradient(90deg, rgba(11,40,90,.88) 0%, rgba(13,71,161,.55) 40%, rgba(21,101,192,.08) 65%, transparent 100%));
  pointer-events: none;
}
.hbanner__panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  max-width: 700px; padding: 0 60px;
}
/* .hbanner__badge and .hbanner__actions both get a fixed-size flex slot
   (flex:0 0 auto + a constant margin) at the top/bottom of the panel;
   .hbanner__copy is the only flexible item (flex:1) between them, has
   overflow:hidden, and centers its own content within whatever space is
   left. That way neither the badge nor the buttons ever move — regardless
   of how many lines this slide's title/text wrap to — and an unusually
   long slide clips inside its own zone instead of visually bleeding into
   the badge above or the buttons below. */
.hbanner__badge {
  flex: 0 0 auto; align-self: flex-start;
  margin-top: 56px; margin-bottom: 22px;
  display: inline-block; padding: 7px 18px; border-radius: 20px;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 13px; font-weight: 600;
}
.hbanner__copy { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.hbanner__title { font-size: 40px; font-weight: 800; color: #fff; line-height: 1.18; margin-bottom: 16px; text-wrap: pretty; }
.hbanner__title-accent { color: #8ec9ff; }
.hbanner__text { font-size: 16px; color: rgba(255,255,255,.85); line-height: 1.55; }
.hbanner__actions { flex: 0 0 auto; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; margin-bottom: 108px; }
/* White solid button (not the site-wide blue .btn--primary) — matches the
   reference doc's own CTA, which is white-on-dark for contrast against the photo. */
.hbanner__actions .btn--primary { background: #fff; color: var(--clr-primary-dark); border-color: #fff; }
.hbanner__actions .btn--primary:hover { background: #e8eefc; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--outline-light:hover { background: rgba(255,255,255,.14); }
/* Own dark chip background (not just transparent-on-photo) — nav controls
   used to rely on the slide's own dark overlay/photo for contrast, which
   broke once a slide could have a light/white background (e.g. a ready-made
   ad banner with its own bright design, no dark gradient behind it). A fixed
   semi-opaque backdrop keeps the white icons/dots visible no matter what the
   current slide's photo looks like. */
.hbanner__nav {
  position: absolute; left: 60px; bottom: 40px; display: flex; align-items: center; gap: 16px; z-index: 1;
  background: rgba(0,0,0,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 8px 16px; border-radius: 999px;
}
.hbanner__arrow {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.hbanner__arrow:hover { background: rgba(255,255,255,.28); }
.hbanner__dots { display: flex; gap: 8px; }
.hbanner__dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 4px; background: rgba(255,255,255,.35); cursor: pointer; transition: background .2s, width .2s; }
.hbanner__dot.is-active { width: 26px; background: #fff; }
.hbanner__count {
  position: absolute; top: 32px; right: 60px; color: rgba(255,255,255,.85); font-size: 13px; font-weight: 700; letter-spacing: .03em;
  background: rgba(0,0,0,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 5px 12px; border-radius: 999px;
}
/* Some slides are ready-made ad banners with their own text/CTA baked into
   the photo — showing our own title/subtitle/buttons on top of them just
   doubles up and clashes. Only suppressed here (desktop/tablet), where
   .hbanner__panel is absolutely-positioned OVER the photo — on phone
   (768px breakpoint below) the panel sits in its own space BELOW the photo
   in normal flow, nothing to clash with there, so the text comes back. */
.hbanner__slide--photo-only .hbanner__overlay,
.hbanner__slide--photo-only .hbanner__panel { display: none; }

/* Shared "open this product" link — lives INSIDE .hbanner__nav (a flex child
   next to the arrows/dots), not floating over the photo. A floating button
   used to sit over the photo's own bottom-right corner, which is exactly
   where every one of these ready-made promo banners already puts its own
   price — it covered that price on every single slide. Styled as a natural
   extension of the dark nav pill (same rgba backdrop family as .hbanner__arrow)
   instead of a separate white pill, so it no longer clashes with the dark
   switcher next to it. site.js's render(i) swaps its href to the active
   slide's own 'link' on every change. */
.hbanner__go {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); color: #fff;
  font-weight: 700; font-size: 13px; padding: 8px 20px; border-radius: 999px;
  text-decoration: none; white-space: nowrap; margin-left: 4px; transition: background .2s;
}
.hbanner__go:hover { background: rgba(255,255,255,.28); }

/* =====================================================
   CATEGORIES
   ===================================================== */
/* Two fixed rows, flowing into as many horizontally-scrollable columns as
   needed — swipeable on touch, draggable-feeling scroll on desktop, and the
   next column peeking in at the edge is the "there's more" cue (same
   hidden-scrollbar pattern as .brands-carousel-wrap). */
.categories-grid {
  display: grid; grid-template-rows: repeat(2, 1fr); grid-auto-flow: column; grid-auto-columns: 160px;
  gap: 10px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; cursor: grab;
}
.categories-grid::-webkit-scrollbar { display: none; }
.categories-grid.is-dragging { cursor: grabbing; user-select: none; }
.category-card {
  background: var(--clr-white); border: 1px solid var(--clr-border);
  border-radius: var(--radius-md); padding: 18px 8px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
  text-decoration: none; color: inherit;
  min-width: 0;
}
/* No transform/lift here — with only a 10px row gap in this 2-row layout, a
   translateY on hover visually crept into the row below. Border + shadow only. */
.category-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-md); }
.category-card__icon { width: 48px; height: 48px; background: var(--clr-primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--clr-primary); transition: background .2s; overflow: hidden; }
.category-card:hover .category-card__icon { background: #dce9fb; }
.category-card__icon svg { width: 26px; height: 26px; }
.category-card__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.category-card__name { font-size: 11.5px; font-weight: 600; color: var(--clr-text); line-height: 1.3; }
.category-card__count { font-size: 10.5px; color: var(--clr-text-muted); }

/* All-brands page grid */
.brands-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.brand-card {
  background: var(--clr-white); border: 1px solid var(--clr-border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s;
  text-decoration: none; color: inherit;
  min-width: 0; overflow: hidden;
}
.brand-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.brand-card__logo { width: 100%; height: 48px; object-fit: contain; }
.brand-card__text {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 100%; height: 48px; font-size: 16px; font-weight: 700; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-card__count { font-size: 10.5px; color: var(--clr-text-muted); }
/* Fallback for names too long to fit on one line even at the minimum shrink
   size (site.js) — wrap onto a second line instead of clipping. */
.brand-card__text.brand-text--wrap,
.brand-item__text.brand-text--wrap {
  white-space: normal; text-overflow: clip; text-align: center;
}

/* =====================================================
   BRANDS ROW (real logos — horizontally scrollable, no JS needed)
   ===================================================== */
.brands-row { display: flex; align-items: center; gap: 10px; }
.brands-carousel-wrap {
  flex: 1; min-width: 0;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; cursor: grab;
}
.brands-carousel-wrap::-webkit-scrollbar { display: none; }
.brands-carousel-wrap.is-dragging { cursor: grabbing; user-select: none; }
.brands-track { display: flex; gap: 6px; }
.brand-item {
  flex: 0 0 auto; width: 170px; height: 110px;
  display: flex; align-items: center; justify-content: center; padding: 14px 18px;
}
.brand-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-item__text {
  font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* =====================================================
   HITS / TABS
   ===================================================== */
.hits-section { background: var(--clr-white); }
.hits-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.hits-header__left { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hits-header__right { display: flex; align-items: center; gap: 12px; }
.hits-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.hits-tab { padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--clr-text-2); border: 1px solid transparent; transition: all .18s; cursor: pointer; }
.hits-tab:hover { color: var(--clr-primary); }
.hits-tab.is-active { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }
.hits-nav { display: flex; gap: 5px; }

/* =====================================================
   PRODUCTS GRID
   ===================================================== */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.product-card {
  background: var(--clr-white); border: 1px solid var(--clr-border);
  border-radius: var(--radius-md); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s;
  /* Grid item in .products-grid's repeat(4, 1fr) — without this, the card's default
     min-width:auto uses its content's min-content size as the floor. The qty-control's
     hard-pinned .qty-btn buttons (flex-shrink:0) have a wider min-content floor than
     the "В корзину" button they replace once the item is in the cart (same bug as
     #productQtyControl on the product detail page — see .product-info in pages.css). */
  min-width: 0;
}
.product-card:hover { box-shadow: var(--shadow-md); }
.product-card__top { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 10px 0; min-height: 34px; }
.product-card__wish { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background .18s; flex-shrink: 0; }
.product-card__wish:hover { background: var(--clr-bg); }
.product-card__wish svg { width: 16px; height: 16px; color: var(--clr-text-muted); }
.product-card__wish.is-active svg { fill: #C62828; stroke: #C62828; }
.product-card__img { padding: 10px 14px; display: flex; align-items: center; justify-content: center; height: 155px; overflow: hidden; }
.product-card__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-img-placeholder { width: 100%; height: 100%; background: var(--clr-primary-light); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.product-img-placeholder svg { width: 80px; height: 60px; }
.product-card__info { padding: 0 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.product-card__name   { font-size: 13.5px; font-weight: 600; color: var(--clr-text); line-height: 1.3; }
.product-card__brand  { font-size: 12px; color: var(--clr-text-2); width: fit-content; }
.product-card__brand:hover { color: var(--clr-primary); text-decoration: underline; }
.product-card__art    { font-size: 11px; color: var(--clr-text-muted); }
.product-card__price  { font-size: 19px; font-weight: 700; color: var(--clr-text); margin-top: 7px; }
.product-card__actions { padding: 0 10px 12px; display: flex; align-items: center; gap: 7px; }
.product-card__actions--notify { padding: 0 10px 12px; }

.qty-control { display: flex; align-items: center; border: 1.5px solid var(--clr-border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; height: 34px; }
.qty-btn { width: 28px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--clr-text-2); line-height: 1; transition: background .15s, color .15s; }
.qty-btn:hover { background: var(--clr-bg); color: var(--clr-primary); }
.qty-value { width: 30px; text-align: center; font-size: 13px; font-weight: 500; color: var(--clr-text); border-left: 1px solid var(--clr-border); border-right: 1px solid var(--clr-border); height: 34px; display: flex; align-items: center; justify-content: center; }
input.qty-value { width: 36px; }
/* Hide the native number-input spinner — custom −/+ buttons already cover it. */
input.qty-value::-webkit-outer-spin-button,
input.qty-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.qty-value { -moz-appearance: textfield; appearance: textfield; }
.btn-add-cart { flex: 1; background: var(--clr-primary); color: #fff; padding: 0 10px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500; height: 34px; display: flex; align-items: center; justify-content: center; white-space: nowrap; transition: background .2s; }
.btn-add-cart:hover { background: var(--clr-primary-dark); }
.btn-notify { width: 100%; height: 34px; background: var(--clr-white); border: 1.5px solid var(--clr-border); border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 500; color: var(--clr-text-2); display: flex; align-items: center; justify-content: center; transition: border-color .2s, color .2s; }
.btn-notify:hover { border-color: var(--clr-primary); color: var(--clr-primary); }

/* ── Add-to-cart toggle: по умолчанию кнопка; после клика — только qty ── */
.product-card:not(.in-cart) .qty-control { display: none; }
.product-card:not(.in-cart) .product-card__actions .btn-add-cart { display: flex; width: 100%; }
.product-card.in-cart .qty-control { display: flex; width: 100%; }
.product-card.in-cart .qty-control .qty-value { flex: 1; width: auto; min-width: 0; }
.product-card.in-cart .qty-control .qty-btn { flex-shrink: 0; }
.product-card.in-cart .product-card__actions .btn-add-cart { display: none; }

/* Cart-page qty-control: same fill-the-row treatment as the product-card version. */
.cart-item .qty-control { width: 100%; }
.cart-item .qty-control .qty-value { flex: 1; width: auto; min-width: 0; }
.cart-item .qty-control .qty-btn { flex-shrink: 0; }

/* =====================================================
   WHY US
   ===================================================== */
.why-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.why-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.why-item__icon { width: 52px; height: 52px; background: var(--clr-primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--clr-primary); }
.why-item__icon svg { width: 26px; height: 26px; }
.why-item__text strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--clr-text); line-height: 1.3; margin-bottom: 2px; }
.why-item__text span { font-size: 12px; color: var(--clr-text-2); line-height: 1.35; }

/* =====================================================
   CTA SECTION
   ===================================================== */
.cta-section { background: linear-gradient(120deg, #0D47A1 0%, #1565C0 50%, #1A78D1 100%); padding: 60px 0; overflow: hidden; }
.cta-section__inner { display: grid; grid-template-columns: 1fr auto; gap: 56px; align-items: center; }
.cta-section__title { font-size: 28px; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 10px; text-wrap: pretty; }
.cta-section__subtitle { font-size: 14px; color: rgba(255,255,255,.82); line-height: 1.55; margin-bottom: 28px; max-width: 460px; }
.cta-section__btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cta-section__btns .btn { padding: 11px 22px; font-size: 13.5px; }
.cta-section__note { font-size: 12px; color: rgba(255,255,255,.55); }
.phone-mockup { width: 200px; background: #1E293B; border-radius: 28px; padding: 16px 13px; box-shadow: 0 24px 56px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08); flex-shrink: 0; }
.phone-mockup__screen { background: var(--clr-white); border-radius: 18px; overflow: hidden; padding: 13px; min-height: 210px; }
.phone-mockup__hdr { border-bottom: 1px solid var(--clr-border); padding-bottom: 9px; margin-bottom: 11px; display: flex; align-items: center; gap: 6px; }
.phone-mockup__dot { width: 26px; height: 26px; background: var(--clr-primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--clr-primary); }
.phone-mockup__dot svg { width: 13px; height: 13px; }
.phone-mockup__name { font-size: 10.5px; font-weight: 600; color: var(--clr-text); }
.phone-mockup__name span { color: var(--clr-primary); }
.phone-mockup__chat { display: flex; flex-direction: column; gap: 7px; }
.phone-bubble { font-size: 10px; line-height: 1.5; padding: 6px 9px; border-radius: 9px; max-width: 88%; color: var(--clr-text); }
.phone-bubble--in  { background: var(--clr-bg); border-radius: 3px 9px 9px 9px; align-self: flex-start; }
.phone-bubble--out { background: #DCF8C6; border-radius: 9px 3px 9px 9px; align-self: flex-end; }

/* =====================================================
   INFO BLOCKS
   ===================================================== */
.info-blocks { padding: 26px 0; border-top: 1px solid var(--clr-border); border-bottom: 1px solid var(--clr-border); background: var(--clr-white); }
.info-blocks__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.info-block { display: flex; align-items: flex-start; gap: 12px; }
.info-block__icon { width: 42px; height: 42px; background: var(--clr-primary-light); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--clr-primary); flex-shrink: 0; }
.info-block__icon svg { width: 20px; height: 20px; }
.info-block__text strong { display: block; font-size: 13px; font-weight: 600; color: var(--clr-text); margin-bottom: 3px; line-height: 1.3; }
.info-block__text p { font-size: 11.5px; color: var(--clr-text-2); line-height: 1.45; }

/* =====================================================
   FOOTER
   ===================================================== */
.footer { background: var(--clr-footer); padding: 44px 0 0; }
.footer__main { display: grid; grid-template-columns: 240px repeat(4, 1fr); gap: 36px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer__desc { font-size: 12.5px; color: rgba(255,255,255,.5); line-height: 1.65; margin: 14px 0 18px; }
.footer__socials { display: flex; gap: 10px; }
/* Telegram/MAX/VK ship their own brand-colored badge shape inside the SVG —
   the circle here just crops corners to match; WhatsApp's icon is a bare
   currentColor path (no background of its own), so it gets the brand-green
   circle explicitly via .social-link--whatsapp. */
.social-link { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: opacity .2s, transform .2s; }
.social-link:hover { opacity: .8; transform: translateY(-2px); }
.social-link svg { width: 100%; height: 100%; }
.social-link--whatsapp { background: #25D366; }
.social-link--whatsapp svg { width: 18px; height: 18px; color: #fff; }
.footer__col h4 { font-size: 13.5px; font-weight: 600; color: #fff; margin-bottom: 14px; }
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__links a { font-size: 12.5px; color: rgba(255,255,255,.55); transition: color .18s; }
.footer__links a:hover { color: #fff; }
.footer__col--contacts { display: flex; flex-direction: column; gap: 7px; }
.footer__phone { font-size: 15px; font-weight: 600; color: #fff; display: block; }
.footer__email { font-size: 12.5px; color: rgba(255,255,255,.6); display: block; }
.footer__hours { font-size: 11.5px; color: rgba(255,255,255,.45); line-height: 1.55; }
.footer__addr  { font-size: 11.5px; color: rgba(255,255,255,.32); }
.footer__badges-rows { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 40px; padding-top: 20px; }
.footer__payments { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 0; }
.footer__payments-label { font-size: 11.5px; color: rgba(255,255,255,.45); margin-right: 2px; }
.payment-badge { display: flex; width: 40px; height: 26px; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.25); flex-shrink: 0; }
.payment-badge svg { width: 100%; height: 100%; display: block; }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 18px; flex-wrap: wrap; }
.footer__copy  { font-size: 11.5px; color: rgba(255,255,255,.3); }
.footer__legal { display: flex; gap: 22px; }
.footer__legal a { font-size: 11.5px; color: rgba(255,255,255,.3); transition: color .18s; }
.footer__legal a:hover { color: rgba(255,255,255,.65); }
.footer__dev { font-size: 11.5px; color: rgba(255,255,255,.2); }

/* =====================================================
   SCROLL TO TOP
   ===================================================== */
.scroll-top-btn {
  position: fixed; bottom: 22px; right: 22px;
  width: 42px; height: 42px;
  background: var(--clr-primary); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); z-index: 300;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s, transform .25s, background .2s;
}
.scroll-top-btn.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top-btn:hover { background: var(--clr-primary-dark); }
.scroll-top-btn svg { width: 19px; height: 19px; }

/* =====================================================
   SEARCH DROPDOWN
   ===================================================== */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--clr-white);
  border: 1.5px solid var(--clr-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 250; overflow: hidden;
  display: none;
}
.search-dropdown.is-open { display: block; }
.search-dropdown__hdr { padding: 8px 13px; border-bottom: 1px solid var(--clr-border); font-size: 11px; color: var(--clr-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.search-result-item { display: flex; align-items: center; gap: 11px; padding: 9px 13px; cursor: pointer; border-bottom: 1px solid var(--clr-border); transition: background .15s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--clr-bg); }
.search-result-img { width: 44px; height: 44px; background: var(--clr-primary-light); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.search-result-img svg { width: 30px; height: 22px; }
.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-img img.is-fallback-img { object-fit: contain; padding: 4px; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name  { font-size: 13px; font-weight: 500; color: var(--clr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-brand { font-size: 11px; color: var(--clr-text-2); margin-top: 2px; }
.search-result-price { font-size: 13.5px; font-weight: 700; color: var(--clr-primary); white-space: nowrap; flex-shrink: 0; }
.search-dropdown__ftr { padding: 8px 13px; border-top: 1px solid var(--clr-border); background: var(--clr-bg); }
.search-dropdown__ftr a { font-size: 12.5px; color: var(--clr-primary); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 5px; }
.search-dropdown__ftr a svg { width: 14px; height: 14px; flex-shrink: 0; }
.search-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--clr-text-muted); }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,20,40,.55);
  backdrop-filter: blur(3px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--clr-white); border-radius: 18px;
  padding: 32px; width: 100%; max-width: 440px;
  position: relative;
  transform: scale(.95) translateY(20px);
  transition: transform .28s cubic-bezier(.34,1.4,.64,1);
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
.modal-overlay.is-open .modal { transform: scale(1) translateY(0); }
.modal__close { position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--clr-text-2); font-size: 20px; font-weight: 300; transition: background .15s; line-height: 1; }
.modal__close:hover { background: var(--clr-bg); }
.modal__icon { width: 50px; height: 50px; background: var(--clr-primary-light); border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--clr-primary); margin-bottom: 14px; }
.modal__icon svg { width: 24px; height: 24px; }
.modal__title   { font-size: 21px; font-weight: 700; color: var(--clr-text); margin-bottom: 4px; }
.modal__subtitle { font-size: 13px; color: var(--clr-text-2); margin-bottom: 22px; line-height: 1.5; }
.modal__form { display: flex; flex-direction: column; gap: 13px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12px; font-weight: 500; color: var(--clr-text-2); }
.form-field input,
.form-field select,
.form-field textarea {
  border: 1.5px solid var(--clr-border); border-radius: 8px;
  padding: 10px 13px; font-size: 14px; font-family: inherit;
  color: var(--clr-text); transition: border-color .2s;
  background: var(--clr-white); -webkit-appearance: none; appearance: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--clr-primary); outline: none; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--clr-text-muted); }
.form-field select { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 32px; cursor: pointer; }
.modal__agree { font-size: 11px; color: var(--clr-text-muted); line-height: 1.5; }
.modal__agree a { color: var(--clr-primary); }
.modal__submit { width: 100%; padding: 12px; font-size: 15px; }
.modal-success { display: none; flex-direction: column; align-items: center; text-align: center; padding: 10px 0; }
.modal-success.is-visible { display: flex; }
.modal-success__icon { width: 60px; height: 60px; background: #E8F5E9; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #2E7D32; margin-bottom: 14px; }
.modal-success__icon svg { width: 30px; height: 30px; }
.modal-success h3 { font-size: 19px; font-weight: 700; color: var(--clr-text); margin-bottom: 7px; }
.modal-success p  { font-size: 13.5px; color: var(--clr-text-2); line-height: 1.5; }
.modal-form-area.is-hidden { display: none; }

/* =====================================================
   RESPONSIVE — TABLET 1060px
   ===================================================== */
@media (max-width: 1060px) {
  .brands-grid { grid-template-columns: repeat(4, 1fr); }
  .why-grid { grid-template-columns: repeat(3, 1fr); }
  .footer__main { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; display: flex; gap: 36px; align-items: flex-start; }
  .footer__desc  { margin-top: 0; }
  .hero__content { max-width: 480px; }
  .hero__inner   { background-size: auto 80%; }
  .hero__title   { font-size: 26px; }
  .brand-item    { width: calc(100% / 5); }
  .hbanner__frame  { height: 420px; }
  .hbanner__badge  { margin-top: 40px; margin-bottom: 18px; }
  .hbanner__title  { font-size: 32px; margin-bottom: 12px; }
  .hbanner__actions { margin-top: 20px; margin-bottom: 96px; }
  .hbanner__nav    { bottom: 32px; }
  .hbanner__arrow  { width: 40px; height: 40px; }
}

/* =====================================================
   RESPONSIVE — TABLET 860px
   ===================================================== */
@media (max-width: 860px) {
  .top-header__tagline { display: none; }
  .top-header__hours   { display: none; }
  .top-header__contacts { flex-direction: row; gap: 14px; }
  .hero__content { max-width: 400px; }
  .hero__inner   { background-size: auto 65%; }
  .hbanner__frame  { height: 380px; }
  .hbanner__badge  { margin-top: 28px; margin-bottom: 14px; }
  .hbanner__title  { font-size: 28px; margin-bottom: 10px; }
  .hbanner__text   { font-size: 14.5px; }
  .hbanner__actions { margin-top: 14px; margin-bottom: 88px; }
  .hbanner__nav    { bottom: 28px; }
  .hbanner__arrow  { width: 38px; height: 38px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .info-blocks__grid { grid-template-columns: repeat(2, 1fr); }
  .cta-section__inner { grid-template-columns: 1fr; }
  .phone-mockup { display: none; }
  .hits-header  { flex-direction: column; align-items: flex-start; }
  .brand-item   { width: calc(100% / 4); }
  .catalog-panel__cats { width: 190px; }
  .catalog-sub-grid { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   RESPONSIVE — MOBILE 768px
   ===================================================== */
@media (max-width: 768px) {
  .top-header  { display: none; }
  .logo--nav   { display: flex; }
  .burger-btn  { display: flex; }
  .mobile-menu { display: flex; }
  .catalog-panel { display: none; }

  /* Строка 1: лого ←→ иконки + бургер */
  .main-nav__inner { flex-wrap: wrap; gap: 8px; align-items: center; }
  .logo--nav   { order: 1; max-width: 55vw; }
  .logo--nav .logo__img { height: 22px; }
  .nav-actions { order: 2; margin-left: auto; }
  .burger-btn  { order: 2; }
  /* Каталог скрыт на мобиле — доступен через бургер-меню */
  .catalog-btn { display: none; }
  /* Строка 2: поиск на всю ширину */
  /* Поиск: строго на всю ширину */
  .search-wrap { order: 4; width: 100%; flex: 1 1 100%; min-width: 0; }
  .search-wrap .search-bar { width: 100%; }
  /* Hide only the text label span — .nav-action__icon-wrap is also a direct
     <span> child and must stay visible, or the cart/favorites icons vanish. */
  .nav-action > span:not(.nav-action__icon-wrap) { display: none; }
  .nav-action        { padding: 5px 7px; }
  .nav-action svg    { width: 20px; height: 20px; }

  .hero            { padding: 32px 0 0; }
  .hero__inner     { padding-bottom: 32px; }
  .hero__banner-layer { display: none; }
  .hero__content   { max-width: none; }
  .hero__title     { font-size: 22px; }
  .hero__title br  { display: none; }
  .hero__badges    { grid-template-columns: 1fr; gap: 9px; }
  .hero__buttons   { flex-direction: column; }
  .hero__buttons .btn { width: 100%; }

  /* Phone layout is a different composition, not a scaled-down desktop one
     (per the approved "Hero Slider Variants" mobile mockup): photo fixed-
     height at the top in NORMAL FLOW, badge/text/button flow naturally
     below it — no more absolute-positioned zones with hand-guessed margins.
     .hbanner__slide becomes a flex column, so its own content height is
     genuine (photo height + panel's natural content height), and the grid
     row on .hbanner__frame (see base rules) auto-sizes to whichever slide
     is tallest. Short slides just end up with a shorter card — there's no
     leftover space left to manage, so nothing can drift or get clipped. */
  .hbanner__frame    { height: auto; }
  .hbanner__slide    { display: flex; flex-direction: column; }
  .hbanner__photo    { position: relative; flex: 0 0 auto; height: 220px; }
  .hbanner__overlay  { background: linear-gradient(180deg, transparent 55%, rgba(11,40,90,.9) 100%); }
  /* Restore the text/CTA panel here — the desktop-only "photo-only" rule
     above hides it because there it sits ON TOP of the photo; on phone the
     panel is in normal flow BELOW the photo (no overlap), so showing it is
     safe and better than leaving an empty dark space under the banner. */
  .hbanner__slide--photo-only .hbanner__overlay { display: block; }
  .hbanner__slide--photo-only .hbanner__panel   { display: flex; }
  /* .hbanner__slide stretches to the grid row's auto-computed height (the
     tallest slide's own natural size) — every OTHER slide ends up taller
     than its own content needs. .hbanner__panel is flex:1 to absorb that
     (filling the slide), and inside it badge/actions keep the same fixed-
     margin-slot technique as the desktop panel above: only .hbanner__copy
     is flex:1 + centered, so the button sits at the exact same distance
     from the bottom on every slide, and any slack shows up as breathing
     room around the text instead of a stray gap next to the button. */
  .hbanner__panel    { position: static; flex: 1 1 auto; display: flex; flex-direction: column; max-width: none; padding: 24px 20px; }
  .hbanner__badge    { margin-top: 0; margin-bottom: 12px; padding: 6px 14px; border-radius: 16px; font-size: 11.5px; }
  .hbanner__copy     { flex: 1 1 auto; overflow: visible; justify-content: center; }
  .hbanner__title    { font-size: 22px; margin-bottom: 8px; }
  .hbanner__text     { font-size: 13.5px; }
  .hbanner__actions  { flex: 0 0 auto; margin-top: 16px; margin-bottom: 0; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .hbanner__actions .btn { padding: 9px 14px; font-size: 12.5px; white-space: nowrap; }
  .hbanner__arrow    { display: none; }
  .hbanner__nav      { left: 50%; bottom: auto; top: 220px; transform: translate(-50%, -50%); gap: 0; }
  /* Arrows are hidden here, so the nav pill is just dots + this button with
     no flex gap between them (gap:0 above) — pulls the button flush against
     the dots without its own spacing. */
  .hbanner__go       { margin-left: 14px; }
  .hbanner__count    { display: none; }

  .section { padding: 32px 0; }
  .categories-grid { grid-auto-columns: 130px; gap: 9px; }
  .brands-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .brand-item { width: 130px; height: 88px; padding: 10px 14px; }
  /* Хиты: табы горизонтальный скролл без переноса */
  .hits-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; gap: 4px; }
  .hits-tabs::-webkit-scrollbar { display: none; }
  .hits-tab { padding: 6px 10px; font-size: 12px; flex-shrink: 0; white-space: nowrap; }

  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .hits-header__left { flex-direction: column; align-items: flex-start; gap: 10px; }
  .product-card__top { padding: 7px 7px 0; min-height: auto; }
  .badge { font-size: 9px; padding: 2px 5px; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
  .product-card__img { height: 100px; padding: 7px 10px; }
  .product-card__info { padding: 0 8px 7px; }
  .product-card__name { font-size: 11.5px; }
  .product-card__price { font-size: 15px; margin-top: 5px; }
  .product-card__actions { padding: 0 8px 10px; flex-direction: column; gap: 5px; }
  .product-card__actions--notify { padding: 0 8px 10px; }
  .product-card .qty-control { width: 100%; }
  .btn-add-cart { width: 100%; font-size: 12px; padding: 0 8px; }
  .btn-notify { height: 32px; font-size: 11px; }
  /* Кнопка В корзину: всегда на всю ширину карточки */
  .product-card .product-card__actions .btn-add-cart { width: 100%; flex: none; align-self: stretch; }
  /* in-cart: qty-control на всю ширину, value растягивается по центру */
  .product-card.in-cart .qty-control { width: 100%; flex: none; }
  .product-card.in-cart .qty-control .qty-value { flex: 1; width: auto; min-width: 0; }
  .product-card.in-cart .qty-control .qty-btn { flex-shrink: 0; }

  .why-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }

  .cta-section { padding: 40px 0; }
  .cta-section__title { font-size: 20px; }
  .cta-section__btns  { flex-direction: column; }
  .cta-section__btns .btn { width: 100%; }

  .info-blocks__grid { grid-template-columns: 1fr; gap: 18px; }

  .footer__main { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer__brand { grid-column: 1 / -1; flex-direction: column; gap: 0; }
  .footer__badges-rows { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 7px; }
  .footer__legal { flex-direction: column; gap: 5px; }

  .scroll-top-btn { bottom: 14px; right: 14px; }
  .modal { padding: 24px; }
  .modal__title { font-size: 18px; }
}

/* =====================================================
   RESPONSIVE — SMALL MOBILE 480px
   ===================================================== */
@media (max-width: 480px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .footer__main { grid-template-columns: 1fr; }
  .hero__title  { font-size: 19px; }
  .hbanner__photo     { height: 190px; }
  .hbanner__panel     { padding: 20px 16px; }
  .hbanner__badge     { margin-bottom: 10px; }
  .hbanner__actions   { margin-top: 12px; }
  .hbanner__nav       { top: 190px; }
  .hbanner__title  { font-size: 20px; }
  .section-title { font-size: 17px; }
  .hits-tabs    { gap: 2px; }
  .categories-grid { grid-auto-columns: 120px; }
  .brand-item { width: 140px; }
}
