/* ===== Переменные ===== */
:root {
  --gutter: 15%;
  --gradient: linear-gradient(to right, #FF9100, #FF3C00);

  /* Тёмная тема (по умолчанию) */
  --c-bg: linear-gradient(to right, #200b00, #250b00);
  --c-text: #fff;
  --c-text-2: #ddd;
  --c-muted: #808080;
  --c-muted2: #9f9f9f;
  --c-faint: #5c4a40;
  --c-surface: #1a0700;
  --c-surface2: #200b00;
  --c-border: #3a1a0a;
  color-scheme: dark;
}

/* Светлая тема: меняем только переменные */
html[data-theme="light"] {
  --c-bg: linear-gradient(to right, #ffe8d3, #ffdcc0);
  --c-text: #2a1408;
  --c-text-2: #3a2418;
  --c-muted: #7a6050;
  --c-muted2: #664d3d;
  --c-faint: #b59580;
  --c-surface: #ffeedd;
  --c-surface2: #ffe0c6;
  --c-border: #f0bd92;
  color-scheme: light;
}

/* Кнопка переключения темы в шапке */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #FF9100;
  border-radius: 50%;
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: var(--gradient);
}

.theme-toggle_icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c-text);
  box-shadow: inset -5px -3px 0 0 var(--c-surface);
}

html[data-theme="light"] .theme-toggle_icon {
  background: #f5a623;
  box-shadow: 0 0 0 3px #ffe2b8;
}

.theme-toggle_text {
  display: none;
}



/* ===== Сброс стилей ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  user-select: none;
  box-sizing: border-box;
}



/* ===== Базовые стили ===== */
html,
body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 20px;
  color: var(--c-text);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-bg);
}

a {
  color: var(--c-text);
  text-decoration: none;
}

li {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}

img {
  max-width: 100%;
}



/* ===== Обертка: шапка, контент и подвал в колонку, подвал всегда внизу ===== */
.wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.content {
  flex: 1;
  padding-inline: var(--gutter);
}



/* ===== Шапка ===== */
.header-body {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
}

.logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(to right, #FF9100, #FF3C00);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back {
  width: 40px;
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #FF9100;
  border-radius: 50%;
  transition: background 0.2s;
}

.back svg {
  width: 26px;
  height: 26px;
  fill: var(--c-text);
}

.back:hover {
  background: var(--gradient);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.log-in {
  padding: 10px 45px;
  color: #fff;
  background: var(--gradient);
  border-radius: 50px;
}

.order {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  border-radius: 50%;
}



/* ===== Главная секция ===== */
#home {
  min-height: calc(100vh - 100px);
  min-height: calc(100dvh - 100px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.home-body {
  flex: 0 1 45%;
  min-width: 0;
}

.home-title {
  font-size: clamp(40px, 4.2vw, 60px);
  font-weight: bold;
}

.home-title span:nth-child(1) {
  display: block;
}

.home-title svg {
  width: 0.85em;
  height: 0.85em;
  vertical-align: middle;
}

.home-text {
  color: var(--c-muted);
  font-size: 20px;
  margin-top: 20px;
}

.home-text span {
  color: var(--c-text);
}

.home-img {
  flex: 0 1 50%;
  min-width: 0;
  max-width: 630px;
}

.home-img img {
  display: block;
  width: 100%;
  height: auto;
}



/* ===== Меню ===== */
#menu {
  padding-top: clamp(60px, 10vw, 150px);
  padding-bottom: clamp(60px, 8vw, 120px);
}

.menu-title {
  display: flex;
  justify-content: center;
  font-size: 40px;
  font-weight: bold;
  margin-bottom: 30px;
}

/* Табы прокручиваются по горизонтали, если не помещаются (телефоны) */
.menu-nav {
  position: relative;
  display: flex;
  margin-bottom: 30px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 0 5px #FF9100;
  border-radius: 50px;
}

.menu-nav::-webkit-scrollbar {
  display: none;
}

/* Подсветка активного таба: положение и ширину ставит JS по самому табу */
.menu-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--indicator-left, 0);
  width: var(--indicator-width, 0);
  height: 100%;
  background: var(--gradient);
  border-radius: 50px;
  z-index: -1;
  transition: left 0.3s, width 0.3s;
}

.menu-nav_item {
  flex: 1 0 auto;
  padding: 15px 24px;
  font-size: 20px;
  text-align: center;
  white-space: nowrap;
  color: var(--c-muted);
  border-radius: 50px;
  transition: color 0.1s;
}

.menu-nav_item:hover {
  color: var(--c-text);
}

.menu-nav_item.active {
  color: #fff;
}

.menu-list {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 2vw, 32px);
}

.menu-list.active {
  display: grid;
}

.menu-list_item {
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 10px #FF9100;
  cursor: pointer;
  border-radius: 20px;
  transition: transform 0.15s ease;
}

@media (hover: hover) {
  .menu-list_item:hover {
    transform: scale(1.02);
  }
}

/* Единое соотношение сторон: фото разного размера не сдвигают карточки */
.menu-list_item-img img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Тело карточки растягивается, цена прижимается к низу */
.menu-list_item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-list_item-title {
  font-size: 22px;
  font-weight: bold;
  margin: 10px 0;
}

.menu-list_item-text {
  color: var(--c-muted2);
  font-size: 17px;
  margin-bottom: 15px;
}

.menu-list_item-price {
  margin-top: auto;
}



/* ===== Подвал ===== */
#footer {
  padding-block: 30px;
  background: var(--c-surface);
  box-shadow: 0 0 10px #FF9100;
}

.footer-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-inline: var(--gutter);
  color: var(--c-muted);
  font-size: 20px;
}

.footer-body_legal {
  display: flex;
  align-items: center;
  gap: 25px;
}

.footer-body_legal span:nth-child(1) {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(to right, #FF9100, #FF3C00);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-body_legal span:nth-child(2) {
  margin-top: 8px;
  letter-spacing: 1px;
}

.footer-body_social {
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer-body_social a {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--gradient);
  border-radius: 50%;
}

.footer-body_social a svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}



/* ===== Выбор города ===== */

.city {
  position: relative;
}

.city-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 18px;
  border: 1px solid #FF9100;
  border-radius: 50px;
}

.city-btn_arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #FF9100;
  transition: transform 0.2s;
}

.city-btn[aria-expanded="true"] .city-btn_arrow {
  transform: rotate(180deg);
}

.city-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
  background: var(--c-surface);
  border-radius: 16px;
  box-shadow: 0 0 10px #FF9100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.city-list.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.city-list_item {
  padding: 10px 20px;
  color: var(--c-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.1s, background 0.2s;
}

.city-list_item:hover,
.city-list_item.active {
  color: var(--c-text);
}

.city-list_item.active {
  background: rgba(255, 145, 0, 0.12);
}



/* ===== Способ получения ===== */

.delivery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}

.delivery-switch {
  display: flex;
  padding: 5px;
  border-radius: 50px;
  box-shadow: 0 0 5px #FF9100;
}

.delivery-switch_item {
  padding: 12px 36px;
  color: var(--c-muted);
  border-radius: 50px;
  transition: color 0.2s, background 0.3s;
}

.delivery-switch_item.active {
  color: #fff;
  background: var(--gradient);
}

.delivery-switch_item:hover:not(.active) {
  color: var(--c-text);
}

.delivery-info {
  color: var(--c-muted2);
  font-size: 18px;
  text-align: center;
}



/* ===== Окно входа и регистрации ===== */

body.no-scroll {
  overflow: hidden;
}

/* Глобально user-select выключен, в полях ввода его нужно вернуть */
input {
  user-select: text;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 3, 0, 0.75);
}

.modal-box {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 36px 32px 28px;
  background: var(--c-surface);
  border-radius: 24px;
  box-shadow: 0 0 14px #FF9100;
  transform: translateY(12px);
  transition: transform 0.25s;
  scrollbar-width: none;
}

.modal-box::-webkit-scrollbar {
  display: none;
}

.modal.open .modal-box {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 30px;
  line-height: 1;
  color: var(--c-muted);
}

.modal-close:hover {
  color: var(--c-text);
}

.auth-tabs {
  display: flex;
  padding: 5px;
  margin-bottom: 24px;
  border-radius: 50px;
  box-shadow: 0 0 5px #FF9100;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  color: var(--c-muted);
  border-radius: 50px;
  transition: color 0.2s, background 0.3s;
}

.auth-tab.active {
  color: #fff;
  background: var(--gradient);
}

.auth-title {
  margin-bottom: 24px;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 16px;
  color: var(--c-muted2);
}

.field-control {
  position: relative;
}

.field-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  color: var(--c-text);
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-control .field-input {
  padding-right: 100px;
}

.field-input::placeholder {
  color: var(--c-faint);
}

.field-input:focus {
  border-color: #FF9100;
  box-shadow: 0 0 0 3px rgba(255, 145, 0, 0.2);
}

.field-input[aria-invalid="true"] {
  border-color: #ff5252;
}

.field-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  translate: 0 -50%;
  padding: 6px 10px;
  font-size: 14px;
  color: #FF9100;
  border-radius: 50px;
}

.field-toggle:hover {
  background: rgba(255, 145, 0, 0.12);
}

.field-error {
  min-height: 18px;
  font-size: 14px;
  color: #ff6b6b;
}

.field-error_block {
  margin-top: -10px;
}

/* Индикатор сложности пароля: три полоски */
.strength {
  display: flex;
  gap: 6px;
}

.strength span {
  flex: 1;
  height: 4px;
  background: var(--c-border);
  border-radius: 4px;
  transition: background 0.2s;
}

.strength[data-level="1"] span:nth-child(1) {
  background: #ff5252;
}

.strength[data-level="2"] span:nth-child(-n+2) {
  background: #FF9100;
}

.strength[data-level="3"] span {
  background: #7cb342;
}

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--c-muted2);
  cursor: pointer;
}

.field-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #FF9100;
}

.auth-submit {
  margin-top: 6px;
  padding: 14px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  background: var(--gradient);
  border-radius: 50px;
  transition: opacity 0.2s;
}

.auth-submit:hover {
  opacity: 0.9;
}

.auth-switch {
  font-size: 15px;
  color: var(--c-muted2);
  text-align: center;
}

.auth-link {
  font-size: 15px;
  color: #FF9100;
  text-decoration: underline;
}

.auth-notice {
  font-size: 15px;
  color: var(--c-muted2);
  text-align: center;
}

.auth-notice.success {
  color: #7cb342;
}



/* ===== Корзина и окно товара ===== */

.order {
  position: relative;
}

.order-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #FF3C00;
  background: #fff;
  border-radius: 50px;
}

.order-count[hidden] {
  display: none;
}

.modal-box_wide {
  width: min(560px, 100%);
}

.product-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
}

.product-img {
  flex: none;
  width: 150px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
}

.product-head .auth-title {
  margin-bottom: 8px;
  font-size: 24px;
  text-align: left;
}

.product-desc {
  font-size: 15px;
  color: var(--c-muted2);
}

.product-section {
  margin-top: 18px;
}

.product-label {
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--c-muted2);
}

.product-label span {
  font-size: 13px;
  color: var(--c-faint);
}

.size-switch {
  display: flex;
  padding: 5px;
  border-radius: 50px;
  box-shadow: 0 0 5px #FF9100;
}

.size-switch_item {
  flex: 1;
  padding: 10px 0;
  color: var(--c-muted);
  border-radius: 50px;
  transition: color 0.2s, background 0.3s;
}

.size-switch_item.active {
  color: #fff;
  background: var(--gradient);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 16px;
  color: var(--c-text-2);
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.option:has(input:checked) {
  border-color: #FF9100;
}

.option input {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: #FF9100;
}

.option b {
  margin-left: auto;
  font-size: 15px;
  font-weight: normal;
  color: #FF9100;
  white-space: nowrap;
}

.qty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty button {
  width: 40px;
  height: 40px;
  font-size: 22px;
  color: #fff;
  background: var(--gradient);
  border-radius: 50%;
}

.qty button:disabled {
  opacity: 0.4;
}

.qty-value {
  min-width: 24px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.product-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-total,
.cart-total {
  font-size: 22px;
  font-weight: bold;
}

.product-submit {
  margin-top: 0;
  padding: 14px 28px;
}

.cart-list {
  max-height: 50dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.cart-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 16px;
}

.cart-line_main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--c-text);
}

.cart-line_main img {
  flex: none;
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-line_info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cart-line_name {
  font-size: 16px;
  font-weight: bold;
}

.cart-line_meta {
  font-size: 13px;
  color: var(--c-muted2);
}

.cart-line_price {
  margin-top: 2px;
  font-size: 15px;
  color: #FF9100;
}

.cart-line .qty {
  gap: 8px;
}

.cart-line .qty button {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.cart-line_remove {
  padding: 0 6px;
  font-size: 24px;
  color: var(--c-muted);
}

.cart-line_remove:hover {
  color: #ff6b6b;
}

.cart-empty {
  padding: 20px 0;
  text-align: center;
  color: var(--c-muted2);
}

.cart-footer {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-footer .auth-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  color: var(--c-muted2);
}

.cart-footer .auth-notice {
  min-height: 0;
}



/* ===== Адаптивность ===== */
@media (max-width: 1700px) {
  :root {
    --gutter: 10%;
  }
}

@media (max-width: 1200px) {
  .menu-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  :root {
    --gutter: 4%;
  }
}

@media (max-width: 860px) {
  .menu-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #home {
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding-block: 40px;
  }

  .home-body,
  .home-img {
    flex: none;
    width: 100%;
    max-width: none;
  }

  .home-img img {
    max-width: 420px;
    margin: 0 auto;
  }

  .menu-title {
    font-size: 32px;
  }

  .menu-nav_item {
    font-size: 18px;
    padding: 12px 18px;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  .header-actions {
    gap: 10px;
  }

  .city-btn {
    padding: 8px 12px;
    font-size: 15px;
  }

  .delivery-switch_item {
    padding: 10px 22px;
    font-size: 17px;
  }

  .delivery-info {
    font-size: 16px;
  }

  /* Шапка: все элементы помещаются в одну строку, при нехватке места переносятся */
  .header-body {
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    padding-block: 14px;
  }

  .header-start {
    gap: 10px;
  }

  .logo {
    font-size: 22px;
  }

  .back {
    width: 36px;
    height: 36px;
  }

  .back svg {
    width: 22px;
    height: 22px;
  }

  .header-actions {
    gap: 8px;
    margin-left: auto;
  }

  .city-btn {
    gap: 6px;
    padding: 6px 10px;
    font-size: 14px;
  }

  .log-in {
    padding: 7px 14px;
    font-size: 16px;
  }

  .order {
    width: 36px;
    height: 36px;
  }

  .order img {
    width: 18px;
    height: 18px;
  }

  /* Модальные окна занимают почти всю ширину */
  .modal-box {
    padding: 28px 18px 22px;
  }

  .auth-title {
    font-size: 24px;
  }

  .home-text {
    font-size: 17px;
  }

  .footer-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-body_legal {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .menu-list {
    grid-template-columns: 1fr;
  }

  .product-head {
    flex-direction: column;
  }

  .product-img {
    width: 100%;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-submit {
    width: 100%;
  }
}

/* Очень узкие экраны (небольшие телефоны) */
@media (max-width: 380px) {
  .logo {
    font-size: 19px;
  }

  .city-btn {
    padding: 6px 8px;
    font-size: 13px;
  }

  .log-in {
    padding: 6px 10px;
    font-size: 14px;
  }

  .menu-nav_item {
    padding: 10px 14px;
    font-size: 16px;
  }

  .home-title {
    font-size: 34px;
  }

  .delivery-switch_item {
    padding: 9px 16px;
    font-size: 16px;
  }
}

/* Кнопка темы на телефонах чуть меньше */
@media (max-width: 600px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
}
