/* ===== ЦВЕТОВЫЕ И GLASS-ПЕРЕМЕННЫЕ — СВЕТЛАЯ МОЛОЧНАЯ ТЕМА ===== */
:root {
  /* Основные цвета */
  --accent: #4ecdc4;
  --accent-hover: #3aa8a0;
  --accent-gradient: linear-gradient(135deg, #4ecdc4, #66d9cc);

  /* Фоны */
  --primary-bg: #faf9f6;
  --card-bg: rgba(250, 248, 242, 0.85);
  --sidebar-bg: #fdfcf9;

  /* Текст */
  --text-primary: #2d2d2d;
  --text-secondary: #5a5a5a;
  --text-muted: #999;

  /* Границы и тени */
  --border: rgba(0, 0, 0, 0.06);
  --hover-bg: rgba(78, 205, 196, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 12px 40px rgba(78, 205, 196, 0.15);

  /* Радиусы */
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-lg: 28px;

  /* Анимации */
  --transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-slow: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* ===== LIQUID GLASS — светлый режим ===== */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-dark: rgba(245, 243, 239, 0.6);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-dark: rgba(0, 0, 0, 0.05);
  --glass-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(78, 205, 196, 0.06);
  --glass-inner-glow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);
  --glass-glint: rgba(255, 255, 255, 0.6);
}

/* ===== ШРИФТЫ — SF Pro Rounded (system stack) ===== */
body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    'SF Pro Rounded',
    'Segoe UI',
    'Helvetica Neue',
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== ОБЩИЕ СТИЛИ ===== */
body {
  background: var(--primary-bg);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

main.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px 20px;
}

/* ===== HERO — Liquid Glass ===== */
.hero {
  text-align: center;
  padding: 36px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border-radius: var(--border-radius-lg);
  margin-bottom: 34px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(78,205,196,0.06) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text-primary);
  font-weight: 800;
  text-shadow: none;
}

.hero p {
  font-size: clamp(0.98rem, 1.8vw, 1.15rem);
  margin: 0 auto 20px;
  max-width: 620px;
  color: var(--text-secondary);
  text-shadow: none;
}

.hero .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(78, 205, 196, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(78, 205, 196, 0.35);
}

/* ===== Mobile Smart Search (main page) ===== */
.mobile-smart-search {
  display: none;
  margin: 0 0 24px;
  position: relative;
  z-index: 3;
}

.mobile-smart-search__box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.mobile-smart-search__box i {
  color: var(--text-muted);
}

.mobile-smart-search__box input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.mobile-smart-search__clear {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-smart-search__meta {
  margin-top: 8px;
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.mobile-smart-search__chips {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mobile-smart-search__chips::-webkit-scrollbar {
  display: none;
}

.mobile-search-chip {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.mobile-search-chip.is-active {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(78, 205, 196, 0.08));
  border-color: rgba(78, 205, 196, 0.45);
  color: var(--text-primary);
}

.mobile-smart-search__suggestions {
  display: none;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.mobile-smart-search__suggestions.is-open {
  display: block;
}

.mobile-search-suggestion {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: left;
}

.mobile-search-suggestion + .mobile-search-suggestion {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-search-hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

.mobile-search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 26px 12px;
}

.mobile-search-empty i {
  font-size: 1.4rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mobile-search-empty h3 {
  margin: 6px 0 4px;
  font-size: 1rem;
}

.mobile-search-empty p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ===== КНОПКИ ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 36px;
  background: var(--accent-gradient);
  color: #2d2d2d;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 50px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(78, 205, 196, 0.3);
}

.btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 28px rgba(78, 205, 196, 0.45);
}

/* ===== ЗАГОЛОВКИ СЕКЦИЙ ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 2rem;
  margin: 0;
  font-weight: 800;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 8px;
  opacity: 0.8;
}

.see-all {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.carousel-section {
  margin-bottom: 50px;
}

/* ===== КАТЕГОРИИ — Liquid Glass ===== */
.horizontal-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.horizontal-carousel::-webkit-scrollbar {
  display: none;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  text-align: center;
  text-decoration: none;
  color: var(--text-secondary);
  opacity: 0;
  animation: fadeInUp 0.6s forwards;
  animation-delay: var(--delay, 0s);
}

.category-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 18px;
  margin-bottom: 10px;
  font-size: 20px;
  color: var(--accent);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.category-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.category-item:hover .category-icon {
  transform: scale(1.1);
  background: rgba(78, 205, 196, 0.1);
}

.category-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* ===== СЕТКА ТОВАРОВ ===== */
.product-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(257px, 1fr));
  margin: 0 auto;
}

/* ===== КАРТОЧКА ТОВАРА — Liquid Glass + 3D TILT ===== */
.product-card {
  background: var(--glass-bg);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inner-glow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  transform: translateZ(0);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
  border-radius: var(--border-radius-lg) 0 0 0;
  opacity: 0;
  transition: opacity 0.4s;
}

.product-card:hover::before {
  opacity: 1;
}

.product-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 6px 20px rgba(78, 205, 196, 0.12),
    var(--glass-inner-glow);
}

.product-images-carousel {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.product-images-carousel img.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s, transform 0.35s;
  transform: scale(0.97);
}

.product-card:hover .product-images-carousel img.carousel-image {
  transform: scale(1.02);
}

.product-images-carousel img.carousel-image.active {
  opacity: 1;
  transform: scale(1);
}

.carousel-indicators {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 2;
}

.carousel-indicators .indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-indicators .indicator.active {
  background: var(--accent);
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.product-info .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: none;
}

.product-info .price {
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  text-shadow: none;
}

.product-info .stock {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-shadow: none;
}

.product-info .reviews {
  font-size: 0.75rem;
  color: #ffd700;
}

/* ===== АНИМАЦИЯ ПОЯВЛЕНИЯ ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== ФОЛЛБЭК ДЛЯ СТАРЫХ БРАУЗЕРОВ ===== */
@supports not (backdrop-filter: blur(10px)) {
  .hero,
  .product-card,
  .category-icon {
    background: var(--card-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--border);
  }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .mobile-smart-search {
    display: block;
    margin: 0 0 18px;
  }

  main.main-content {
    padding: 6px 15px 15px;
  }

  .hero {
    padding: 34px 14px;
    margin-bottom: 24px;
  }

  .hero h1 {
    font-size: 1.55rem;
  }

  .hero p {
    font-size: 0.94rem;
    margin-bottom: 14px;
  }

  .hero .btn-primary {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 10px;
  }

  .section-header {
    padding: 0 15px;
  }

  .horizontal-carousel {
    padding: 8px 15px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card {
    gap: 6px;
  }

  .category-item {
    min-width: 65px;
  }
}

/* ===== АНИМАЦИЯ ПЕРЕТАСКИВАНИЯ В КОРЗИНУ ===== */
.fly-img {
  position: fixed;
  width: 50px;
  top: 50%;
  left: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.8s ease-in-out;
}

/* ===== Единые карточки товаров для главной страницы ===== */
.product-grid {
  display: grid;
  justify-content: center;
  gap: 24px;
  overflow-x: auto;
  padding: 20px 10px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(0, 0, 0, 0.08);
}

.product-grid::-webkit-scrollbar {
  height: 6px;
}

.product-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 3px;
}

.product-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.product-grid::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  opacity: 0.8;
}

/* Карточка товара */
.product-card {
  min-width: 280px;
  max-width: 280px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 1;
  animation: none;
}

.product-card.reveal-init {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  filter: blur(4px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    filter 0.45s ease,
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform, filter;
}

.product-card.reveal-init.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 10px 25px rgba(78, 205, 196, 0.15);
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  flex: 0 0 auto;
}

/* Контейнер изображения */
.product-card-image {
  position: relative;
  overflow: hidden;
  height: 180px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  flex-shrink: 0;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.1);
}

/* Бейджи */
.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.badge.new {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: white;
}

.badge.sale {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
}

.badge.popular {
  background: linear-gradient(135deg, #ffd43b, #fcc419);
  color: #333;
}

/* Overlay с быстрыми действиями */
.product-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  padding: 20px;
}

.product-card:hover .product-card-overlay {
  opacity: 1;
}

.quick-actions {
  display: flex;
  gap: 8px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.product-card:hover .quick-actions {
  transform: translateY(0);
}

.quick-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-action-btn:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.1);
}

/* Контент карточки */
.product-card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.product-card-info h3 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
}

.product-card-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
  flex-shrink: 0;
}

.product-card-price {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.current-price {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.3rem;
}

.original-price {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 1rem;
}

.discount-percent {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Рейтинг */
.product-card-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #e5e7eb;
  font-size: 0.9rem;
}

.star.filled {
  color: #fcd34d;
}

.rating-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.rating-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Мета-информация */
.product-card-meta {
    display: flex;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    flex-direction: row;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seller-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.seller-avatar-placeholder {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
}

.stock-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stock-info.low {
  color: #eab308;
}

.stock-info.out {
  color: #ef4444;
}

/* Кнопка добавления в корзину */
.product-card-actions {
  margin-top: auto;
  flex-shrink: 0;
}

.add-to-cart-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.add-to-cart-btn:hover::before {
  left: 100%;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

.add-to-cart-btn:active {
  transform: translateY(0);
}

.add-to-cart-btn.added {
  background: linear-gradient(135deg, #51cf66, #40c057);
}

.add-to-cart-btn.added::after {
  content: '✓';
  margin-left: 5px;
  font-size: 0.8rem;
}

.add-to-cart-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Адаптивность */
@media (max-width: 1200px) {
  .product-card {
    min-width: 260px;
  }
}

@media (max-width: 768px) {
  .product-grid {
    gap: 20px;
    padding: 15px 8px;
  }
  
  .product-card {
    min-width: 240px;
  }
  
  .product-card-image {
    height: 160px;
  }
  
  .product-card-info {
    padding: 16px;
  }
  
  .current-price {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .product-grid {
    gap: 8px;
  }
  
  .product-card {
    min-width: 120px;
    max-height: 450px;
  }
  
  .product-card-image {
    height: 140px;
  }
  
  .quick-action-btn {
    width: 40px;
    height: 40px;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card.reveal-init,
  .product-card.reveal-init.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* ===== Final Home Card Refresh v2 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  overflow: visible;
  padding: 8px 0 4px;
}

.product-card {
  min-width: 0;
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-bg), var(--glass-bg));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(78, 205, 196, 0.36);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14), 0 10px 22px rgba(78, 205, 196, 0.14);
}

.product-card-link {
  display: block;
  color: inherit;
}

.product-card-image {
  height: 176px;
  background: rgba(18, 31, 51, 0.28);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badges {
  gap: 6px;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.quick-actions {
  gap: 8px;
}

.quick-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.product-card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  text-align: left;
}

.product-card-info h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.34;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.68em;
}

.product-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.86rem;
  line-height: 1.42;
  min-height: 2.84em;
}

.product-card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.current-price {
  font-size: 1.2rem;
  font-weight: 800;
}

.original-price {
  font-size: 0.9rem;
}

.product-card-rating {
  gap: 6px;
}

.rating-stars {
  gap: 2px;
}

.product-card-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
}

.seller-info,
.stock-info {
  min-width: 0;
}

.seller-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s ease;
}

.seller-link:hover {
  color: var(--accent-color);
}

.seller-avatar-placeholder,
.seller-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.product-card-actions {
  margin-top: auto;
}

.add-to-cart-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.94rem;
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card {
    border-radius: 14px;
  }

  .product-card-image {
    height: 142px;
  }

  .product-card-info {
    padding: 10px;
    gap: 6px;
  }

  .product-card-info h3 {
    font-size: 0.93rem;
    min-height: 2.55em;
  }

  .product-card-description {
    font-size: 0.8rem;
  }

  .current-price {
    font-size: 1.04rem;
  }

  .product-card-meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .quick-action-btn {
    width: 34px;
    height: 34px;
  }

  .add-to-cart-btn {
    min-height: 38px;
    font-size: 0.88rem;
  }
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .product-card-image {
    height: 128px;
  }
}

@media (max-width: 390px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-card-image {
    height: 160px;
  }
}

/* === Premium product emphasis === */
.product-grid .product-card.premium-card {
  transform: translateY(-6px);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 214, 102, 0.42),
    0 0 26px rgba(255, 214, 102, 0.26);
  border-color: rgba(255, 214, 102, 0.55);
  z-index: 2;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.product-grid .product-card.premium-card .product-card-image {
  height: 224px;
}

.product-grid .product-card.premium-card .product-card-info h3 {
  font-size: 1.06rem;
}

.badge.premium {
  background: linear-gradient(135deg, #ffd666 0%, #f59f00 100%);
  color: #2f2200;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 14px rgba(245, 159, 0, 0.28);
  line-height: 1;
  font-size: 0.72rem;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="dark"] .badge.premium {
  color: #201600;
}

.badge.premium {
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.premium::before {
  content: "★";
  font-family: inherit;
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
}

.product-grid .product-card.premium-card > * {
  position: relative;
  z-index: 1;
}

.product-grid .product-card.premium-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    rgba(255, 214, 102, 0.05) 0deg,
    rgba(255, 214, 102, 0.72) 58deg,
    rgba(255, 214, 102, 0.12) 100deg,
    rgba(255, 214, 102, 0.05) 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: drop-shadow(0 0 8px rgba(255, 214, 102, 0.35));
  animation: premiumRotateGlowIndex 3.3s linear infinite;
  pointer-events: none;
  z-index: 0;
}

html:not([data-theme="dark"]) .product-grid .product-card.premium-card {
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(66, 133, 244, 0.56),
    0 0 38px rgba(66, 133, 244, 0.44);
  border-color: rgba(66, 133, 244, 0.72);
}

html:not([data-theme="dark"]) .product-grid .product-card.premium-card::after {
  opacity: 1;
  background: conic-gradient(
    from 0deg,
    rgba(66, 133, 244, 0.05) 0deg,
    rgba(66, 133, 244, 0.88) 58deg,
    rgba(56, 201, 187, 0.2) 112deg,
    rgba(66, 133, 244, 0.05) 360deg
  );
  filter: drop-shadow(0 0 14px rgba(66, 133, 244, 0.58));
}

@keyframes premiumRotateGlowIndex {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.product-grid .product-card.premium-card .premium-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.product-grid .product-card.premium-card .premium-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: var(--size);
  line-height: 1;
  color: rgba(66, 133, 244, 0.9);
  text-shadow:
    0 0 8px rgba(66, 133, 244, 0.45),
    0 0 14px rgba(56, 201, 187, 0.28);
  transform: translate(-50%, -50%);
  opacity: 0.84;
  animation: premiumParticleOrbitIndex var(--dur) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}

html[data-theme="dark"] .product-grid .product-card.premium-card .premium-particle {
  color: rgba(255, 214, 102, 0.95);
  text-shadow:
    0 0 8px rgba(255, 186, 48, 0.44),
    0 0 16px rgba(255, 186, 48, 0.35);
}

@keyframes premiumParticleOrbitIndex {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0.85) rotate(0deg);
    opacity: 0.34;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1.08) rotate(28deg);
    opacity: 0.95;
  }
}

@media (max-width: 1024px) {
  .product-grid .product-card.premium-card .product-card-image {
    height: 202px;
  }
}

@media (max-width: 768px) {
  .product-grid .product-card.premium-card {
    transform: translateY(-2px);
  }

  .product-grid .product-card.premium-card .product-card-image {
    height: 158px;
  }
}

@media (max-width: 560px) {
  .product-grid .product-card.premium-card .product-card-image {
    height: 142px;
  }
}

@media (max-width: 390px) {
  .product-grid .product-card.premium-card .product-card-image {
    height: 164px;
  }
}
