/* Локальные доп-стили поверх Tailwind. Большая часть стилизации — utility-классами в шаблонах. */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat/montserrat-400.e7198b2dcb57.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat/montserrat-500.f96e8aab37e8.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat/montserrat-600.9e606da1cbeb.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat/montserrat-700.1c0792ac34ef.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --vik-ink: #151313;
  --vik-coral: #ff8562;
  /* Дублируем бренд-токены для plain-CSS правил (кабинет оператора). */
  --brand-500: #6d4bff;
  --brand-600: #5a32f0;
}

html {
  scroll-behavior: smooth;
}

img {
  -webkit-user-drag: none;
}

/* Vik-on: шапка — лёгкий «PCB»-фон (голубые дорожки, как vik-on.com). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  background-color: #ffffff;
  isolation: isolate;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/vik-circuit-bg.eec172e39696.svg");
  background-repeat: repeat;
  background-size: 420px 420px;
  background-position: center top;
  opacity: 0.28;
  pointer-events: none;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.88) 55%,
    rgba(255, 255, 255, 0.96) 100%
  );
  pointer-events: none;
}

.site-header-inner {
  position: relative;
  z-index: 1;
}

.site-header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0;
}

@media (min-width: 640px) {
  .site-header-grid {
    gap: 1rem 1.5rem;
    padding: 0.625rem 0;
  }
}

@media (min-width: 1024px) {
  .site-header-grid {
    gap: 1rem 2rem;
  }
}

.site-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.875rem 1.25rem;
  min-width: 0;
  justify-self: end;
}

@media (min-width: 640px) {
  .site-header-right {
    gap: 1rem 1.75rem;
  }
}

/* Правый модуль: соцсети + корзина + график + город */
.site-header-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  min-width: 0;
  justify-self: end;
}

.site-header-icons {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.site-header-icon-btn {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.site-header-icon-btn--lg {
  height: 2.375rem;
  width: 2.375rem;
}

.site-header-icon-btn svg {
  height: 1rem;
  width: 1rem;
}

.site-header-icon-btn--lg svg {
  height: 1.125rem;
  width: 1.125rem;
}

.site-header-icon-btn:hover {
  transform: translateY(-2px) scale(1.07);
  filter: brightness(1.12);
}

.site-header-icon-btn:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.95);
}

.site-header-icon--tg {
  background-color: #229ed9;
}

.site-header-icon--tg:hover {
  box-shadow: 0 6px 18px rgba(34, 158, 217, 0.42);
}

.site-header-icon--vk {
  background-color: #4c75a3;
}

.site-header-icon--vk:hover {
  box-shadow: 0 6px 18px rgba(76, 117, 163, 0.42);
}

.site-header-icon--wa {
  background-color: #128c7e;
}

.site-header-icon--wa:hover {
  box-shadow: 0 6px 18px rgba(18, 140, 126, 0.42);
}

.site-header-icon--account {
  background-color: var(--vik-coral);
  box-shadow: 0 2px 10px rgba(255, 133, 98, 0.45);
}

.site-header-icon--account:hover {
  background-color: #ff7043;
  box-shadow: 0 8px 22px rgba(255, 112, 67, 0.55);
  filter: brightness(1.06);
}

.site-header-cart-btn {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 6.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(15, 23, 42, 0.14);
  background-color: rgba(255, 255, 255, 0.92);
  padding: 0.4375rem 0.875rem;
  font-family: var(--font-display, inherit);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--vik-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-header-cart-btn:hover {
  border-color: rgba(255, 133, 98, 0.45);
  background-color: rgba(255, 133, 98, 0.08);
  color: var(--vik-ink);
}

.site-header-cart-icon {
  height: 1.125rem;
  width: 1.125rem;
  flex-shrink: 0;
}

.site-header-cart-label {
  white-space: nowrap;
}

.site-header-cart-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  display: inline-flex;
  height: 1.25rem;
  min-width: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--vik-coral);
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.site-header-cart-badge.hidden {
  display: none;
}

.site-header-hours {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
  color: #64748b;
  border-bottom: 2px solid rgba(255, 133, 98, 0.55);
  padding-bottom: 0.125rem;
}

.site-header-city-toggle {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--vik-coral);
  transition: color 0.15s ease;
}

.site-header-city-toggle::-webkit-details-marker {
  display: none;
}

.site-header-city-toggle:hover {
  color: #e86a4a;
}

.site-header-city-menu {
  position: absolute;
  right: 0;
  left: auto;
  z-index: 40;
  margin-top: 0.375rem;
  width: 16rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.site-header-city-group {
  padding: 0.375rem 0.5rem 0.125rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.site-header-city-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-header-city-option:hover {
  background-color: #f8fafc;
  color: var(--vik-coral);
}

.site-header-city-option.is-active {
  background-color: rgba(255, 133, 98, 0.1);
  color: var(--vik-ink);
}

.site-header-brand {
  justify-self: start;
}

.site-header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header-phone-main {
  font-family: var(--font-display, inherit);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--vik-ink);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.site-header-phone-main:hover {
  color: var(--vik-coral);
}

@media (min-width: 640px) {
  .site-header-phone-main {
    font-size: 1.25rem;
  }
}

.site-header-mobile {
  display: none;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  padding: 0.75rem 0 0.5rem;
}

.site-header-mobile.is-open {
  display: block;
}

/* Устаревшие классы — совместимость тестов/фрагментов */
.site-header-contacts {
  max-width: 13rem;
}

.site-header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--vik-ink);
  transition: color 0.15s ease;
}

.site-header-phone:hover {
  color: var(--vik-coral);
}

.site-header-phone svg {
  flex-shrink: 0;
  color: var(--vik-coral);
}

.site-header-address {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
  color: #64748b;
}

.site-header-vikon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.15s ease;
}

.site-header-vikon:hover {
  color: var(--vik-coral);
  text-decoration: underline;
}

/* Цена при отсутствии товара — серая (не зачёркнутая: line-through = скидка). */
.price-unavailable {
  color: #94a3b8;
}

.image-promo-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border-radius: 9999px;
  padding: 0.3125rem 0.625rem;
  font-family: var(--font-display, inherit);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}

.image-promo-badge.promo-best {
  background: linear-gradient(135deg, #ff8562 0%, #ff7043 100%);
  color: #ffffff;
}

.image-promo-badge.promo-deal {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.image-promo-badge.promo-new {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.image-promo-badge.promo-hit {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.vik-storefront header .site-header-logo {
  display: block;
  height: 2.25rem;
  width: auto;
  max-width: min(100%, 9rem);
  object-fit: contain;
}

@media (min-width: 640px) {
  .vik-storefront header .site-header-logo {
    height: 3.25rem;
    max-width: min(100%, 16rem);
  }
}

/* Карточка-группа: выбранный вариант (коралл Vik-on, без конфликта utility-классов). */
.vik-storefront .variant-opt.is-active {
  border-color: var(--vik-coral);
  background-color: rgba(255, 133, 98, 0.14);
  color: var(--vik-ink);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 133, 98, 0.28);
}

.vik-storefront .variant-opt.is-active:hover {
  border-color: var(--vik-coral);
  color: var(--vik-ink);
}

.bg-grid {
  background-color: #ffffff;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(255, 133, 98, 0.08), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(21, 19, 19, 0.03), transparent 40%),
    url("../img/vik-circuit-bg.eec172e39696.svg"),
    linear-gradient(to right, rgba(147, 197, 253, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(147, 197, 253, 0.28) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 420px 420px, 2.5rem 2.5rem, 2.5rem 2.5rem;
  background-position: center, center, center top, center, center;
}

/* Vik-on: фон всей витрины — та же «PCB»-сетка, что в hero, но мягче. */
body.vik-storefront {
  background-color: #f7f9fc;
}

body.vik-storefront::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #f7f9fc;
  background-image:
    radial-gradient(circle at 18% 0%, rgba(255, 133, 98, 0.06), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(21, 19, 19, 0.025), transparent 38%),
    url("../img/vik-circuit-bg.eec172e39696.svg"),
    linear-gradient(to right, rgba(147, 197, 253, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(147, 197, 253, 0.22) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 420px 420px, 2.5rem 2.5rem, 2.5rem 2.5rem;
  background-position: center, center, center top, center, center;
  opacity: 0.72;
}

/* Hero и крупные блоки — контрастнее, полоски заметнее. */
/* Hero: CTA на голубом PCB-фоне — slate/ink, без коралла (лучше сочетается с сеткой). */
.hero-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 1rem;
  background-color: #1e293b;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-display, inherit);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hero-cta-primary:hover {
  background-color: #0f172a;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
  color: #ffffff;
}

.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  border: 1.5px solid rgba(51, 65, 85, 0.28);
  background-color: rgba(255, 255, 255, 0.88);
  padding: 0.875rem 1.75rem;
  font-family: var(--font-display, inherit);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: #334155;
  backdrop-filter: blur(4px);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hero-cta-secondary:hover {
  border-color: rgba(51, 65, 85, 0.45);
  background-color: #ffffff;
  color: #0f172a;
}

.bg-grid-hero {
  background-color: #e6eef8;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 133, 98, 0.14), transparent 48%),
    radial-gradient(circle at 92% 22%, rgba(21, 19, 19, 0.05), transparent 42%),
    url("../img/vik-circuit-bg.eec172e39696.svg"),
    linear-gradient(to right, rgba(96, 165, 250, 0.38) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(96, 165, 250, 0.38) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 420px 420px, 2.5rem 2.5rem, 2.5rem 2.5rem;
  background-position: center, center, center top, center, center;
}

/* Витрина Vik-on: кольцо фокуса и выделение текста в коралловых тонах. */
.vik-storefront :focus-visible {
  outline: 2px solid var(--vik-coral);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

.vik-storefront ::selection {
  background: var(--vik-coral);
  color: #ffffff;
}

/* Кабинет и прочие поверхности без vik-storefront — прежний фиолетовый фокус. */
:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

::selection {
  background: var(--brand-500);
  color: #ffffff;
}

/* Подсветка незаполненного/ошибочного поля формы (клиентская и серверная валидация). */
.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.55) !important;
}

/* Страницы ошибок (404, 403, 400) */
.error-page-code {
  font-size: clamp(4rem, 18vw, 7rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
