/**
 * Store styles - Интернет-магазин «Ползущие куличи»
 * Design system copied from 3dpr.p-kulichi.ru
 */

/* ============================================
   CSS Variables (Light Theme)
   ============================================ */
:root {
  /* Primary colors */
  --color-primary: #6B4226;
  --color-primary-light: #8B6F47;
  --color-primary-dark: #4A2D1A;
  --color-accent: #D4956A;
  --color-accent-soft: #F0D9C4;

  /* Backgrounds */
  --color-bg: #F5F0E8;
  --color-bg-secondary: #EDE6DA;
  --color-bg-card: #FDFBF7;

  /* Text */
  --color-text: #3A2A1A;
  --color-text-secondary: #7A6B5A;
  --color-text-muted: #A09080;

  /* Navigation */
  --color-navbar-bg: rgba(245, 240, 232, 0.95);
  --color-navbar-border: #D4C5B0;

  /* Footer */
  --color-footer-bg: #3A2A1A;
  --color-footer-text: #D4C5B0;

  /* Cards */
  --color-card-border: #D4C5B0;
  --color-card-shadow: rgba(107, 66, 38, 0.12);

  /* Sprinkle accents */
  --sprinkle-1: #E8A87C;
  --sprinkle-2: #D4956A;
  --sprinkle-3: #C17F59;
  --sprinkle-4: #85CDCA;
  --sprinkle-5: #E27D60;

  /* Cookie banner */
  --color-cookie-bg: #3A2A1A;
  --color-cookie-text: #F7F2EB;

  /* Status colors */
  --color-success: #4CAF50;
  --color-warning: #FFC107;
  --color-error: #E53935;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ============================================
   Dark Theme
   ============================================ */
[data-bs-theme="dark"] {
  --color-bg: #0F1117;
  --color-bg-secondary: #1A1D27;
  --color-bg-card: #1E2130;

  --color-text: #E0E2EA;
  --color-text-secondary: #9DA2B4;
  --color-text-muted: #636980;

  --color-navbar-bg: rgba(15, 17, 23, 0.95);
  --color-navbar-border: #2A2E3F;

  --color-footer-bg: #080A10;
  --color-footer-text: #8A90A4;

  --color-card-border: #2A2E3F;
  --color-card-shadow: rgba(0, 0, 0, 0.35);

  --color-primary: #D4956A;
  --color-primary-light: #E0A97E;
  --color-primary-dark: #C17F59;
  --color-accent: #E8A87C;
  --color-accent-soft: #2A2E3F;

  --color-cookie-bg: #080A10;
  --color-cookie-text: #E0E2EA;
}

/* Color scheme control */
[data-bs-theme="light"] { color-scheme: light only; }
[data-bs-theme="dark"] { color-scheme: dark only; }

/* ============================================
   Global Styles
   ============================================ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body.modal-open {
  padding-right: 0 !important;
  overflow-y: scroll !important;
}

.modal {
  padding-right: 0 !important;
}

main {
  flex: 1;
  position: relative;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

.container-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  background-color: var(--color-navbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-navbar-border);
  transition: all var(--transition-normal);
  z-index: 1030;
}

.logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.brand-text {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

[data-bs-theme="dark"] .brand-text {
  color: var(--color-accent);
}

.navbar .nav-link {
  color: var(--color-text-secondary);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--color-primary);
  background-color: var(--color-bg-secondary);
}

.navbar .dropdown-menu {
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--color-card-shadow);
  background-color: var(--color-bg-card);
  overflow: hidden;
  padding: 4px;
}

.navbar .dropdown-item {
  border-radius: var(--radius-sm);
  margin: 2px 0;
  padding: 0.5rem 0.75rem;
  color: var(--color-text);
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item.active {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
}

/* Search bar in header */
.header-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.header-search .form-control {
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-card-border);
  background-color: var(--color-bg-card);
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.header-search .form-control:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(107, 66, 38, 0.15);
}

.header-search .search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--color-text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: 50%;
  cursor: pointer;
}

.header-search .search-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-secondary);
}

/* Autocomplete dropdown */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--color-card-shadow);
  z-index: 1050;
  display: none;
  margin-top: 4px;
  overflow: hidden;
}

.search-autocomplete.active {
  display: block;
}

.search-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.search-autocomplete-item:hover {
  background-color: var(--color-bg-secondary);
}

.search-autocomplete-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Header icon buttons */
.header-icon-btn {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
}

.header-icon-btn:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
}

.header-icon-btn .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.55rem;
  padding: 0.15em 0.4em;
  min-width: 16px;
}

/* Theme toggle */
.theme-toggle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
}

[data-bs-theme="dark"] .theme-icon-dark { display: none !important; }
[data-bs-theme="dark"] .theme-icon-light { display: inline-block !important; }
[data-bs-theme="light"] .theme-icon-dark { display: inline-block; }
[data-bs-theme="light"] .theme-icon-light { display: none !important; }

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

[data-bs-theme="dark"] .btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #0F1117;
}

[data-bs-theme="dark"] .btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

[data-bs-theme="dark"] .btn-outline-primary {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #0F1117;
}

/* ============================================
   Cards
   ============================================ */
.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-card-border);
  background-color: var(--color-bg-card);
  box-shadow: 0 2px 8px var(--color-card-shadow);
}

/* Product card */
.product-card {
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-card-border);
  background-color: var(--color-bg-card);
  box-shadow: 0 2px 8px var(--color-card-shadow);
  transition: all var(--transition-normal);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--color-card-shadow);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.product-card__dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 5px 0 2px;
}
.product-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-card-border, rgba(0,0,0,.15));
  transition: background 0.15s;
}
.product-card__dot.active {
  background: var(--color-primary, #6B4226);
}

/* Cart button (search results only) */
.product-card__cart-wrap { margin-top: 8px; }
.product-card__cart-add {
  width: 100%;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: var(--color-primary, #6B4226);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.product-card__cart-add:hover { background: var(--color-primary-dark, #4A2D1A); }
.product-card__cart-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-primary, #6B4226);
}
.product-card__cart-minus,
.product-card__cart-plus {
  width: 36px;
  height: 32px;
  border: none;
  background: var(--color-primary, #6B4226);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card__cart-minus:hover,
.product-card__cart-plus:hover { background: var(--color-primary-dark, #4A2D1A); }
.product-card__cart-qty {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  min-width: 28px;
}

.product-card__favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all var(--transition-fast);
}

.product-card__favorite:hover,
.product-card__favorite.active {
  color: #E53935;
  background: rgba(255, 255, 255, 0.95);
}

.product-card__tags {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.product-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}

.product-card__body {
  padding: 0.75rem;
}

.product-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.product-card__old-price {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-card__discount {
  font-size: 0.8rem;
  font-weight: 600;
  color: #E53935;
  margin-left: 0.5rem;
}

.product-card__stock {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.product-card__name {
  font-size: 0.9rem;
  color: var(--color-text);
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.product-card__desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__rating {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.product-card__rating .stars {
  color: #F5A623;
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border-color: var(--color-card-border);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(107, 66, 38, 0.15);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
}

.footer-heading {
  color: #fff;
  font-weight: 600;
}

.footer-contacts a,
.footer-links a {
  color: var(--color-footer-text);
  transition: color var(--transition-fast);
}

.footer-contacts a:hover,
.footer-links a:hover {
  color: var(--color-accent);
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-color: rgba(255, 255, 255, 0.1);
}

.footer-bottom a {
  color: var(--color-footer-text);
}

.footer-bottom a:hover {
  color: var(--color-accent);
}

.site-footer .text-muted {
  color: var(--color-footer-text) !important;
  opacity: 0.75;
}

.site-footer .badge.bg-secondary {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--color-footer-text) !important;
}

/* ============================================
   Cookie Banner
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-cookie-bg);
  color: var(--color-cookie-text);
  z-index: 1050;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.cookie-banner a {
  color: var(--color-accent);
}

/* ============================================
   Toasts
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  max-width: 380px;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  border: 1px solid var(--color-card-border);
  box-shadow: 0 8px 24px var(--color-card-shadow);
  animation: toastSlideIn 0.3s ease;
  color: var(--color-text);
}

.toast-item.toast-success { border-left: 4px solid var(--color-success); }
.toast-item.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-item.toast-error { border-left: 4px solid var(--color-error); }
.toast-item.toast-info { border-left: 4px solid var(--color-primary); }

.toast-item .toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-error .toast-icon { color: var(--color-error); }
.toast-info .toast-icon { color: var(--color-primary); }

.toast-item .toast-message {
  flex: 1;
  font-size: 0.9rem;
}

.toast-item .toast-close {
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}

.toast-item.toast-hiding {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   Alerts
   ============================================ */
.alert {
  border-radius: var(--radius-md);
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-secondary) 25%, var(--color-bg) 50%, var(--color-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Catalog Grid
   ============================================ */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* ============================================
   Sidebar Filters
   ============================================ */
.sidebar-filters {
  position: sticky;
  top: 80px;
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section__title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

/* Toggle switch (iOS style) */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--color-card-border);
  border-radius: 24px;
  transition: var(--transition-fast);
}

.toggle-switch .slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-switch input:checked + .slider {
  background-color: var(--color-primary);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }

[data-bs-theme="dark"] .text-muted {
  color: var(--color-text-muted) !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
  background-color: #2A2E3F !important;
  color: #9DA2B4 !important;
}

[data-bs-theme="dark"] .navbar-toggler-icon {
  filter: invert(0.8);
}

/* ============================================
   Product Page
   ============================================ */
.product-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-rating-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.product-about__table {
  width: 100%;
  font-size: 0.9rem;
}

.product-about__table td {
  padding: 0.25rem 0;
}

.product-about__table td:first-child {
  width: 40%;
  padding-right: 0.5rem;
}

/* Gallery */
.product-gallery__main {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-card-border);
  cursor: zoom-in;
  aspect-ratio: 1;
}
.product-gallery__main video,
.product-gallery__main .product-video-ozon,
.product-gallery__main .product-photo-tags,
.product-gallery__main .product-video-gallery-btn {
  cursor: default;
}
.product-gallery__main .product-video-ozon__player {
  cursor: default;
}

/* Gallery main image navigation arrows */
.gallery-main-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.product-gallery__main:hover .gallery-main-arrow {
  opacity: 1;
}
.gallery-main-arrow:hover {
  background: rgba(0,0,0,0.6);
}
.gallery-main-arrow--prev { left: 8px; }
.gallery-main-arrow--next { right: 8px; }
/* Ozon-style video in gallery — blurred bg via duplicate video */
.product-video-ozon {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.product-video-ozon__bg {
  position: absolute;
  inset: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  object-fit: cover;
  filter: blur(30px) brightness(0.4);
  z-index: 0;
  pointer-events: none;
}
.product-video-ozon__player {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
.product-video-gallery-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.product-video-gallery-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* Tags overlay on product photo/video */
.product-photo-tags {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 3;
}
.product-photo-tags .product-tag {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Thumb strip with arrows + fixed video */
.gallery-thumbstrip {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 0.5rem;
  position: relative;
}
/* Left arrow sticks out to the left of the cover area */
.gallery-thumb-arrow--left {
  position: relative;
  left: -36px;
  margin-right: -28px; /* compensate so photos stay aligned */
}
.gallery-thumb-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
  will-change: scroll-position;
  -webkit-overflow-scrolling: touch;
}
.gallery-thumb-scroll::-webkit-scrollbar { display: none; }

.gallery-thumb-arrow {
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  color: var(--color-text);
  margin-top: 18px;
  transition: opacity 0.25s, width 0.25s, min-width 0.25s, margin 0.25s, padding 0.25s, border-width 0.25s;
}
.gallery-thumb-arrow:hover {
  background: var(--color-primary);
  color: #fff;
}
.gallery-thumb-arrow--right {
  margin: 18px 4px 0;
}

/* Fixed video slot — always visible at end */
.gallery-thumb-video-slot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 4px;
}
.gallery-thumb-video-label {
  font-size: 0.65rem;
  color: var(--color-primary);
  cursor: pointer;
  margin-top: 2px;
  font-weight: 600;
  white-space: nowrap;
}
.gallery-thumb-video-label:hover {
  text-decoration: underline;
}

/* Full Gallery Modal (Ozon-like) */
.full-gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--color-surface, #fff);
  background: var(--color-bg, #fff);
  display: flex;
  flex-direction: column;
}
.full-gallery-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10001;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
}
.full-gallery-close:hover { background: var(--color-bg-secondary); }

.full-gallery-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.full-gallery-sidebar {
  width: 140px;
  min-width: 140px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  border-right: 1px solid var(--color-border);
  scrollbar-width: thin;
  will-change: scroll-position;
  -webkit-overflow-scrolling: touch;
}
.full-gallery-section-label {
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  margin: 8px 0 6px;
  font-weight: 700;
  background: var(--color-bg-secondary, rgba(0,0,0,0.05));
  border-radius: 6px;
  text-align: center;
}
.full-gallery-thumb {
  position: relative;
  width: 116px;
  height: 86px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  margin-bottom: 6px;
  cursor: pointer;
  flex-shrink: 0;
  contain: layout style;
}
.full-gallery-thumb img,
.full-gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.full-gallery-thumb.active {
  border-color: var(--color-primary);
}
.full-gallery-thumb:hover:not(.active) {
  border-color: var(--color-text-secondary);
}
.full-gallery-thumb__video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 1.2rem;
  z-index: 2;
  pointer-events: none;
}

.full-gallery-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--color-bg, #f5f5f5);
}
.full-gallery-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.full-gallery-media {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
video.full-gallery-media {
  background: #000;
}

.full-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 1.4rem;
}
.full-gallery-nav:hover { background: rgba(255,255,255,0.3); }
.full-gallery-nav--prev { left: 16px; }
.full-gallery-nav--next { right: 16px; }

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

.product-gallery__thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.product-gallery__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition-fast);
  contain: layout style;
}

.product-gallery__thumb.active,
.product-gallery__thumb:hover {
  border-color: var(--color-primary);
}

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

.product-gallery__thumb-video {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 1.4rem;
  z-index: 2;
  pointer-events: none;
}
.video-thumb-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Buy card */
.product-buy-card {
  position: sticky;
  top: 80px;
}

.product-price-main {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
}

.product-price-old {
  font-size: 1rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-price-discount {
  font-size: 0.95rem;
  font-weight: 600;
  color: #E53935;
  margin-left: 0.25rem;
}

.product-fav-btn.active,
.product-fav-btn.active:hover {
  color: #E53935;
  border-color: #E53935;
}

/* Specs table */
.product-specs-table {
  width: 100%;
  font-size: 0.9rem;
}

.product-specs-table tr:nth-child(even) {
  background-color: var(--color-bg-secondary);
}

.product-specs-table td {
  padding: 0.5rem 0.75rem;
}

.product-specs-table td:first-child {
  width: 35%;
}

/* Description — no max-width, full width of container */

/* Recommended scroll */
.recommended-scroll {
  position: relative;
}

.recommended-scroll__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 0.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.recommended-scroll__track::-webkit-scrollbar {
  display: none;
}

.recommended-scroll__track .product-card {
  min-width: 200px;
  max-width: 220px;
  flex-shrink: 0;
}

.recommended-scroll__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-card-border);
  background: var(--color-bg-card);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--color-card-shadow);
  transition: all var(--transition-fast);
}

.recommended-scroll__arrow:hover {
  background: var(--color-bg-secondary);
}

.recommended-scroll__arrow--left { left: -12px; }
.recommended-scroll__arrow--right { right: -12px; }

/* Reviews */
.review-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

.review-media-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Review form */
.star-rating-input i {
  transition: color 0.15s;
}
.star-rating-input i:hover {
  transform: scale(1.15);
}
#reviewForm .btn-outline-success.active,
#reviewForm .btn-outline-danger.active {
  color: #fff;
}
#reviewForm .btn-outline-success.active {
  background-color: var(--bs-success);
  border-color: var(--bs-success);
}
#reviewForm .btn-outline-danger.active {
  background-color: var(--bs-danger);
  border-color: var(--bs-danger);
}
.vote-btn {
  text-decoration: none !important;
  transition: color 0.15s;
}
.vote-btn:hover {
  color: var(--color-primary) !important;
}
.vote-btn.text-primary,
.vote-btn.text-danger {
  font-weight: 600;
}

/* PVZ list items */
.pvz-list-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: background 0.15s;
}
.pvz-list-item:hover {
  background: rgba(var(--bs-primary-rgb), 0.06);
}
.pvz-list-item.active {
  background: rgba(var(--bs-success-rgb), 0.1);
  border-left: 3px solid var(--bs-success);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2001;
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox__arrow:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox__arrow--left { left: 1rem; }
.lightbox__arrow--right { right: 1rem; }

/* ============================================
   Cart
   ============================================ */
.cart-item {
  transition: opacity var(--transition-fast);
}

.cart-item .cart-qty {
  min-width: 24px;
  text-align: center;
}

/* ============================================
   Checkout
   ============================================ */
.tips-btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

[data-bs-theme="dark"] .tips-btn.active {
  color: #0F1117;
}

/* ============================================
   Smooth theme transitions
   ============================================ */
body, .navbar, .card, .product-card, .site-footer, .cookie-banner, .toast-item {
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1279.98px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 8px 24px var(--color-card-shadow);
    border: 1px solid var(--color-card-border);
  }

  .header-search {
    max-width: 100%;
    margin: 0.5rem 0;
  }
}

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

@media (max-width: 479.98px) {
  .catalog-grid { grid-template-columns: 1fr; }
}

/* Large screens */
@media (min-width: 1400px) {
  html { font-size: 17px; }
}

@media (min-width: 1600px) {
  html { font-size: 18px; }
  .container { max-width: 1480px; }
}

@media (min-width: 1920px) {
  html { font-size: 19px; }
  .container { max-width: 1700px; }
}

/* ============================================
   Review media thumbs
   ============================================ */
.review-media-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid var(--color-border);
  transition: transform 0.15s, border-color 0.15s;
}
.review-media-thumb:hover {
  transform: scale(1.05);
  border-color: var(--color-primary);
}
/* Video thumb — dark box with play icon */
span.review-video-wrap.review-media-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}


/* Product description rich content */
.product-description {
  font-size: 15px;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
/* Description collapse fade */
.product-desc-fade {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--color-bg-card, #fff));
  pointer-events: none;
}

/* Quill font classes */
.product-description .ql-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.product-description .ql-font-monospace { font-family: 'Courier New', monospace; }
/* Quill size classes */
.product-description .ql-size-small { font-size: 0.75em; }
.product-description .ql-size-large { font-size: 1.5em; }
.product-description .ql-size-huge { font-size: 2.5em; }
/* Quill alignment */
.product-description .ql-align-center { text-align: center; }
.product-description .ql-align-right { text-align: right; }
.product-description .ql-align-justify { text-align: justify; }
/* Quill indent */
.product-description .ql-indent-1 { padding-left: 3em; }
.product-description .ql-indent-2 { padding-left: 6em; }
.product-description .ql-indent-3 { padding-left: 9em; }
.product-description img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}
.product-description img[style*="float:left"] { margin-right: 16px; margin-bottom: 8px; }
.product-description img[style*="float:right"] { margin-left: 16px; margin-bottom: 8px; }
.product-description h2, .product-description h3, .product-description h4 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}
.product-description blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--color-text-secondary);
}
.product-description ul, .product-description ol {
  padding-left: 24px;
  margin: 8px 0;
}

/* Admin product list view */
.admin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  background: var(--color-bg-card);
  cursor: pointer;
  transition: background 0.15s;
}
.admin-list-item:hover {
  background: var(--color-bg-secondary, rgba(0,0,0,0.03));
}
.admin-list-item__img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.admin-list-item__name { font-weight: 600; font-size: 0.9rem; }
.admin-list-item__sku { font-size: 0.8rem; min-width: 80px; }
.admin-list-item__price { min-width: 80px; text-align: right; }
.admin-list-item__stock { min-width: 60px; text-align: right; font-size: 0.85rem; }

/* Cart action buttons — no border, just icons/text with hover */
.cart-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.cart-action-btn:hover {
  background: var(--color-bg-secondary, rgba(0,0,0,0.06));
  color: var(--color-text);
}
.cart-action-btn--danger:hover { color: var(--color-error, #E53935); }
.cart-action-btn--primary:hover { color: var(--color-primary); }

/* Cart qty buttons — no border, just text with hover */
.cart-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.cart-qty-btn:hover {
  background: var(--color-bg-secondary, rgba(0,0,0,0.08));
  color: var(--color-primary);
}

/* Auto-resize textarea */
textarea.auto-resize {
  resize: none;
  overflow: hidden;
  min-height: 100px;
}

/* Media lightbox (photo/video viewer) */
.media-viewer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-viewer-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}
.media-viewer-overlay video {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}
.media-viewer-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.media-viewer-close:hover {
  background: rgba(255,255,255,0.4);
}

/* ===== Delivery Address Cards ===== */
.address-card {
  padding: 12px;
  border: 1px solid var(--color-card-border, rgba(0,0,0,.1));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  background: var(--color-bg-card, #fff);
}
[data-bs-theme="dark"] .address-card { background: var(--color-surface, #2a2118); }
.address-card:hover {
  border-color: var(--color-primary-light, #8B6F47);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.address-card--selected {
  border-color: #4a9eff;
  background: rgba(74,158,255,.06);
  box-shadow: 0 0 0 2px rgba(74,158,255,.15);
}
.address-card--default { border-left: 3px solid #f0ad4e; }

/* Address Context Menu */
.address-context-menu {
  position: fixed;
  z-index: 1080;
  background: var(--color-bg-card, #fff);
  border: 1px solid var(--color-card-border, rgba(0,0,0,.1));
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  min-width: 180px;
  padding: 4px 0;
}
[data-bs-theme="dark"] .address-context-menu { background: var(--color-surface, #2a2118); }
.address-context-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}
.address-context-item:hover { background: rgba(74,158,255,.08); }
.address-context-item--danger { color: #dc3545; }
.address-context-item--danger:hover { background: rgba(220,53,69,.08); }

/* Address Map Info Panel */
.address-info-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  background: var(--color-bg-card, #fff);
  border-right: 1px solid var(--color-card-border, rgba(0,0,0,.1));
  z-index: 10;
  overflow-y: auto;
  padding: 16px;
}
[data-bs-theme="dark"] .address-info-panel { background: var(--color-surface, #2a2118); }

/* Checkout address cards */
.checkout-address-card {
  padding: 10px 12px;
  border: 1px solid var(--color-card-border, rgba(0,0,0,.1));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 6px;
  background: var(--color-bg-card, #fff);
}
[data-bs-theme="dark"] .checkout-address-card { background: var(--color-surface, #2a2118); }
.checkout-address-card:hover { border-color: var(--color-primary-light, #8B6F47); }
.checkout-address-card--active {
  border-color: #198754;
  background: rgba(25,135,84,.06);
  border-left: 3px solid #198754;
}

@media (max-width: 767px) {
  .address-info-panel { width: 100%; border-right: none; }
}
