:root {
  --bg: #f6f5f2;
  --bg-elevated: #ffffff;
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --accent: #1f3d3a;
  --accent-soft: #e8efee;
  --border: #e4e2dc;
  --card-bg: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(26, 26, 26, 0.06);
  --sale: #9a3412;
  --sale-bg: #fff1e8;
  --ok: #166534;
  --font-sans: 'Manrope', system-ui, sans-serif;
  --font-display: 'Source Serif 4', Georgia, serif;
  --header-h: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #e8efee 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #f0ebe3 0%, transparent 50%),
    var(--bg);
  color: var(--fg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
}

.container {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

.site-main {
  flex: 1;
  padding: 28px 0 64px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(246, 245, 242, 0.88);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--fg);
}

.logo span {
  color: var(--accent);
}

.logo-sm {
  font-size: 1.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-vk {
  background: var(--accent);
  color: #fff;
}

.btn-vk:hover {
  background: #16302e;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
}

.btn-lg {
  padding: 14px 22px;
  font-size: 1rem;
}

/* Hero */
.hero {
  display: grid;
  gap: 18px;
  margin-bottom: 40px;
  padding: 8px 0 8px;
  animation: fade-up 0.55s ease both;
}

.hero-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero p {
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

/* Sections */
.section {
  margin-bottom: 48px;
  animation: fade-up 0.6s ease both;
}

.section:nth-child(2) { animation-delay: 0.06s; }
.section:nth-child(3) { animation-delay: 0.12s; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head p,
.section-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-head p {
  color: var(--muted);
}

/* Category tiles */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.category-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
  padding: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 28px 28px 52px;
  background: linear-gradient(180deg, #faf9f7 0%, #f3f1ec 100%);
  transition: transform 0.35s ease;
}

.category-tile:hover img {
  transform: scale(1.04);
}

.category-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(26, 26, 26, 0.72) 100%);
  pointer-events: none;
}

.category-tile-content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.category-tile-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.category-tile-content span {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Category chips */
.category-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.category-chip {
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-chip:hover,
.category-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.search-input,
.sort-select {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  border-radius: 999px;
  padding: 11px 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input {
  flex: 1 1 240px;
  min-width: 0;
}

.sort-select {
  flex: 0 0 auto;
  padding-right: 36px;
  cursor: pointer;
}

.search-input:focus,
.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.empty-state[hidden] {
  display: none;
}

/* Product grid / cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  background: #f3f1ec;
}

.card-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 14px;
  transition: transform 0.3s ease;
}

.card:hover .card-media img {
  transform: scale(1.03);
}

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

.card-body h3 {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
}

.article {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
}

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

.size {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.stock {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.stock.in-stock {
  color: var(--ok);
}

.stock.out-of-stock {
  color: var(--muted);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-sale {
  background: var(--sale-bg);
  color: var(--sale);
}

/* Sale strip */
.sale-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 240px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.sale-strip .card {
  scroll-snap-align: start;
}

.sale-strip::-webkit-scrollbar {
  height: 6px;
}

.sale-strip::-webkit-scrollbar-thumb {
  background: #d4d1c9;
  border-radius: 999px;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 18px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: #b0aea6;
}

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

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

.breadcrumbs [aria-current='page'] {
  color: var(--fg);
}

/* Product page */
.product-page {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: start;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.gallery > img,
#main-image {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 18px;
}

.thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 10px;
}

.thumbnail {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid var(--border);
  padding: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.thumbnail:hover {
  transform: translateY(-1px);
}

.thumbnail.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.product-info h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.product-info .article {
  margin-bottom: 16px;
}

.product-prices {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.product-prices .price {
  font-size: 1.85rem;
}

.product-prices .old-price {
  font-size: 1.1rem;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sale-bg);
  color: var(--sale);
  font-size: 0.85rem;
  font-weight: 700;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 20px;
}

.meta-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.meta-pill.muted {
  background: #eeebe4;
  color: var(--muted);
}

.note {
  font-size: 0.98rem;
  color: var(--fg);
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 16px 0 22px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.note strong {
  color: var(--accent);
  font-weight: 700;
}

.product-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.product-cta-hint {
  width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  padding: 36px 0 24px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-brand {
  max-width: 420px;
}

.footer-brand p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .container {
    width: min(1180px, 100% - 28px);
  }

  .site-main {
    padding-top: 20px;
  }

  .product-page {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gallery {
    position: static;
  }

  .footer-inner {
    align-items: flex-start;
  }
}
