/* ===========================
   SIMPLE SHOP THEME MINI
   Premium Dark + Glass UI
   Только Vanilla CSS
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === Токены дизайна === */
:root {
  --bg-base: #0b0b10;
  --bg-surface: #14141c;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --accent: #e8a838;
  --accent-glow: rgba(232, 168, 56, 0.25);
  --accent-soft: rgba(232, 168, 56, 0.12);

  --green: #34d399;
  --blue: #38bdf8;
  --red: #f87171;

  --text-primary: #f0f0f5;
  --text-secondary: #8b8ba0;
  --text-muted: #55556a;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 100px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Сброс === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

img { display: block; max-width: 100%; }

/* === Шапка === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 22px;
  background: rgba(11, 11, 16, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-brand a {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.88em;
  font-weight: 500;
  transition: all var(--transition);
}
.site-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-cart-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

#cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--bg-base);
  font-size: 0.7em;
  font-weight: 700;
}

/* === Контейнер === */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* === Подвал === */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 0.82em;
  border-top: 1px solid var(--border-subtle);
}

.footer-theme {
  opacity: 0.5;
  font-size: 0.9em;
  margin-top: 4px;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-size: 0.9em;
  font-weight: 500;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 9999;
}
.toast.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* === Каталог === */
.catalog-title {
  font-size: 2em;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.catalog-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.5em;
}

/* === Фильтры === */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.tag-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.82em;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.tag-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.tag-btn-active {
  background: var(--accent) !important;
  color: var(--bg-base) !important;
  border-color: var(--accent) !important;
  font-weight: 600;
}

/* === Сетка === */
#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* === Карточка === */
.product-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-slow);
}
.product-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.product-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Карусель в карточке */
.card-carousel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}

.card-carousel img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.card-carousel img.active { opacity: 1; }

.card-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}
.card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s;
}
.card-dot:hover { background: rgba(255, 255, 255, 0.7); }
.card-dot.active {
  background: #fff;
  transform: scale(1.3);
}

.product-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-size: 0.95em;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  color: var(--text-primary);
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.product-tag {
  font-size: 0.7em;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}
.product-tag:hover {
  background: var(--accent);
  color: var(--bg-base);
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.product-price {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-cart:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-cart:active { transform: scale(0.95); }

.btn-cart-icon {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}

/* === Страница товара === */
.product-detail { max-width: 800px; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9em;
  cursor: pointer;
  transition: color var(--transition);
  margin-bottom: 20px;
}
.btn-back:hover { color: var(--accent); }

.product-detail-title {
  font-size: 2em;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.product-detail-price {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
}

.product-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.product-detail-tag {
  font-size: 0.8em;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

/* Галерея на странице товара */
.gallery {
  margin-bottom: 24px;
}
.gallery-main {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 12px;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--accent);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-description {
  margin-top: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95em;
}

.btn-add-to-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 14px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  font-weight: 600;
  color: var(--bg-base);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-add-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-add-to-cart:active { transform: translateY(0); }

.add-to-cart-icon {
  width: 20px;
  height: 20px;
  stroke: var(--bg-base);
  fill: none;
  stroke-width: 2;
}

/* === Корзина === */
.cart-title {
  font-size: 2em;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

#cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.cart-empty {
  color: var(--text-muted);
  font-size: 1.1em;
  padding: 40px 0;
  text-align: center;
}
.cart-empty a {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 500;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}
.cart-item:hover { border-color: var(--border-hover); }

.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.cart-item a {
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.cart-item a:hover { opacity: 0.8; }
.cart-item-info a { color: var(--text-primary); }
.cart-item-info a:hover { color: var(--accent); }

.cart-item-info {
  flex-grow: 1;
  min-width: 0;
}
.cart-item-info strong {
  display: block;
  font-size: 0.95em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.85em;
  color: var(--accent);
  font-weight: 500;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.btn-qty {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-qty:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95em;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.82em;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-remove:hover {
  color: var(--red);
  background: rgba(248, 113, 113, 0.1);
}

#cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.cart-total {
  font-size: 1.3em;
  font-weight: 700;
  margin-bottom: 20px;
}
.cart-total span { color: var(--accent); }

.checkout-btns { display: flex; gap: 10px; }

.btn-checkout {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.95em;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-wa {
  background: #25D366;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
}
.btn-wa:hover {
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.35);
  transform: translateY(-2px);
}

.btn-tg {
  background: #2AABEE;
  box-shadow: 0 4px 16px rgba(42, 171, 238, 0.25);
}
.btn-tg:hover {
  box-shadow: 0 6px 24px rgba(42, 171, 238, 0.35);
  transform: translateY(-2px);
}

.btn-clear {
  display: block;
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85em;
  cursor: pointer;
  transition: color var(--transition);
}
.btn-clear:hover { color: var(--red); }

/* === Адаптив === */
@media (max-width: 768px) {
  .site-header { padding: 8px 16px; }
  .site-main { padding: 20px 16px 40px; }
  .catalog-title { font-size: 1.5em; }
  #product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .product-detail-title { font-size: 1.5em; }
  .cart-item { flex-wrap: wrap; gap: 10px; }
  .checkout-btns { flex-direction: column; }
}

@media (max-width: 480px) {
  #product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .product-name { font-size: 0.85em; }
  .product-price { font-size: 0.95em; }
  .btn-cart { width: 34px; height: 34px; }
}
