:root {
  --ink: #12352c;
  --ink-soft: #2a4f44;
  --mist: #e7eef0;
  --paper: #f4f7f6;
  --panel: #ffffff;
  --line: #c9d5d1;
  --accent: #1f7a68;
  --accent-deep: #0f5a4b;
  --warn: #9a3412;
  --ok: #166534;
  --shadow: 0 18px 50px rgba(18, 53, 44, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 122, 104, 0.08), transparent 28%),
    linear-gradient(180deg, #f7faf9 0%, var(--mist) 45%, #eef4f2 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
.container { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.narrow { width: min(640px, calc(100% - 2rem)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(244, 247, 246, 0.88);
  border-bottom: 1px solid rgba(201, 213, 209, 0.7);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(18, 53, 44, 0.08);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.15rem; }
.brand-text small { color: var(--ink-soft); font-size: .78rem; letter-spacing: .04em; }

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav a:not(.btn), .linkish {
  color: var(--ink-soft);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.nav a:not(.btn):hover, .linkish:hover { color: var(--ink); }
.nav a.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #f4fffb;
}
.nav a.btn:hover { color: #fff; }
.nav-cart span {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: .35rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: .75rem;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
}
.inline-form { display: inline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.35rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #f4fffb;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 90, 75, 0.22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-sm { padding: .55rem 1rem; font-size: .92rem; }

.hero {
  position: relative;
  min-height: min(88vh, 760px);
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  background-color: #1a2c28;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 20, 0.7);
}
.hero-overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 0 4rem;
}
.hero-copy {
  max-width: 720px;
  color: #f5fffb;
  text-align: center;
}
.hero-brand {
  margin: 0 0 .8rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
}
.hero-copy h1 {
  margin: 0 auto 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.35rem);
  line-height: 1.2;
  max-width: 22ch;
}
.hero-lead {
  margin: 0 auto 1.6rem;
  font-size: 1.08rem;
  color: rgba(245, 255, 251, 0.86);
  max-width: 36ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.hero-actions .btn-ghost { color: #f5fffb; border-color: rgba(245,255,251,.4); }

@keyframes heroDrift {
  from { transform: scale(1.04) translate3d(0,0,0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.section { padding: 4rem 0; }
.section-alt { background: rgba(255,255,255,.45); }
.section-head { margin-bottom: 1.8rem; max-width: 42rem; }
.section-head h1, .section-head h2, .auth-card h1 {
  font-family: var(--font-display);
  margin: 0 0 .55rem;
  letter-spacing: -0.02em;
}
.section-head p, .muted, .lead { color: var(--ink-soft); }

.category-lead { max-width: 46rem; line-height: 1.6; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.category-card {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: .45rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 108px;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, z-index 0s;
}
.category-card:hover, .category-card:focus-visible {
  z-index: 4;
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--ink);
}
.category-card strong { font-family: var(--font-display); font-size: 1.15rem; }
.category-hint { color: var(--ink-soft); font-size: .88rem; }
.category-popup {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 5;
  padding: .9rem 1rem;
  background: #fff;
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 400;
  line-height: 1.45;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(24, 42, 38, .16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.category-popup::before {
  content: "";
  position: absolute;
  left: 1.35rem;
  bottom: 100%;
  border: 8px solid transparent;
  border-bottom-color: var(--line);
}
.category-popup::after {
  content: "";
  position: absolute;
  left: 1.45rem;
  bottom: 100%;
  border: 7px solid transparent;
  border-bottom-color: #fff;
}
.category-card:hover .category-popup,
.category-card:focus-visible .category-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.category-checks { display: grid; gap: .45rem; padding: .6rem 0; }
.category-price-list { display: grid; gap: .55rem; padding: .6rem 0; }
.category-price-row {
  display: grid;
  grid-template-columns: 1fr minmax(8rem, 10rem);
  gap: .6rem;
  align-items: center;
}
.category-price-row input[type="number"] { width: 100%; }
.category-tags a { color: inherit; text-decoration: none; }
.category-tags a:hover { text-decoration: underline; }
.category-edit { display: grid; gap: .7rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: var(--panel);
  border: 1px solid rgba(201,213,209,.8);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease;
}
.product-card:hover { transform: translateY(-4px); }
.product-media {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #dfe8e5;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.product-card:hover .product-media img { transform: scale(1.05); }
.product-body { padding: 1rem 1.05rem 1.2rem; }
.product-body h3 { margin: .2rem 0 .55rem; font-size: 1.05rem; font-family: var(--font-display); }
.product-body h3 a { text-decoration: none; color: inherit; }
.product-body p { margin: 0 0 .8rem; color: var(--ink-soft); font-size: .95rem; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  color: var(--accent-deep);
}
.product-meta { display: flex; gap: .7rem; align-items: baseline; }
.product-meta s { color: #7a8a84; }

.filter-bar, .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1.5rem;
}
.filter-bar input, .filter-bar select,
.form-stack input, .form-stack select, .form-stack textarea,
.data-table input, .inline-edit input, .buy-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .9rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.data-table .qty-input {
  width: 5.2rem;
  min-width: 5.2rem;
  max-width: 5.2rem;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}
.cart-item:hover { color: var(--accent-deep); }
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  background: #d9e4e0;
  flex-shrink: 0;
}
.cart-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.15rem 0 0;
}
.cart-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-left: auto;
}
.form-stack { display: grid; gap: 1rem; }
.form-stack label, .buy-form label { display: grid; gap: .35rem; font-weight: 500; }
.auth-card, .checkout-summary {
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.checkout-summary .line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--line);
}
.checkout-summary .total { border-bottom: 0; margin-top: .4rem; }

.product-page {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 2rem;
  align-items: start;
}
.product-gallery {
  display: grid;
  gap: .7rem;
}
.gallery-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #d9e4e0;
  min-height: 360px;
}
.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 360px;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 22, 20, 0.65);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.gallery-prev { left: .7rem; }
.gallery-next { right: .7rem; }
.gallery-thumbs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #d9e4e0;
  cursor: pointer;
}
.gallery-thumb.is-active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}
.gallery-admin-item {
  display: grid;
  gap: .35rem;
  width: 140px;
}
.gallery-admin-item img {
  width: 110px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
}
.variant-picker {
  display: grid;
  gap: .55rem;
  margin: 1rem 0 1.2rem;
}
.variant-option {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.variant-option.is-hint {
  z-index: 4;
}
.variant-option.is-hint .category-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.variant-option .category-popup::before {
  left: 50%;
  margin-left: -8px;
}
.variant-option .category-popup::after {
  left: 50%;
  margin-left: -7px;
}
.variant-option input {
  width: auto;
  margin: 0;
}
.variant-option.is-selected,
.variant-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.variant-price { color: var(--accent-deep); white-space: nowrap; }
.buy-form input[type="radio"] { width: auto; }
.stock.ok { color: var(--ok); }
.stock.out { color: var(--warn); }
.buy-form { display: flex; gap: .8rem; align-items: end; margin-top: 1.2rem; }
.buy-form label { min-width: 120px; }
.product-categories {
  margin: 1.1rem 0 1.3rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.7);
}
.product-categories h2 {
  margin: 0 0 .8rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.product-category { margin: 0 0 .85rem; }
.product-category:last-child { margin-bottom: 0; }
.product-category a { font-weight: 600; text-decoration: none; }
.product-category p { margin: .3rem 0 0; color: var(--ink-soft); line-height: 1.5; }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: .85rem .9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.data-table th { background: rgba(31,122,104,.08); font-weight: 600; }
.badge {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(31,122,104,.12);
  color: var(--accent-deep);
  font-size: .85rem;
}
.flashes { padding-top: 1rem; }
.flash {
  padding: .85rem 1rem;
  border-radius: 12px;
  margin-bottom: .6rem;
}
.flash-ok { background: #e8f7ee; color: var(--ok); }
.flash-err { background: #fdeceb; color: var(--warn); }
.prose p { line-height: 1.65; }
.prose h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 1.6rem 0 .6rem; }
.legal-page .prose { background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem 1.5rem 1.8rem; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.25rem;
  align-items: start;
}
.contact-card {
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.contact-card h2 { font-family: var(--font-display); margin: 0 0 1rem; }
.contact-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.contact-list li { display: grid; gap: .15rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.contact-list span { color: var(--ink-soft); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.contact-item-row {
  display: grid;
  grid-template-columns: 1fr 140px 1.2fr auto auto;
  gap: .6rem;
  align-items: end;
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--line);
}
.mt { margin-top: 2rem; }
.danger { color: var(--warn); }
.actions { display: flex; gap: .8rem; align-items: center; }
.check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.stock-field {
  display: grid;
  gap: .35rem;
  font-weight: 500;
  min-width: 12rem;
}
.stock-field-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.stock-field-head .check {
  font-weight: 400;
  font-size: .92em;
}
.stock-field.is-unlimited [data-stock-qty-wrap] {
  display: none;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  background: rgba(255,255,255,.4);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}
.brand-foot {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 .4rem;
}
.reviews-layout {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 1.5rem;
  align-items: start;
}
.reviews-list { display: grid; gap: 1rem; }
.review-card, .review-form-card {
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.review-card header {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  margin-bottom: .55rem;
}
.review-card p { margin: 0 0 .6rem; }
.review-form-card h2 { margin: 0 0 .7rem; font-family: var(--font-display); font-size: 1.25rem; }
.stars { letter-spacing: .08em; color: #c9d5d1; }
.stars .is-on { color: #d4a017; }
.star-input { border: 0; padding: 0; margin: 0; }
.star-input legend { font-weight: 500; margin-bottom: .35rem; }
.star-input-row {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: .1rem;
}
.star-input-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.star-input-row label {
  font-size: 1.85rem;
  line-height: 1;
  color: #c9d5d1;
  cursor: pointer;
}
.star-input-row label:hover,
.star-input-row label:hover ~ label,
.star-input-row input:checked ~ label,
.star-input-row input:focus-visible + label {
  color: #d4a017;
}
.vk-widget {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  width: 168px;
  padding: .75rem .7rem .8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(24, 42, 38, .16);
  text-decoration: none;
  color: var(--ink);
  text-align: center;
}
.vk-widget-qr {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0 auto .5rem;
  border-radius: 8px;
}
.vk-widget-logo {
  display: none !important;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  line-height: 0;
}
.vk-widget-logo svg {
  display: block;
  width: 56px;
  height: 56px;
}
.vk-widget-label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
}
.vk-widget small {
  display: block;
  margin-top: .15rem;
  color: var(--ink-soft);
  font-size: .75rem;
}
.contact-qr {
  display: block;
  margin-top: .55rem;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.admin-body { background: #edf2f0; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-aside {
  background: var(--ink);
  color: #e8f4ef;
  padding: 1.4rem 1rem;
}
.admin-aside a { color: #d7ebe3; text-decoration: none; display: block; padding: .55rem .7rem; border-radius: 10px; }
.admin-aside a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-aside .brand { margin-bottom: 1.4rem; color: #fff; }
.admin-aside .brand-text small { color: #9fc3b7; }
.admin-main { padding: 1.4rem; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}
.admin-top h1 { margin: 0; font-family: var(--font-display); font-size: 1.6rem; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}
.stat span { color: var(--ink-soft); display: block; margin-bottom: .35rem; }
.stat strong { font-size: 1.6rem; font-family: var(--font-display); }
.admin-form, .toolbar { margin-bottom: 1.2rem; }
.thumb { width: 120px; border-radius: 12px; }
.inline-edit {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto 90px auto auto;
  gap: .5rem;
  align-items: center;
  margin-bottom: .4rem;
}

@media (max-width: 900px) {
  .product-page, .footer-grid, .admin-shell, .stats-grid, .contact-grid, .reviews-layout { grid-template-columns: 1fr; }
  .vk-widget {
    right: .7rem;
    bottom: .7rem;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .vk-widget-qr,
  .vk-widget-hint,
  .vk-widget-label {
    display: none !important;
  }
  .vk-widget-logo {
    display: block !important;
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 8px 18px rgba(0, 80, 180, .35));
  }
  .admin-aside { position: sticky; top: 0; z-index: 5; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav {
    display: none;
    position: absolute;
    right: 1rem;
    top: 72px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .hero { min-height: 78vh; }
  .inline-edit, .contact-item-row { grid-template-columns: 1fr; }
}
