/* base.css — каркас страниц. Все значения — из tokens.css (T-611): литералов цвета,
 * отступов, радиусов, теней и размеров текста здесь нет. */

@supports (-webkit-overflow-scrolling: touch) {
  .header {
    font-display: swap;
    position: -webkit-sticky;
    position: sticky;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    color var(--duration-base) ease-in-out,
    background-color var(--duration-base) ease-in-out,
    border-color var(--duration-base) ease-in-out,
    box-shadow var(--duration-base) ease-in-out,
    fill var(--duration-base) ease-in-out;
}

body,
html {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: default;
  font-family: var(--font-sans);
  line-height: var(--lh-relaxed);
  opacity: 1;
  overflow-x: hidden;
  scroll-behavior: smooth;
  transition: opacity var(--duration-slow) ease-in-out;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  cursor: text;
  user-select: text;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  padding: var(--space-1) 0;
}

p {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  padding: var(--space-3) 0;
}

a {
  font-family: var(--font-sans);
}

:is(
    .tab-btn,
    .checkout-btn,
    .btn,
    .modal-trigger,
    .mobile-menu-btn,
    .nav a,
    .menu-minimal-modal-close
  ):focus-visible {
  box-shadow: var(--shadow-focus);
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

:is(input, textarea, select):focus-visible {
  border-color: var(--color-focus-ring);
  box-shadow: var(--shadow-focus);
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translate(0);
  }
  to {
    opacity: 1;
    transform: translate(0);
  }
}

.mobile-menu-btn {
  background: none;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 20px;
  justify-content: space-between;
  margin-left: var(--space-4);
  position: relative;
  width: 22px;
  z-index: 1001;
}

.burger-line {
  background-color: var(--color-on-header);
  border-radius: var(--radius-xs);
  display: block;
  height: 4px;
  transition: all var(--duration-slow) ease;
  width: 100%;
}

.mobile-menu-btn.active .burger-line:first-child {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active .burger-line:nth-child(2) {
  opacity: 0;
  transform: rotate(-45deg);
}

.mobile-menu-btn.active .burger-line:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

@media (min-width: 1250px) {
  .mobile-menu-btn {
    display: none;
  }
}

@media (max-width: 1250px) {
  .mobile-menu-btn {
    display: flex;
  }
}

.container {
  margin: auto;
  width: 80%;
  padding-bottom: var(--inset-container-bottom);
}

.section {
  padding: 0;
}

.section-header {
  margin: calc(var(--space-8) * 2.5) 0;
  text-align: center;
}

.section-header h2 {
  color: var(--color-accent-text);
  font-size: var(--text-3xl);
  margin: var(--space-2);
}

.section-header p {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: var(--space-6);
}

.section-header-menu {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  min-height: 72px;
  margin: auto;
  padding: calc(var(--space-6) * 2) var(--gutter-header) 0;
  position: relative;
  height: auto;
}

.section-header-menu h2 {
  animation: fadeInDown var(--duration-slower) ease;
  color: var(--color-text);
  font-size: var(--text-3xl);
  line-height: var(--lh-tight);
  margin: 0;
  padding-top: 0;
}

.header {
  background-color: var(--color-header-bg);
  box-shadow: var(--shadow-xs);
  left: 0;
  position: fixed;
  top: 0;
  transition: all var(--duration-base) ease;
  width: 100%;
  z-index: 1000;
}

.header-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 var(--gutter-header);
}

.image {
  height: auto;
  max-width: 100%;
  object-fit: contain;
  width: 100vw;
}

.logo a {
  align-items: center;
  animation: slideInFromLeft var(--duration-slower) ease-out;
  color: var(--color-header-accent);
  display: flex;
  font-family: var(--font-sans);
  font-size: var(--text-4xl);
  font-weight: 700;
  height: var(--size-header);
  text-decoration: none;
}

.nav {
  font-size: var(--text-lg);
  transition:
    transform var(--duration-base) ease,
    opacity var(--duration-base) ease;
}

.nav ul {
  display: flex;
  list-style: none;
  margin: 0;
}

.nav ul li {
  justify-content: center;
  margin: 0 calc(var(--space-6) * 2);
  text-align: center;
}

.nav ul li a {
  color: var(--color-on-header);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration-slower) ease;
}

.nav ul li a:hover {
  color: var(--color-header-accent);
}

.phone a {
  color: var(--color-on-header);
  font-size: var(--text-xl);
  font-weight: 500;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* Скрыто визуально, но доступно скринридеру (cleanmenu css/a11y.css) */
.sr-only {
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.flex,
.visible {
  display: flex !important;
}

.inline {
  display: inline !important;
}

.footer-bottom {
  border-top: 1px solid var(--color-border-subtle);
  text-align: center;
}

@media (max-width: 1250px) {
  .header-inner {
    padding: 0 var(--gutter-header-narrow);
  }

  .container {
    margin: auto;
    width: 85%;
  }

  p {
    font-size: var(--text-md);
  }

  .section-header {
    margin: calc(var(--space-8) + var(--space-2)) 0;
  }

  .section-header p {
    font-size: var(--text-lg);
    margin: var(--space-2);
  }

  .nav {
    align-items: center;
    background: var(--color-header-menu-bg);
    display: none;
    flex-direction: column;
    font-size: var(--text-lg);
    height: auto;
    left: 0;
    padding: var(--space-2);
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
  }

  .nav.active {
    display: flex;
    padding: var(--space-4) 0;
  }

  .nav ul {
    flex-direction: column;
  }

  .nav ul li {
    margin: var(--space-2) auto;
    text-align: center;
    width: fit-content;
  }

  .phone a {
    font-size: var(--text-md);
  }

  .section-header h2 {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 992px) {
  .container {
    margin: auto;
    width: 90%;
  }

  p {
    font-size: var(--text-base);
  }
}

@media (max-width: 768px) {
  .container {
    margin: auto;
    width: 100%;
  }
}

@media (max-width: 470px) {
  p {
    margin-bottom: var(--space-2);
    padding: var(--space-1) var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  html {
    scroll-behavior: auto;
  }
}

body {
  opacity: 1;
}

body.menu-catalog-page.font-serif,
.font-serif {
  --font-sans: Georgia, "Times New Roman", "Noto Serif", serif;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
}

body.menu-catalog-page.font-rounded,
.font-rounded {
  --font-sans: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
}

body.menu-catalog-page.font-mono,
.font-mono {
  --font-sans: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
