:root {
  --bg-dark: #0f0f13;
  --bg-darker: #08080b;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;

  --accent-neon: #00f0ff;
  --accent-neon-dark: #00a8b5;
  --accent-neon-transparent: rgba(0, 240, 255, 0.15);
  --accent-gradient: linear-gradient(135deg, #00f0ff 0%, #0084ff 100%);
  --accent-gradient-hover: linear-gradient(135deg, #00d4e0 0%, #0072cc 100%);

  --card-bg: rgba(26, 26, 35, 0.6);
  --card-border: rgba(37, 37, 51, 0.4);
  --image-bg: #21212b;

  --header-height: 70px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

  --error-color: #ff4d4d;
  --success-color: #4dff4d;
  --warning-color: #ffcc00;
  --danger-color: #ff4444;
  --info-color: #00a8b5;

  --border-radius: 16px;
  --border-radius-sm: 8px;

  --box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  --box-shadow-neon: 0 0 20px rgba(0, 240, 255, 0.3);

  --glass-bg: rgba(15, 15, 19, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
}


/* ===== GLOBAL RESET ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
  min-width: 320px;
  position: relative;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* В Telegram Mini App (только мобильный) — полоса-отступ, зазор и парящий блок со скруглением */
html.tg-webapp-mobile body {
  padding-top: var(--tg-content-inset-top, 80px);
  display: flex;
  flex-direction: column;
  background-color: #0f0f13;
}
html.tg-webapp-mobile header {
  position: static;
  top: auto;
  inset: auto;
}
/* Верхняя тёмная полоса растянута до хедера без зазора */
#tg-top-bar {
  position: fixed;
  top: calc(-1 * env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  width: 100%;
  min-height: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px) + env(safe-area-inset-top, 0px));
  height: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px) + env(safe-area-inset-top, 0px));
  background-color: #0f0f13 !important;
  background-image: none !important;
  z-index: 9999;
  pointer-events: none;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
html.tg-webapp-mobile body::before {
  content: '';
  position: fixed;
  top: calc(-1 * env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  width: 100%;
  min-height: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px) + env(safe-area-inset-top, 0px));
  height: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px) + env(safe-area-inset-top, 0px));
  background: #0f0f13 !important;
  background-color: #0f0f13 !important;
  background-image: none !important;
  z-index: 9998;
  flex-shrink: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  isolation: isolate;
  transform: translateZ(0);
}
html.tg-webapp-mobile body .tg-app-content {
  margin-top: var(--tg-app-gap, 16px);
  border-radius: var(--tg-app-radius, 24px) var(--tg-app-radius, 24px) 0 0;
  overflow: hidden;
  background: var(--bg-dark);
  flex: 1;
  min-height: 0;
}
/* В Telegram шапка в потоке — убираем отступы под «фиксированную» шапку у секций */
html.tg-webapp-mobile .hero,
html.tg-webapp-mobile section.catalog,
html.tg-webapp-mobile .wheel-hero,
html.tg-webapp-mobile .main-content,
html.tg-webapp-mobile .promotions,
html.tg-webapp-mobile .reviews-faq {
  margin-top: 0;
}
html.tg-webapp-mobile .checkout-container {
  margin-top: 1.5rem;
}
html.tg-webapp-mobile .km-product-page {
  padding-top: 1.25rem;
}

/* Глобальный лок для модалок (корзина/вкусы и т.п.) */
html.km-modal-open,
body.km-modal-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
}

/* ===== HEADER ===== */

header {
  background: var(--glass-bg);
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.header-scrolled {
  height: 60px;
  background: rgba(8, 8, 11, 0.95);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  transition: var(--transition);
  z-index: 1001;
}

.logo i {
  font-size: 1.6rem;
}

.logo:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav ul li a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 0.5rem 0;
  opacity: 0.9;
  transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--accent-neon);
  opacity: 1;
}

nav ul li a::after {
  content: '';
  position: absolute;
  inset: auto 0 -2px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
  width: 0;
  transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background: var(--accent-neon);
  border-radius: 3px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ===== CART ICON ===== */

.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: var(--transition);
  overflow: visible;
}

.cart-icon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(0, 240, 255, 0.55);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.cart-icon:hover {
  color: var(--accent-neon);
  background: var(--accent-neon-transparent);
  transform: translateY(-2px);
}

.cart-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent-neon);
  color: #000;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.cart-icon.cart-feedback {
  color: var(--accent-neon);
  animation: cart-icon-flash 0.72s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cart-icon.cart-feedback i {
  animation: cart-icon-jolt 0.72s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cart-icon.cart-feedback::after {
  animation: cart-icon-ring 0.72s ease-out;
}

.cart-counter.cart-feedback {
  animation: cart-counter-pop 0.72s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes cart-icon-flash {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(0, 240, 255, 0); }
  30% { transform: scale(1.12); box-shadow: 0 0 16px rgba(0, 240, 255, 0.45); }
  60% { transform: scale(0.96); box-shadow: 0 0 20px rgba(0, 240, 255, 0.35); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(0, 240, 255, 0); }
}

@keyframes cart-icon-jolt {
  0% { transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(-1px) rotate(-14deg); }
  56% { transform: translateY(-1px) rotate(12deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes cart-icon-ring {
  0% { opacity: 0.75; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes cart-counter-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  55% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-icon.cart-feedback,
  .cart-icon.cart-feedback i,
  .cart-icon.cart-feedback::after,
  .cart-counter.cart-feedback {
    animation: none !important;
  }
}

/* ===== SECTION TITLES (общие для каталога/профиля/акций и т.п.) ===== */

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5rem;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 4px;
}

/*
 * Подзаголовки секций
 *
 * На многих страницах (каталог, акции, профиль и даже главная) под основным
 * заголовком располагается краткое пояснение. Ранее стиль .section-subtitle
 * дублировался в каждом файловом модуле страниц. Теперь определяем его
 * один раз в главном CSS, чтобы избежать повторений и обеспечить
 * единообразие.
 */
.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
  line-height: 1.6;
}

/*
 * Адаптивные размеры заголовков и подзаголовков.
 *
 * На меньших экранах заголовки должны уменьшаться, чтобы оставаться
 * читабельными. Эти медиазапросы наследуют поведение из страниц
 * каталога и акций и теперь применяются глобально. При необходимости
 * страницы могут переопределить эти значения локально.
 */
@media (max-width: 600px) {
  .section-title {
    font-size: 1.8rem;
  }
  .section-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.6rem;
  }
}
/* ===== CTA BUTTON (Главная + Акции) ===== */
.go-to-catalog {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  background: var(--accent-gradient);
  color: #000;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  box-shadow: var(--box-shadow-neon);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.go-to-catalog::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
  transform: translateX(-100%);
  transition: .5s;
}

.go-to-catalog:hover {
  background: var(--accent-gradient-hover);
  box-shadow: 0 0 25px rgba(0, 240, 255, .6);
  transform: translateY(-3px);
}

.go-to-catalog:hover::before {
  transform: translateX(100%);
}
/* ===== LAYOUT WRAPPERS ===== */
.main-content {
  flex: 1 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* ===== FOOTER (общий) ===== */

footer {
  background: var(--bg-darker);
  padding: 5rem 5% 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--accent-gradient);
  opacity: 0.2;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.8rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
}

.footer-logo i {
  font-size: 2rem;
}

.footer-logo:hover {
  transform: scale(1.05);
}

.disclaimer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 1.5rem auto;
  line-height: 1.7;
  opacity: 0.7;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  opacity: 0.7;
}

.credits {
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.credits a {
  color: var(--accent-neon);
  text-decoration: none;
  transition: var(--transition);
}

.credits a:hover {
  text-decoration: underline;
}

/* ===== CART (общая модалка корзины) ===== */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-modal {
  position: fixed;
  inset: 0 0 0 auto;
  width: 100%;
  max-width: 420px;
  background: var(--bg-darker);
  border-left: 1px solid rgba(0, 240, 255, 0.1);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cart-modal.active {
  transform: translateX(0);
}

/* В Telegram (мобильный) — корзина поверх всего и с отступом сверху как у шапки */
html.tg-webapp-mobile .cart-overlay {
  z-index: 1100;
}
html.tg-webapp-mobile .cart-modal {
  z-index: 1101;
  top: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px));
  height: calc(100vh - (var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px)));
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-header h3 {
  font-size: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.close-cart {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition);
}

.close-cart:hover {
  background: var(--accent-neon-transparent);
  color: var(--accent-neon);
  transform: rotate(90deg);
}

.cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
}

.cart-empty i {
  font-size: 3.5rem;
  color: var(--accent-neon);
  opacity: 0.5;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.cart-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--card-border);
  border-radius: 8px;
  padding: 0.5rem;
}

.cart-item-details {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.cart-item-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.cart-item-price {
  color: var(--accent-neon);
  font-weight: 600;
  margin-bottom: 1rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.quantity-control {
  display: flex;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  background: var(--card-bg);
  overflow: hidden;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.quantity-btn:hover {
  background: var(--accent-neon-transparent);
  color: var(--accent-neon);
}

.quantity-value {
  min-width: 20px;
  text-align: center;
}

.remove-item {
  border: 0;
  background: none;
  color: #ff6b6b;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.remove-item:hover {
  color: var(--error-color);
  background: rgba(255, 107, 107, 0.1);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.cart-total span {
  color: var(--accent-neon);
  font-size: 1.2rem;
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--accent-gradient);
  border: 0;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
  transition: var(--transition);
}

.checkout-btn:hover {
  background: var(--accent-gradient-hover);
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.5);
  transform: translateY(-3px);
}

.checkout-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.cart-notification {
  position: fixed;
  left: 50%;
  bottom: -100px;
  transform: translateX(-50%);
  background: var(--bg-darker);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-left: 4px solid var(--accent-neon);
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transition: var(--transition);
  z-index: 1001;
  max-width: 90%;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cart-notification.show {
  bottom: 2rem;
  opacity: 1;
  pointer-events: auto;
}

.notification-close {
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: var(--transition);
  border-radius: 4px;
  padding: 0.3rem;
}

.notification-close:hover {
  color: var(--accent-neon);
  background: var(--accent-neon-transparent);
}

/* ===== RESPONSIVE NAVIGATION ===== */

@media (max-width: 1024px) {
  nav ul {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0 1.5rem;
  }

  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-darker);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2rem;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
    z-index: 999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  nav.active {
    transform: translateX(0);
  }

  /* В Telegram (мобильный) меню поверх контента; отступ сверху под хедер, чтобы «Главная» не уходила за хедер */
  html.tg-webapp-mobile nav {
    z-index: 1002;
    top: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px));
    height: calc(100vh - (var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px)));
    padding-top: calc(var(--header-height) + 2rem);
  }

  /* Хедер поверх меню, непрозрачный — контент при скролле не просвечивает */
  html.tg-webapp-mobile header {
    position: fixed;
    top: calc(var(--tg-content-inset-top, 80px) + var(--tg-app-gap, 16px));
    left: 0;
    right: 0;
    z-index: 1003;
    background: #0f0f13 !important;
    background-color: #0f0f13 !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  html.tg-webapp-mobile body .tg-app-content {
    padding-top: var(--header-height);
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
  }

  nav ul li a {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .logo span {
    display: none;
  }
}
