/* Fashion store styles for Django template */

/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Fashion store color palette - minimalist & elegant */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(0, 0%, 5%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(0, 0%, 5%);
  --primary: hsl(0, 0%, 5%);
  --primary-foreground: hsl(0, 0%, 98%);
  --secondary: hsl(0, 0%, 96%);
  --secondary-foreground: hsl(0, 0%, 5%);
  --muted: hsl(0, 0%, 96%);
  --muted-foreground: hsl(0, 0%, 45%);
  --accent: hsl(0, 0%, 94%);
  --accent-foreground: hsl(0, 0%, 5%);
  --border: hsl(0, 0%, 90%);
  --destructive: hsl(0, 84.2%, 60.2%);
  --destructive-foreground: hsl(0, 0%, 98%);

  /* Fashion-specific design tokens */
  --nav-height: 60px;
  --content-max-width: 1200px;

  /* Elegant shadows */
  --shadow-soft: 0 2px 8px -2px hsla(0, 0%, 5%, 0.08);
  --shadow-medium: 0 4px 16px -4px hsla(0, 0%, 5%, 0.12);
  --shadow-strong: 0 8px 32px -8px hsla(0, 0%, 5%, 0.16);

  /* Smooth transitions */
  --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-header: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography scale */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header Styles */
.header {
  height: 90px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition-header);
}

.header.header-scrolled {
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  z-index: 1001;
}

.logo-image {
  width: 180px;
  height: auto;
  object-fit: contain;
  transform: translateY(0);
  transition: var(--transition-base);
}

.logo:hover .logo-image {
  transform: translateY(0) scale(1.05);
}

.desktop-nav {
  display: none;
  gap: 2rem;
}

.desktop-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 400;
  transition: var(--transition-base);
}

.desktop-nav a:hover {
  color: var(--foreground);
}

/* Cart Link Styles */
.cart-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  /*padding: 0.5rem 1rem;*/
  border-radius: 8px;
  transition: var(--transition-base);
}

.cart-link:hover {
  background-color: var(--accent);
}

.cart-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cart-count {
  /*position: absolute;*/
  /*top: -5px;*/
  /*right: -5px;*/
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 50%;
  min-width: 20px;
  text-align: center;
  line-height: 1;
}

/* Profile Link Styles */
.profile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition-base);
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 400;
}

.profile-link:hover {
  background-color: var(--accent);
  color: var(--foreground);
}

.profile-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}


.mobile-menu-button {
  display: block;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--foreground);
  position: relative;
  z-index: 1002;
}

/* Анимированный бургер-меню */
.hamburger {
  width: 24px;
  height: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--foreground);
  border-radius: 1px;
  transition: var(--transition-slow);
  transform-origin: center;
  will-change: transform, opacity;
}

/* Анимация при открытии меню */
.mobile-menu-button.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-button.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-button.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Убираем лишние стили для overlay */
.mobile-overlay:before {
  display: none;
}

.mobile-menu {
  position: fixed;
  top: 70px; /* Используем фиксированную высоту вместо var(--nav-height) */
  left: -100%;
  width: 280px;
  height: calc(100vh - 70px);
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 280px,
    rgba(255, 255, 255, 0.3) 280px,
    rgba(255, 255, 255, 0.1) 100%
  );
  z-index: 100;
  transition: var(--transition-slow);
  overflow-y: auto;
}

.mobile-menu.active {
  left: 0;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.mobile-menu-header .logo-image {
  width: 50px;
  height: 50px;
  transform: translateY(0);
}

/* Убираем старые стили для кнопки закрытия, так как теперь используем анимированный бургер */

.mobile-menu-nav {
  padding: 1rem 0;
}

.mobile-menu-nav a,
.mobile-menu-nav button {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--foreground);
  text-decoration: none;
  border: none;
  background: none;
  width: 280px;
  text-align: left;
  font-size: var(--font-size-base);
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition-base);
}

.mobile-menu-nav a:hover,
.mobile-menu-nav button:hover {
  background-color: var(--accent);
}

.mobile-overlay {
  position: fixed;
  top: 70px; /* Используем фиксированную высоту вместо var(--nav-height) */
  left: 0;
  width: 100vw;
  height: calc(100vh - 70px);
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-slow);
}

.mobile-overlay:before{
  width: 250px;
  background: rgb(255, 255, 255);
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Hero Section */
.hero-section {
  padding: 4rem 0;
  background-color: var(--accent);
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 1024px;
}

/* Hero Video Background */
.hero-video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-video-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* Fallback для постера */
.hero-video-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
  z-index: 0; /* Ниже видео */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-video-background.poster-fallback::after {
  opacity: 1;
}

.hero-video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1; /* Показываем видео по умолчанию */
  transition: opacity 1s ease-in-out;
  position: relative;
  z-index: 3; /* Выше чем ::before (z-index: 2) */
  /* Отладочные стили */
  border: 2px solid red;
  background-color: rgba(255, 0, 0, 0.1);
}

/* Стили для fallback */
.hero-video-fallback {
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1.2rem;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4; /* Выше всего */
}

.hero-video-fallback h3 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 400;
}

.hero-video-fallback p {
  margin: 0;
  font-size: 1rem;
}

.hero-video-background.video-loaded video {
  opacity: 1;
  /* Убираем отладочные стили когда видео загружено */
  border: none;
  background-color: transparent;
  transform: scaleY(1);
  border-radius: unset;
}

/* Стили для скрытого видео */
.hero-video-background video.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Стили для показа fallback */
.hero-video-background.show-fallback .hero-video-fallback {
  display: flex;
}

/* Индикатор загрузки видео */
.hero-video-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
  transition: opacity 0.3s ease;
}

.hero-video-background.video-loaded::before {
  opacity: 0.4; /* Показываем затемнение когда видео загружено */
}

/* Стили для загрузки видео */
.hero-video-background.loading::before {
  background: rgba(0, 0, 0, 0.6); /* Более темное затемнение во время загрузки */
}

.hero-video-background.loading video {
  opacity: 0.5; /* Показываем видео полупрозрачным во время загрузки */
}

/* Кнопка воспроизведения для iOS */
.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-base);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.video-play-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.video-play-button svg {
  margin-left: 4px; /* Смещение для визуального центрирования треугольника */
}

/* Индикатор состояния видео для отладки */
.hero-video-background::after {
  content: attr(data-status);
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 10;
  opacity: 0.8;
  display: none; /* По умолчанию скрыт */
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .hero-video-background {
    display: block; /* Скрываем видео на мобильных для экономии трафика */
  }

  .hero-section {
    background-color: var(--accent);
  }

  .hero-container {
    padding: 1.5rem 1rem;
  }

  .hero-subtitle {
    text-align: center;
    font-size: var(--font-size-lg);
    margin-bottom: 0.75rem;
  }
}

.hero-container {
  position: relative;
  z-index: 3;
  margin: 0 auto;
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  text-align: center;
}

.hero-content {
  width: 100%;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.25);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.75);
  text-stroke: 1px rgba(255, 255, 255, 0.75);
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: #f8f9fa;
  margin-bottom: 0.5rem;
  margin-right: 0.5rem;
  font-weight: 500;
  text-align: right;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.025em;
}

.hero-button {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 2rem;
  border: none;
  font-size: var(--font-size-base);
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  display: inline-block;
}

.hero-button:hover {
  background-color: var(--foreground);
  transform: translateY(-1px);
}

/* Category Section */
.category-section {
  padding: 4rem 0;
}

.category-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.category-title {
  font-size: var(--font-size-2xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 2rem;
  color: var(--foreground);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Product Card */
.product-card {
  background-color: transparent;
  overflow: hidden;
  transition: var(--transition-slow);
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-soft);
}

.product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-image-container {
  aspect-ratio: 4/5;
  overflow: hidden;
  background-color: var(--accent);
  position: relative;
}

/* Специальные стили для карточек в разделе рекомендаций */
.related-products .product-card {
  max-width: 280px;
  margin: 0 auto;
}

.related-products .product-image-container {
  aspect-ratio: 4/5;
  max-height: 350px; /* Ограничиваем максимальную высоту */
  overflow: hidden;
  background-color: var(--accent);
  position: relative;
}

.related-products .product-image-container img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  /* Оптимизация для быстрой загрузки */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  /* Принудительное сжатие изображений */
  max-width: 280px;
  max-height: 350px;
  min-width: 280px;
  min-height: 350px;
}

.related-products .product-card:hover .product-image-container img {
  transform: scale(1.05);
}

.related-products .product-info {
  padding: 0.75rem; /* Уменьшаем отступы */
}

.related-products .product-title {
  font-size: var(--font-size-sm); /* Уменьшаем размер шрифта */
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.related-products .product-prices {
  margin-bottom: 0.5rem;
}

.related-products .product-price {
  font-size: var(--font-size-sm);
}

.related-products .product-original-price {
  font-size: var(--font-size-xs);
}

/* Стили для бейджа скидки в рекомендациях */
.related-products .product-discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--destructive);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  z-index: 3;
}

/* Placeholder для изображений в рекомендациях */
.related-products .product-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
              linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
              linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
              linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  z-index: 1;
  opacity: 0.8;
}

.related-products .product-image-container img.loaded::before {
  opacity: 0;
}

/* Адаптивность для бейджа скидки */
@media (max-width: 767px) {
  .related-products .product-discount-badge {
    font-size: 0.625rem;
    padding: 0.2rem 0.4rem;
    top: 6px;
    right: 6px;
  }
}

.product-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent);
  z-index: 1;
}

.product-image-container img,
.product-image-container video {
  position: relative;
  z-index: 2;
}

/* Стили для видео в карточках товаров */
.product-image-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.product-image-container:hover video {
  transform: scale(1.05);
}

/* Иконка воспроизведения для видео */
.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 3;
  transition: var(--transition-base);
}

.product-image-container:hover .video-play-icon {
  background-color: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Стили для видео в детальной странице */
.product-additional-video {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--accent);
}



/* Стили для видео на странице товара - убираем элементы управления */
.product-main-image video,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  /* Оптимизация загрузки */
  transition: opacity 0.3s ease;
}

/* Оптимизация загрузки видео */
video[preload="metadata"] {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Убираем проблемный селектор и используем общий класс */
video.loaded {
  opacity: 1;
}

/* Начальное состояние для всех видео до загрузки */
video {
  opacity: 0;
  transform: scaleY(0);
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Состояние после загрузки */
video.loaded {
  opacity: 1;
  transform: scaleY(1);
  border: none !important;
}

/* Индикатор загрузки видео */
video:not(.loaded) {
  border: 2px solid #4f46e5;
  border-radius: 8px;
}

/* Анимация раздвижения для видео блоков */
.product-main-image,
.gallery-item {
  overflow: hidden;
  position: relative;
}

.product-main-image video,
.gallery-item video {
  transform: scaleY(0);
  transform-origin: top;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* Более надежный селектор для анимации */
.product-main-image video.loaded,
.gallery-item video.loaded,
video.loaded {
  transform: scaleY(1);
}

/* Дополнительные эффекты для плавности */
.product-main-image video,
.gallery-item video {
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Принудительное применение стилей для загруженных видео */
video.loaded {
  opacity: 1 !important;
  transform: scaleY(1) !important;
}

/* Дополнительная проверка для всех видео */
video {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Плейсхолдер для видео во время загрузки */
.product-main-image video::before,
.gallery-item video::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent);
  z-index: 1;
  opacity: 1;
  transition: opacity 0.5s ease;
  transform: scaleY(1);
  transform-origin: top;
}

.product-main-image video.loaded::before,
.gallery-item video.loaded::before {
  opacity: 0;
  transform: scaleY(0);
}

/* Плейсхолдер для видео */
.product-main-image video::before,
.gallery-item video::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent);
  z-index: 1;
  opacity: 1;
  transition: all 0.5s ease;
  transform: scaleY(1);
  transform-origin: top;
}

.product-main-image video.loaded::before,
.gallery-item video.loaded::before {
  opacity: 0;
  transform: scaleY(0);
}

/* Оптимизация изображений для быстрой загрузки */
.product-main-image img,
.gallery-item img,
.product-additional-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  /* Оптимизация для быстрой загрузки */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  /* Плавная загрузка */
  transition: opacity 0.3s ease;
}

/* Lazy loading для изображений */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Общие стили для всех изображений */
img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.loaded {
  opacity: 1;
}

/* Специальные стили для полноэкранных изображений */
.fullscreen-image-item img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-image-item img.loaded {
  opacity: 1;
}

/* Responsive images */
img[srcset] {
  max-width: 100%;
  height: auto;
}

/* Иконка видео в миниатюрах */
.thumbnail-video-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
}

.fullscreen-thumbnail {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fullscreen-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1; /* Убираем начальную прозрачность */
  transition: opacity 0.2s ease;
}

.fullscreen-thumbnail:hover {
  transform: scale(1.05);
}

.fullscreen-thumbnail.active {
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* Стили для контейнера миниатюр */
.fullscreen-thumbnails {
  display: flex;
  gap: 10px;
  padding: 15px;
  overflow-x: auto;
  background-color: #000;
  border-top: 1px solid #333;
}

/* Стили для каждой миниатюры */
.fullscreen-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
}

/* Скрываем элементы управления видео */
.product-main-image video::-webkit-media-controls,
.gallery-item video::-webkit-media-controls {
  display: none !important;
}

/* Стили для fullscreen изображений с lazy loading */
.fullscreen-image-item {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #f0f0f0; /* фон для полноэкранного режима */
}

.fullscreen-image-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Оптимизация для быстрой загрузки */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  position: relative;
  z-index: 2;
}

/* Подложка для изображений с прозрачным фоном */
.fullscreen-image-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
              linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
              linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
              linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  z-index: 1;
  opacity: 0.8;
}

/* Lazy loading placeholder */
.fullscreen-image-item img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-image-item img[loading="lazy"].loaded {
  opacity: 1;
}

/* Стили для полноэкранного контейнера */
.fullscreen-container {
  background-color: #000;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.fullscreen-images-container {
  flex: 1;
  overflow-y: auto;
  background-color: #000;
}

.fullscreen-thumbnails {
  background-color: #000;
  border-top: 1px solid #333;
}

.product-main-image video::-webkit-media-controls-panel,
.gallery-item video::-webkit-media-controls-panel {
  display: none !important;
}

.product-main-image video::-webkit-media-controls-play-button,
.gallery-item video::-webkit-media-controls-play-button {
  display: none !important;
}

.product-main-image video::-webkit-media-controls-start-playback-button,
.gallery-item video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.product-additional-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.product-additional-video:hover video {
  transform: scale(1.05);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  padding: 1rem;
}

.product-title {
  font-size: var(--font-size-base);
  font-weight: 300;
  color: var(--foreground);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-prices {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-price {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--foreground);
}

.product-original-price {
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
  text-decoration: line-through;
}

/* Discount system styles */
.price-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.discount-badge {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.discount-badge i {
  font-size: 0.7rem;
}

/* Trainer/Judge discount badge */
.discount-badge.trainer-judge {
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

/* Savings info */
.savings-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: #27ae60;
  font-weight: 600;
  margin-top: 5px;
}

.savings-info i {
  color: #f39c12;
}

.product-button {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: var(--transition-base);
}

.product-button:hover {
  background-color: var(--foreground);
  color: var(--primary-foreground);
}

/* Стили для раздела рекомендаций */
.related-products {
  margin-top: 3rem;
  padding: 2rem 0;
}

.related-products .section-title {
  font-size: var(--font-size-2xl);
  font-weight: 400;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--foreground);
}

.related-products .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background-color: var(--accent);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-section {
  text-align: left;
}

.footer-title {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-phone,
.footer-email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: var(--font-size-sm);
}

.footer-phone svg,
.footer-email svg {
  flex-shrink: 0;
  color: var(--foreground);
}

.footer-phone a,
.footer-email a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: var(--transition-base);
}

.footer-phone a:hover,
.footer-email a:hover {
  color: var(--foreground);
}

.footer-whatsapp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: var(--font-size-sm);
}

.footer-whatsapp svg {
  flex-shrink: 0;
  color: #25D366;
}

.footer-whatsapp a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: var(--transition-base);
}

.footer-whatsapp a:hover {
  color: #25D366;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: var(--transition-base);
}

.footer-link:hover {
  color: var(--foreground);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
  margin: 0;
}

/* Responsive Footer */
@media (max-width: 767px) {
  .footer {
    padding: 2rem 0 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-section {
    text-align: center;
  }

  .footer-contact {
    align-items: center;
  }

  .footer-links {
    align-items: center;
  }
}

/* Mobile Cart Link Styles */
.mobile-cart-link {
  display: none;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition-base);
  color: var(--foreground);
  text-decoration: none;
  margin-right: 0.5rem;
}

.mobile-cart-link:hover {
  background-color: var(--accent);
}

.mobile-cart-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-cart-count {
  position: absolute;
  top: 15px;
  right: 120px;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 50%;
  min-width: 20px;
  text-align: center;
  line-height: 1;
}

#mobile-cart-count {
  position: absolute;
  top: 15px;
  right: 120px;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 50%;
  min-width: 20px;
  text-align: center;
  line-height: 1;
}

#mobile-header-cart-count {
    position: absolute;
    top: 7px;
    right: -30px;
    background-color: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 767px) {
  .header {
    height: 70px!important;
  }

  .header-container {
    height: 70px!important;
  }

  .mobile-cart-link {
    display: flex;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .logo-image {
    width: 140px;
    height: auto;
    transform: translateY(0);
  }

  .logo:hover .logo-image {
    transform: translateY(0) scale(1.05);
  }

  .main-content {
    padding-top: 70px!important;
  }

  /* Мобильные стили для рекомендаций */
  .related-products .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .related-products .product-image-container {
    max-height: 150px;
    aspect-ratio: 4/5;
  }

  .related-products .product-image-container img {
    max-width: 100%;
    max-height: 150px;
    min-width: auto;
    min-height: auto;
  }

  .related-products .product-info {
    padding: 0.5rem;
  }

  .related-products .product-title {
    font-size: var(--font-size-xs);
    line-height: 1.2;
  }

  .related-products .product-price {
    font-size: var(--font-size-xs);
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  /* Специальная сетка для рекомендаций */
  .related-products .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
  }

  .desktop-nav {
    display: flex;
  }

  .mobile-menu-button {
    display: none;
  }

  .mobile-cart-link {
    display: none;
  }

  .hero-title {
    font-size: var(--font-size-4xl);
  }

  .category-title {
    font-size: var(--font-size-3xl);
  }
}

@media (min-width: 1024px) {
  .hero-section {
    padding: 6rem 0;
  }

  .category-section {
    padding: 6rem 0;
  }
}

/* Main Content */
.main-content {
  padding-top: 90px; /* Используем фиксированную высоту вместо var(--nav-height) */
}

/* Utility Classes */
.hidden {
  display: none;
}

.visible {
  display: block;
}

.container-custom {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.transition-base {
  transition: var(--transition-base);
}

.transition-slow {
  transition: var(--transition-slow);
}

.shadow-soft {
  box-shadow: var(--shadow-soft);
}

.shadow-medium {
  box-shadow: var(--shadow-medium);
}

.shadow-strong {
  box-shadow: var(--shadow-strong);
}

/* Стили для кнопки выхода */
.logout-button {
  background: none;
  border: none;
  color: var(--destructive);
  font-weight: 500;
  font-size: var(--font-size-sm);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: var(--transition-base);
}

.logout-button:hover {
  color: var(--destructive);
  opacity: 0.8;
}

/* Стили для кнопки выхода в мобильном меню */
.mobile-menu-nav .logout-button {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--destructive);
  text-decoration: none;
  border: none;
  background: none;
  width: 280px;
  text-align: left;
  font-size: var(--font-size-base);
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition-base);
}

.mobile-menu-nav .logout-button:hover {
  background-color: var(--accent);
  color: var(--destructive);
}

/* Стили для выбора размера */
.product-size-selection {
  margin: 1.5rem 0;
}

.product-size-selection h3 {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.size-option {
  position: relative;
  cursor: pointer;
}

.size-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.size-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--background);
  color: var(--foreground);
  font-size: var(--font-size-sm);
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition-base);
  min-width: 60px;
  text-align: center;
}

.size-option input[type="radio"]:checked + .size-label {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.size-option:hover .size-label {
  border-color: var(--foreground);
  background-color: var(--accent);
}

.size-option input[type="radio"]:checked + .size-label:hover {
  background-color: var(--foreground);
  border-color: var(--foreground);
}

/* Стили для детских размеров */
.size-option input[type="radio"]:checked + .size-label[data-size*="-"] {
  background-color: #4f46e5; /* Красивый индиго */
  border-color: #4f46e5;
}

.size-option input[type="radio"]:checked + .size-label[data-size*="-"]:hover {
  background-color: #4338ca; /* Темнее индиго при наведении */
  border-color: #4338ca;
}

/* Адаптивность для размеров */
@media (max-width: 767px) {
  .size-options {
    gap: 0.25rem;
  }

  .size-label {
    padding: 0.4rem 0.8rem;
    font-size: var(--font-size-xs);
    min-width: 50px;
  }
}

/* Стили для дополнительной информации о размере */
.size-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: var(--accent);
  border-radius: 6px;
  border-left: 3px solid #4f46e5; /* Красивый индиго для детских размеров */
}

.size-info p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--foreground);
  font-weight: 500;
}

.size-info .size-description {
  color: var(--muted-foreground);
  font-weight: 400;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-slow);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--background);
  border-radius: 12px;
  box-shadow: var(--shadow-strong);
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: var(--transition-slow);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 500;
  color: var(--foreground);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  border-radius: 6px;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background-color: var(--accent);
  color: var(--foreground);
}

.modal-body {
  padding: 1rem 1.5rem 1.5rem;
}

/* Cart Modal Specific Styles */
.cart-modal-content {
  min-width: 400px;
}

.cart-modal-product {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--accent);
  border-radius: 8px;
}

.cart-modal-product-image {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-modal-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-modal-product-info {
  flex: 1;
}

.cart-modal-product-title {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--foreground);
  margin: 0 0 0.5rem 0;
}

.cart-modal-product-price {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

.cart-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cart-modal-continue,
.cart-modal-checkout {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-base);
  display: inline-block;
}

.cart-modal-continue {
  background-color: var(--accent);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.cart-modal-continue:hover {
  background-color: var(--secondary);
}

.cart-modal-checkout {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
}

.cart-modal-checkout:hover {
  background-color: var(--foreground);
}

/* Responsive Modal */
@media (max-width: 767px) {
  .modal-content {
    max-width: 95%;
    margin: 1rem;
  }

  .cart-modal-content {
    min-width: auto;
  }

  .cart-modal-actions {
    flex-direction: column;
  }

  .cart-modal-continue,
  .cart-modal-checkout {
    text-align: center;
  }

  .hero-section{
    height: 310px!important;
  }
}

/* Auth Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--foreground);
}

.form-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: var(--font-size-base);
  width: 100%;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--foreground);
  outline: none;
}

.checkbox-group {
  flex-direction: row;
  align-items: flex-start;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.form-checkbox {
  margin-top: 0.25rem;
}

.checkbox-container label {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--foreground);
}

.checkbox-container a {
  color: var(--primary);
  text-decoration: none;
  word-wrap: break-word;
  max-width: 100%;
  display: inline-block;
  vertical-align: top;
  line-height: 1.4;
  hyphens: auto;
  text-align: left;
  white-space: normal;
  break-inside: avoid;
  overflow-wrap: break-word;
  word-break: break-word;
}

.checkbox-container a:hover {
  text-decoration: underline;
}

.auth-actions {
  margin-top: 1rem;
}

.auth-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 4px;
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.modal-links {
  margin-top: 1.5rem;
  text-align: center;
  font-size: var(--font-size-sm);
}

.modal-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  word-wrap: break-word;
  max-width: 100%;
  display: inline-block;
  vertical-align: top;
  line-height: 1.4;
  hyphens: auto;
  text-align: center;
  white-space: normal;
  break-inside: avoid;
  overflow-wrap: break-word;
  word-break: break-word;
}

.modal-links a:hover {
  text-decoration: underline;
}

/* Checkout Modal Specific Styles */
.modal .form-label {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
}

.modal .form-label i {
  margin-right: 8px;
  color: var(--muted-foreground);
  width: 16px;
}

.modal .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: white;
  color: var(--foreground);
}

.modal .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.modal .form-control::placeholder {
  color: var(--muted-foreground);
}

.modal .form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.modal .form-check-input {
  margin: 0;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.modal .form-check-label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--foreground);
}

.modal .form-check-label a {
  color: var(--primary);
  text-decoration: none;
}

.modal .form-check-label a:hover {
  text-decoration: underline;
}

/* Grid layout for modal */
.modal .row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.modal .col-md-6 {
  flex: 1;
}

.modal .mb-3 {
  margin-bottom: 20px;
}

/* Button styles for modal */
.modal .btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal .btn-primary {
  background: var(--primary);
  color: white;
}

.modal .btn-primary:hover {
  background: #333;
  transform: translateY(-1px);
}

.modal .btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 2px solid var(--border);
}

.modal .btn-secondary:hover {
  background: var(--muted);
  transform: translateY(-1px);
}

.modal .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal .row {
    flex-direction: column;
    gap: 0;
  }

  .modal .col-md-6 {
    margin-bottom: 20px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal .btn {
    width: 100%;
    justify-content: center;
  }
}
