/* ЭльСмарт — витрина (визуал в духе dns-shop.kz) */
:root {
  --accent: #f08000;
  --accent-hover: #d96f00;
  --accent-soft: #fff3e0;
  --accent-icon-bg: #ffe7c8;
  --price: #111827;
  --sale: #d51a1a;
  --header-bg: #1f2329;
  --header-bg-2: #2a2f36;
  --header-text: #ffffff;
  --blue: #f08000;
  --blue-hover: #d96f00;
  --blue-soft: #fff3e0;
  --blue-icon-bg: #ffe7c8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f4f6f8;
  --radius: 6px;
  --radius-pill: 4px;
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: #fff;
}

body[data-page="catalog"] {
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ——— Header (DNS-style) ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid #14171b;
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-main a {
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #d1d5db;
  transition: background 0.15s, color 0.15s;
}

.nav-main a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-main a.active {
  background: rgba(240, 128, 0, 0.15);
  color: var(--accent);
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  max-width: 640px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 9px 14px;
  transition: border 0.15s, box-shadow 0.15s;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(240, 128, 0, 0.18);
}

.search-field svg {
  flex-shrink: 0;
  color: #9ca3af;
}

.search-field input {
  border: 0;
  background: transparent;
  font: inherit;
  width: 100%;
  outline: none;
  color: var(--text);
}

.search-field input::placeholder {
  color: #9ca3af;
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  color: #fff;
  transition: background 0.15s, color 0.15s;
}

.cart-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 20px;
  background: #0f172a url('https://images.unsplash.com/photo-1498049794561-7780e4432361?w=1920&q=80') center/cover no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.55) 100%);
}

.hero .container {
  position: relative;
  z-index: 1;
  max-width: 920px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 28px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: #fff !important;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--blue-hover);
}

.hero-features {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-feature-pill {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(219, 234, 254, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}

/* ——— Features (white section) ——— */
.features {
  padding: 56px 0 72px;
  background: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .features-grid .feat-ico {
    margin-left: auto;
    margin-right: auto;
  }
}

.feat-card {
  text-align: center;
}

.feat-ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue-icon-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.feat-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.feat-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ——— Section title ——— */
.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ——— Category tiles ——— */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 60px;
}

@media (max-width: 1200px) {
  .cat-tiles {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .cat-tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

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

@media (max-width: 380px) {
  .cat-tiles {
    grid-template-columns: 1fr;
  }
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 22px 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-soft) 0%, #ffffff 100%);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--blue);
}

.cat-tile-ico {
  font-size: 2rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--blue-icon-bg);
  margin-bottom: 4px;
}

.cat-tile-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.cat-tile-count {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ——— Category sections (per category rows) ——— */
.cat-section {
  margin-bottom: 56px;
}

.cat-section:last-child {
  margin-bottom: 0;
}

.cat-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.cat-section-head h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat-section-more {
  font-size: 0.95rem;
  color: var(--blue);
  font-weight: 600;
  white-space: nowrap;
}

.cat-section-more:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* ——— Product grid ——— */
.popular {
  padding: 0 0 80px;
  background: #fff;
}

/* ——— Premium products catalog (Apple / Kaspi / Technodom / DNS / Sulpak) ——— */
:root {
  --product-media-h: 180px;
  --product-media-h-md: 160px;
  --product-media-h-sm: 140px;
  --product-card-radius: 14px;
  --product-card-bg: #ffffff;
  --product-card-border: #ececef;
  --product-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.02);
  --product-card-shadow-hover: 0 18px 40px -16px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
  --price-color: #0f172a;
  --muted-color: #64748b;
}

/* Сетка: 4 → 3 → 2 (на мобилке) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1180px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .products-grid:not(.list-view) {
    --product-media-h: var(--product-media-h-md);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .products-grid:not(.list-view) {
    --product-media-h: var(--product-media-h-sm);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* список каталога — один столбец */
.products-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0;
}

/* Плитка: flex-колонка + auto-распределение */
.products-grid:not(.list-view) .product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* ——— Карточка товара ——— */
.product-card {
  position: relative;
  background: var(--product-card-bg);
  border: 1px solid var(--product-card-border);
  border-radius: var(--product-card-radius);
  overflow: hidden;
  box-shadow: var(--product-card-shadow);
  transition:
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  contain: layout paint;
}

.product-card:hover {
  border-color: #d0d5dd;
  box-shadow: var(--product-card-shadow-hover);
  transform: translateY(-4px);
  z-index: 1;
}

/* ——— Медиа (фото товара) ——— */
.product-card-media {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--product-media-h);
  min-height: var(--product-media-h);
  max-height: var(--product-media-h);
  padding: 14px;
  background: #fafbfc;
  border-bottom: 1px solid #f1f2f4;
  overflow: hidden;
  box-sizing: border-box;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.product-card-media-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.product-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.product-card-media img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.product-card:hover .product-card-media img.is-loaded {
  transform: scale(1.04);
}

.product-card-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%) #eef0f3;
  background-size: 200% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  animation: card-skeleton 1.2s linear infinite;
}

.product-card-media.is-loading::before {
  opacity: 1;
}

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

.product-media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  color: #94a3b8;
  font-size: 0.78rem;
  text-align: center;
}

.product-media-placeholder svg {
  width: 56px;
  height: 56px;
  opacity: 0.55;
}

.product-cat-ico {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  z-index: 2;
}

.product-sku {
  display: none; /* убираем технический текст из премиум-вида */
}

/* Бейджи скидки/новинки */
.product-badges {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  z-index: 2;
}

.badge-sale,
.badge-hit {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.badge-sale { background: var(--sale); }
.badge-hit { background: var(--accent); }

/* «Избранное» — поверх фото, в правом нижнем углу */
.product-card .btn-fav {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.product-card:hover .btn-fav,
.product-card .btn-fav.is-active,
.product-card .btn-fav:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-fav:hover,
.btn-fav.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: #fff;
}

.btn-fav svg {
  width: 18px;
  height: 18px;
}

/* ——— Тело карточки ——— */
.product-card-body {
  padding: 14px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.products-grid:not(.list-view) .product-card-body {
  flex: 1 1 auto;
  min-height: 0;
}

.products-grid.list-view .product-card-body {
  grid-area: body;
}

.product-brand-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-color);
  line-height: 1;
}

.product-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.35;
  min-height: calc(0.95rem * 1.35 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.product-title a {
  color: inherit;
  text-decoration: none;
}

.product-title a:hover {
  color: var(--accent);
}

.product-extras {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.compare-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.compare-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  margin: 0;
}

.product-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.product-rating .stars {
  color: #f5a524;
  font-size: 0.95rem;
  line-height: 1;
}

.product-rating .rating-val {
  font-weight: 700;
  color: var(--text);
}

.product-rating .reviews {
  color: var(--muted);
}

/* В плитке скрываем «Сравнить» / «отзывы» — оставляем только звезду + значение, чтобы низ был чистый */
.products-grid:not(.list-view) .product-extras .compare-check {
  display: none;
}

.products-grid:not(.list-view) .product-extras .reviews {
  display: none;
}

/* ——— Низ карточки: цена + Купить ——— */
.product-card-aside {
  padding: 6px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.products-grid:not(.list-view) .product-card-aside {
  flex: 0 0 auto;
  margin-top: auto;
}

.products-grid.list-view .product-card-aside {
  grid-area: aside;
  margin-top: 0;
}

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

.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--price-color);
  white-space: nowrap;
}

.product-old {
  font-size: 0.85rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.aside-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.btn-cart {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.btn-cart svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-cart:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 6px 14px -4px rgba(240, 128, 0, 0.45);
  transform: translateY(-1px);
}

.btn-cart:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-cart.is-added {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 6px 14px -4px rgba(22, 163, 74, 0.45);
}

/* ——— Skeleton-карточки во время загрузки ——— */
.products-grid.is-loading .product-card-skeleton {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--product-card-border);
  border-radius: var(--product-card-radius);
  overflow: hidden;
  box-shadow: var(--product-card-shadow);
}

.product-card-skeleton .sk-media {
  height: var(--product-media-h);
  background:
    linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%) #eef0f3;
  background-size: 200% 100%;
  animation: card-skeleton 1.2s linear infinite;
}

.product-card-skeleton .sk-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-card-skeleton .sk-line {
  height: 12px;
  border-radius: 6px;
  background:
    linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%) #eef0f3;
  background-size: 200% 100%;
  animation: card-skeleton 1.2s linear infinite;
}

.product-card-skeleton .sk-line.w-60 { width: 60%; }
.product-card-skeleton .sk-line.w-80 { width: 80%; }
.product-card-skeleton .sk-line.h-24 { height: 22px; }
.product-card-skeleton .sk-line.h-40 { height: 40px; border-radius: 10px; margin-top: auto; }

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card-media img,
  .btn-cart,
  .btn-fav,
  .product-card-skeleton .sk-line,
  .product-card-skeleton .sk-media,
  .product-card-media::before {
    transition: none !important;
    animation: none !important;
  }
}

/* ——— Список (DNS-style) ——— */
.products-grid.list-view .product-card {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  grid-template-areas: "media body aside";
  align-items: stretch;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: 0;
}

.products-grid.list-view .product-card:first-child {
  border-top: 1px solid var(--border);
}

.products-grid.list-view .product-card:hover {
  box-shadow: none;
  transform: none;
  background: #fffaf2;
  border-color: var(--border);
  border-top-color: var(--border);
}

.products-grid.list-view .product-card-media {
  grid-area: media;
  display: flex;
  flex-direction: column;
  width: 200px;
  height: 180px;
  padding: 10px 12px;
  align-self: center;
  border-bottom: none;
}

.products-grid.list-view .product-card-media-inner {
  flex: 1;
  min-height: 0;
}

.products-grid.list-view .product-card-media img {
  max-height: 100%;
}

.products-grid.list-view .product-cat-ico {
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  font-size: 15px;
}

.products-grid.list-view .product-sku {
  bottom: 8px;
  left: 14px;
}

.products-grid.list-view .product-card-body {
  padding: 18px 16px;
  gap: 14px;
  justify-content: center;
}

.products-grid.list-view .product-title {
  font-size: 0.95rem;
  -webkit-line-clamp: 2;
  min-height: 0;
}

.products-grid.list-view .product-card-aside {
  padding: 18px 18px;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}

.products-grid.list-view .product-price {
  font-size: 1.4rem;
}

.products-grid.list-view .aside-actions {
  width: 170px;
}

/* В list-view «избранное» снова обычное — рядом с «Купить» */
.products-grid.list-view .product-card .btn-fav {
  position: static;
  opacity: 1;
  transform: none;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 800px) {
  .products-grid.list-view .product-card {
    grid-template-columns: 130px 1fr;
    grid-template-areas:
      "media body"
      "aside aside";
  }
  .products-grid.list-view .product-card-media {
    width: 130px;
    height: 130px;
  }
  .products-grid.list-view .product-card-aside {
    padding: 0 14px 14px;
    align-items: stretch;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .products-grid.list-view .aside-actions {
    width: auto;
    flex: 1;
    justify-content: flex-end;
  }
}

/* ——— Catalog layout (DNS-style) ——— */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  padding: 18px 0 60px;
  align-items: start;
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 14px 0 4px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumbs .sep {
  opacity: 0.4;
}

.breadcrumbs .current {
  color: var(--text);
}

.cat-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  position: sticky;
  top: 76px;
  overflow: hidden;
}

@media (max-width: 960px) {
  .cat-sidebar {
    position: static;
  }
}

.cat-sidebar h2 {
  margin: 0;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.filter-block {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.filter-block:last-child {
  border-bottom: 0;
}

.filter-block h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.price-row {
  display: flex;
  gap: 8px;
}

.price-row input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  color: var(--text);
  background: #fff;
}

.price-row input:focus {
  border-color: var(--accent);
}

.filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.filter-list::-webkit-scrollbar {
  width: 6px;
}

.filter-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.filter-list li {
  margin: 0;
}

.filter-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.3;
}

.filter-list label:hover {
  color: var(--accent);
}

.filter-list input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.filter-list .f-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
}

.cat-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.cat-list li {
  margin: 0;
}

.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--text);
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-list a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.cat-list a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}

.cat-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.cat-list a.active .cat-count {
  color: var(--accent);
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.catalog-toolbar h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.catalog-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.sort-select:focus {
  border-color: var(--accent);
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.view-toggle button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.view-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.view-toggle button:not(.active):hover {
  background: #f3f4f6;
  color: var(--text);
}

.empty-catalog {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.btn-outline-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--text);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-outline-dark:hover {
  background: #f8fafc;
}

/* ——— Footer ——— */
.site-footer {
  background: #000;
  color: #e2e8f0;
  padding: 56px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}

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

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

.footer-brand .logo {
  color: #fff;
}

.footer-brand .logo-mark {
  background: var(--blue);
}

.footer-brand p {
  margin: 12px 0 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 320px;
}

.footer-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.footer-contacts li {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #cbd5e1;
}

.footer-col h4 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: 0.9rem;
  color: #94a3b8;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-col p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  text-align: left;
}

@media (max-width: 520px) {
  .footer-bottom {
    justify-content: center;
    text-align: center;
  }
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #1e293b;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.admin-link::before {
  content: '🔒';
  font-size: 0.9em;
  line-height: 1;
}

.admin-link:hover {
  color: #fff;
  border-color: var(--accent);
  background: rgba(240, 128, 0, 0.12);
}

/* ——— Simple page ——— */
.page-simple {
  padding: 40px 0 80px;
  max-width: 720px;
}

.page-simple h1 {
  font-size: 2rem;
  margin: 0 0 20px;
}

.page-simple p {
  color: var(--muted);
  line-height: 1.7;
}

.page-legal {
  max-width: 800px;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 2rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.legal-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent, #f08000);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(240, 128, 0, 0.1);
}

.legal-nav a:hover {
  background: rgba(240, 128, 0, 0.2);
}

.legal-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 88px;
}

.legal-section h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--text, #f5f5f5);
}

.legal-doc {
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.9375rem;
}

.legal-doc p {
  margin: 0 0 0.85rem;
}

.contact-facts {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.contact-facts li {
  margin-bottom: 0.65rem;
  color: var(--muted);
  line-height: 1.6;
}

.contact-facts a {
  color: var(--accent, #f08000);
  text-decoration: none;
}

.contact-facts a:hover {
  text-decoration: underline;
}

.cart-legal-note {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.cart-legal-note a {
  color: var(--accent, #f08000);
  text-decoration: underline;
}

/* ——— Product detail ——— */
.pdp {
  padding: 32px 0 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

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

.pdp-img {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.pdp-img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.pdp h1 {
  margin: 0 0 16px;
  font-size: 1.5rem;
}

.pdp-price {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.pdp-desc {
  margin: 24px 0;
}

.pdp-specs {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fafbfc;
}

.pdp-specs li {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pdp-specs li:last-child {
  border-bottom: 0;
}

.pdp-spec-k {
  color: var(--muted);
  font-weight: 600;
}

.pdp-spec-v {
  color: var(--text);
}

.pdp-desc-note,
.pdp-desc-text {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 520px) {
  .pdp-specs li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ——— Cart & checkout ——— */
body[data-page="cart"] {
  background: var(--bg);
}

.cart-page {
  padding: 8px 0 64px;
}

.cart-page-title {
  margin: 0 0 20px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cart-empty {
  text-align: center;
  padding: 64px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cart-empty p {
  margin: 0 0 16px;
  color: var(--muted);
}

.cart-empty p:first-child {
  font-size: 1.1rem;
  color: var(--text);
}

.cart-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .cart-layout-grid {
    grid-template-columns: 1fr;
  }
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .cart-row {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
  }

  .cart-qty-price {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
}

.cart-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: #f1f5f9;
}

.cart-info {
  min-width: 0;
}

.cart-title {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  line-height: 1.35;
}

.cart-title:hover {
  color: var(--accent);
}

.cart-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.cart-qty-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
  font-family: inherit;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.qty-val {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-line-price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--price);
}

.cart-remove {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
}

.cart-remove:hover {
  color: var(--sale);
}

.cart-note {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.cart-loading {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.checkout-card,
.checkout-success {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.checkout-card h2,
.checkout-success h2 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

.checkout-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.checkout-card input[type="text"],
.checkout-card input[type="tel"],
.checkout-card input[type="email"],
.checkout-card textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}

.checkout-card input:focus,
.checkout-card textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.delivery-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 8px;
  margin: 0 0 16px;
}

.delivery-fieldset legend {
  padding: 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.delivery-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.delivery-option input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.delivery-option strong {
  color: var(--text);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 1rem;
}

.cart-total-row strong {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--price);
}

.cart-form-error {
  color: var(--sale);
  font-size: 0.9rem;
  margin: 0 0 12px;
}

.checkout-success p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.checkout-success .btn-primary {
  margin-top: 8px;
}

.req {
  color: var(--sale);
  font-weight: 700;
}

/* ——— Телефоны: шапка, тач, вырезы экрана ——— */
@media (max-width: 768px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo cart"
      "search search"
      "nav nav";
    gap: 10px 12px;
    padding: 10px 0;
    align-items: center;
  }

  .logo {
    grid-area: logo;
    min-width: 0;
  }

  .logo > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cart-link {
    grid-area: cart;
  }

  .search-wrap {
    grid-area: search;
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .nav-main {
    grid-area: nav;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding: 2px 0 8px;
    margin: 0 -2px;
  }

  .nav-main::-webkit-scrollbar {
    display: none;
    height: 0;
  }

  .nav-main a {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 0.87rem;
  }

  .search-field input,
  .price-row input,
  .sort-select,
  .checkout-card input[type="text"],
  .checkout-card input[type="tel"],
  .checkout-card input[type="email"],
  .checkout-card textarea {
    font-size: 16px;
  }

  .hero {
    min-height: min(72vw, 340px);
    padding: 36px 0 44px;
  }

  .features {
    padding: 40px 0 48px;
  }

  .popular {
    padding: 0 0 48px;
  }

  .cat-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cat-section-more {
    align-self: flex-start;
  }

  .catalog-toolbar h1 {
    font-size: 1.2rem;
  }

  .catalog-toolbar {
    padding: 12px 14px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .cat-tile {
    padding: 16px 14px 18px;
  }

  .page-simple {
    padding: 28px 0 56px;
  }

  .page-simple h1 {
    font-size: 1.45rem;
  }

  .pdp {
    padding: 20px 0 48px;
    gap: 24px;
  }

  .pdp h1 {
    font-size: 1.25rem;
  }

  .pdp-price {
    font-size: 1.45rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }

  .site-footer {
    padding-bottom: max(28px, calc(28px + env(safe-area-inset-bottom, 0px)));
  }

  .cart-page-title {
    font-size: 1.35rem;
  }

  .product-card-body,
  .product-card-aside {
    padding-left: 12px;
    padding-right: 12px;
  }

  .product-price {
    font-size: 1.2rem;
  }

  .btn-cart {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
}

@media (hover: none) {
  .product-card .btn-fav {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
  }

  .product-card:hover .product-card-media img.is-loaded {
    transform: scale(1);
  }
}
