/* ============================================================
   NAVI Banner Zone v5 — Баннер + Быстрый доступ
   ------------------------------------------------------------
   Компоновка:
   - .navi-banner-zone = контейнер 1440px (flex row)
     • .navi-quick-access = левый блок (230px)
     • .navi-banner = правый блок (баннер 1150×300, оригинал)
   
   Преимущества:
   - Баннер 1150×300 показывается в оригинале (без растяжения/обрезки)
   - Слева — полезный блок навигации (Бренды, Новинки, Акции, Сервис, Скачать)
   - Никаких пустых фонов по бокам
   - На мобиле — вертикальная стопка
   ============================================================ */

/* === ВНЕШНЯЯ ЗОНА (контейнер flex row) === */
.navi-banner-zone {
  position: relative;
  width: 100%;
  max-width: var(--container);     /* 1440px */
  margin: 0 auto var(--sp-4);
  display: flex;
  align-items: stretch;             /* выравнивание по высоте */
  gap: 20px;
  padding: 0 16px;
  box-sizing: border-box;
}

/* === БЫСТРЫЙ ДОСТУП — левый блок === */
.navi-quick-access {
  flex: 0 0 230px;
  width: 230px;
  background: #fff;
  border: 1px solid var(--navi-border);
  border-radius: var(--r-xl);       /* 14px — как у баннера */
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(31, 42, 46, .06);
  display: flex;
  flex-direction: column;
}

.navi-quick-access-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  background: var(--navi-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.navi-quick-access-title i {
  color: var(--navi-teal);
  font-size: 14px;
}

.navi-quick-access-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}

.navi-quick-access-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navi-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, padding .15s ease;
  position: relative;
}
.navi-quick-access-item i {
  width: 18px;
  font-size: 15px;
  color: var(--navi-muted);
  text-align: center;
  transition: color .15s ease;
}
.navi-quick-access-item:hover {
  background: var(--navi-accent-bg);
  color: var(--navi-teal);
  border-left-color: var(--navi-teal);
  padding-left: 20px;
}
.navi-quick-access-item:hover i {
  color: var(--navi-teal);
}

/* === АКЦИИ — выделенный пункт (hot) === */
.navi-quick-access-item--highlight {
  background: linear-gradient(90deg, rgba(48, 164, 149, .08) 0%, transparent 100%);
  color: var(--navi-teal);
  font-weight: 600;
  border-left-color: var(--navi-teal);
}
.navi-quick-access-item--highlight i {
  color: var(--navi-teal);
}
.navi-quick-access-item--highlight:hover {
  background: linear-gradient(90deg, rgba(48, 164, 149, .15) 0%, transparent 100%);
  padding-left: 20px;
}

.navi-quick-access-badge {
  margin-left: auto;
  background: var(--navi-teal);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  line-height: 1.4;
}

/* === БАННЕР (правый блок, 1150px оригинал) === */
.navi-banner {
  position: relative;
  flex: 1 1 1150px;                 /* занимает оставшееся пространство */
  max-width: 1150px;                 /* но не шире естественной ширины картинок */
  border-radius: var(--r-xl);        /* 14px */
  overflow: visible;                 /* visible для стрелок */
  background: #fff;
  border: 1px solid var(--navi-border-strong);
  box-shadow: 0 4px 16px rgba(31, 42, 46, .08), 0 1px 3px rgba(31, 42, 46, .04);
}

.navi-banner-track {
  position: relative;
  display: flex;
  border-radius: var(--r-lg);        /* 10px — чуть меньше внешнего */
  overflow: hidden;                  /* скруглённые углы у картинок */
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
  background: #fff;
}

.navi-banner-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  display: block;
}

.navi-banner-slide a {
  display: block;
  width: 100%;
  text-decoration: none;
}

.navi-banner-slide img {
  display: block;
  width: 100%;
  /* ВАЖНО: НЕ используем aspect-ratio и object-fit: contain вместе с
     HTML-атрибутами width/height — они конфликтуют.
     Простое width:100%; height:auto — картинка растягивается на 100% ширины слайда,
     высота автоматически рассчитывается по натуральным пропорциям. */
  height: auto;
  background: #fff;
}

/* === Стрелки навигации (между sidebar и баннером / справа от баннера) === */
.navi-banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* Меньше и полупрозрачные */
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, .65);
  color: var(--navi-dark);
  border-radius: var(--r-pill);
  cursor: pointer;
  z-index: 5;
  transition: background .2s ease, color .2s ease, transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s ease, opacity .2s ease;
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  box-shadow: 0 1px 6px rgba(31, 42, 46, .15);
  opacity: .9;
}
.navi-banner-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}
.navi-banner-arrow:hover {
  background: var(--navi-teal);
  color: #fff;
  opacity: 1;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 14px rgba(48, 164, 149, .4);
}
.navi-banner-arrow:active {
  transform: translateY(-50%) scale(.95);
}
/* Стрелки НА БАННЕРЕ (внутри, по 12px от краёв) */
.navi-banner-arrow.navi-banner-prev {
  left: 12px;
}
.navi-banner-arrow.navi-banner-prev:hover svg {
  transform: translateX(-2px);
}
.navi-banner-arrow.navi-banner-next {
  right: 12px;
}
.navi-banner-arrow.navi-banner-next:hover svg {
  transform: translateX(2px);
}

/* Скрыть стрелки когда 1 слайд */
.navi-banner[data-count="1"] .navi-banner-arrow {
  display: none;
}

/* Скрыть стрелки на мобильных (<768px) — использовать swipe */
@media (max-width: 767px) {
  .navi-banner-arrow { display: none; }
}

/* === Dot indicators (на баннере, внизу) === */
.navi-banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
  padding: 7px 12px;
  background: rgba(31, 42, 46, .65);
  border-radius: var(--r-pill);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  box-shadow: 0 2px 8px rgba(31, 42, 46, .2);
}
.navi-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  padding: 0;
  transition: background .2s ease, width .25s cubic-bezier(.4, 0, .2, 1), transform .15s ease;
}
.navi-banner-dot:hover {
  background: rgba(255, 255, 255, .85);
  transform: scale(1.15);
}
.navi-banner-dot.active {
  background: var(--navi-teal);
  width: 24px;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3);
}
.navi-banner-dot.active:hover {
  background: var(--navi-teal-hover);
}

/* Скрыть dots когда 1 слайд */
.navi-banner[data-count="1"] .navi-banner-dots {
  display: none;
}

/* === Counter (на баннере, top-right) === */
.navi-banner-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  background: rgba(31, 42, 46, .65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-pill);
  z-index: 5;
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(31, 42, 46, .2);
}
.navi-banner[data-count="1"] .navi-banner-counter {
  display: none;
}

/* === Loading skeleton === */
.navi-banner:not(.navi-banner-ready) .navi-banner-slide img {
  opacity: 0;
}
.navi-banner:not(.navi-banner-ready) .navi-banner-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--navi-bg) 0%, var(--navi-border) 50%, var(--navi-bg) 100%);
  background-size: 200% 100%;
  animation: navi-banner-shimmer 1.4s ease-in-out infinite;
  z-index: 1;
}
@keyframes navi-banner-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Адаптив === */

/* На средних экранах (когда 1440 не помещается) — sidebar уже, баннер 1150 */
@media (max-width: 1439px) {
  .navi-banner-zone {
    padding: 0 12px;
    gap: 16px;
  }
  .navi-quick-access {
    flex: 0 0 200px;
    width: 200px;
  }
}

/* На узких десктопах — sidebar ещё уже */
@media (max-width: 1280px) {
  .navi-banner-zone {
    gap: 12px;
  }
  .navi-quick-access {
    flex: 0 0 180px;
    width: 180px;
  }
  .navi-quick-access-item {
    padding: 10px 12px;
    font-size: 13px;
  }
  .navi-quick-access-title {
    padding: 12px 12px 8px;
    font-size: 12px;
  }
}

/* На планшетах — вертикальная стопка */
@media (max-width: 991px) {
  .navi-banner-zone {
    flex-direction: column;
    gap: 12px;
    padding: 0 16px;
  }
  .navi-quick-access {
    flex: 0 0 auto;
    width: 100%;
  }
  /* Горизонтальный список на планшете */
  .navi-quick-access-list {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 6px;
  }
  .navi-quick-access-item {
    flex: 1 1 auto;
    min-width: 130px;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: var(--r-md);
    padding: 10px 12px;
  }
  .navi-quick-access-item:hover {
    border-left-color: transparent;
    border-bottom-color: var(--navi-teal);
    padding-left: 12px;
    padding-bottom: 14px;
  }
  .navi-quick-access-item--highlight {
    border-bottom-color: var(--navi-teal);
    background: rgba(48, 164, 149, .08);
  }
  .navi-quick-access-badge {
    display: none;
  }
  .navi-banner {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

/* На мобильных (<768px) */
@media (max-width: 767px) {
  .navi-banner-zone {
    padding: 0 12px;
    gap: 10px;
  }
  .navi-banner {
    border-radius: var(--r-lg);
  }
  .navi-banner-slide img {
    /* На мобиле баннер растягивается на всю ширину, картинка адаптируется через aspect-ratio */
  }
  .navi-banner-dots {
    bottom: 8px;
    padding: 5px 9px;
    gap: 4px;
  }
  .navi-banner-dot {
    width: 7px;
    height: 7px;
  }
  .navi-banner-dot.active {
    width: 20px;
  }
  .navi-banner-counter {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 3px 8px;
  }
  /* Quick access compact на мобиле */
  .navi-quick-access-title {
    padding: 10px 12px 6px;
    font-size: 11px;
  }
  .navi-quick-access-item {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 100px;
  }
  .navi-quick-access-item i {
    font-size: 13px;
    width: 14px;
  }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .navi-banner-track {
    transition: none;
  }
  .navi-banner:not(.navi-banner-ready) .navi-banner-track::before {
    animation: none;
  }
  .navi-banner-arrow,
  .navi-banner-dot,
  .navi-quick-access-item {
    transition: none;
  }
}
