/* Дополнительные общие стили сайта. Подключаются на всех страницах. */
:focus-visible {
  outline: 3px solid rgba(56, 189, 248, .85);
  outline-offset: 3px;
}

html { scroll-behavior: smooth; }
body.nav-open { overflow: hidden; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #f8fafc;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.breadcrumbs {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  color: #cbd5e1;
  font-size: 14px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 8px;
  color: #64748b;
}

.breadcrumbs a { text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs [aria-current="page"] { color: #f8fafc; }

.catalog-tools {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}

.catalog-search {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(15,23,42,.72);
  color: #f8fafc;
  font: inherit;
}

.catalog-search::placeholder { color: #94a3b8; }
.catalog-filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-filter-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #e2e8f0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.catalog-filter-button.is-active {
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.5);
  color: #dcfce7;
}
.catalog-result { color: #cbd5e1; font-size: 14px; }
.product[hidden], .products[hidden] { display: none !important; }

.form-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.rating-field { display: grid; gap: 7px; }
.rating-field label { font-weight: 700; }
.rating-select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: #111827;
  color: #f8fafc;
  font: inherit;
}

.site-status {
  margin-top: 10px;
  min-height: 24px;
  color: #cbd5e1;
}
.site-status.is-success { color: #bbf7d0; }
.site-status.is-error { color: #fecaca; }



@media (max-width: 820px) {
  .header { position: sticky !important; top: 0; }
  .header-inner { min-height: 64px !important; flex-wrap: nowrap !important; align-items: center !important; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header .nav {
    position: fixed;
    inset: 65px 12px auto 12px;
    z-index: 1000;
    display: none !important;
    max-height: calc(100vh - 82px);
    overflow-y: auto;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: rgba(8,12,22,.98);
    box-shadow: 0 22px 60px rgba(0,0,0,.45);
  }
  .header .nav.is-open {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .header .nav a,
  .header .nav .btn {
    width: 100% !important;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }
  .brand span:last-child { display: inline !important; font-size: 14px; }

  /* На товарных страницах сначала показываем название и кнопки, затем фотографии. */
  .product-page-layout { display: flex !important; flex-direction: column !important; }
  .product-page-layout > .card:nth-child(2) { order: -1; }

  .breadcrumbs { margin-top: 12px; }
}

@media (max-width: 520px) {
  .brand span:last-child { max-width: 150px; line-height: 1.15; }
  .catalog-filter-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .catalog-filter-button { border-radius: 12px; }
  .breadcrumbs { width: min(100% - 24px, 1180px); font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Исправление пропорций изображений после добавления HTML-атрибутов width/height. */
img {
  height: auto;
}

.product-image img,
.thumb-card img {
  height: auto;
}

.product-page-layout > .card {
  align-self: start;
}

.product-page-layout .media-layout,
.product-page-layout .thumb-column {
  align-items: start;
}


/* Персональные данные, юридические ссылки и согласие на аналитику. */
.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.45;
}

.legal-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: #22c55e;
}

.legal-consent a,
.site-legal-footer a,
.legal-page a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-legal-footer {
  padding-top: 14px;
  padding-bottom: 14px;
  color: #cbd5e1;
  font-size: 13px;
}

.site-legal-footer__details,
.site-legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
}

.analytics-consent {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 5000;
  color: #f8fafc;
}

.analytics-consent__inner {
  width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(8,12,22,.98);
  box-shadow: 0 20px 60px rgba(0,0,0,.48);
}

.analytics-consent__text {
  display: grid;
  gap: 5px;
  color: #cbd5e1;
  font-size: 14px;
}
.analytics-consent__text strong { color: #f8fafc; font-size: 15px; }
.analytics-consent__text a { text-decoration: underline; text-underline-offset: 3px; }
.analytics-consent__actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.analytics-consent__actions button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.16);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.analytics-consent__actions [data-analytics-decline] { background: rgba(255,255,255,.06); color: #f8fafc; }
.analytics-consent__actions [data-analytics-accept] { background: #16a34a; color: #fff; border-color: #16a34a; }

.legal-page { padding: 34px 0 54px; }
.legal-page__hero { margin-bottom: 18px; }
.legal-page__hero h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 44px); }
.legal-page__hero p { margin: 0; color: #cbd5e1; }
.legal-page .card { margin-top: 14px; }
.legal-page h2 { margin: 0 0 10px; font-size: 22px; }
.legal-page h3 { margin: 18px 0 8px; font-size: 17px; }
.legal-page p, .legal-page li { color: #cbd5e1; }
.legal-page ul, .legal-page ol { padding-left: 22px; }
.legal-page .legal-muted { color: #94a3b8; font-size: 13px; }
.legal-page .legal-highlight {
  padding: 12px 14px;
  border-left: 3px solid #22c55e;
  background: rgba(34,197,94,.08);
  border-radius: 10px;
}

@media (max-width: 720px) {
  .analytics-consent { left: 8px; right: 8px; bottom: 8px; }
  .analytics-consent__inner { align-items: stretch; flex-direction: column; }
  .analytics-consent__actions { display: grid; grid-template-columns: 1fr; }
  .analytics-consent__actions .btn { width: 100%; }
}
