/* VS Shop — базовий стиль.
   Дизайн окрема тема; це робоча основа: читабельно, швидко, мобільно. */

:root {
  --ink: #1c1a1b;
  --ink-soft: #6b6469;
  --line: #e8e2e5;
  --bg: #ffffff;
  --bg-soft: #faf7f8;
  --accent: #c2185b;
  --accent-soft: #fce4ec;
  --radius: 10px;
  --wrap: 1200px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }

/* ---------- шапка ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.search { display: flex; flex: 1; max-width: 520px; gap: 8px; }

.search input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--bg-soft);
}
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.search button,
.btn {
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
}
.search button:hover, .btn:hover { background: #a4144e; color: #fff; }
.btn:disabled { background: var(--line); color: var(--ink-soft); cursor: not-allowed; }

.cart-link { font-weight: 600; white-space: nowrap; }

/* ---------- меню ---------- */
.site-nav { border-top: 1px solid var(--line); background: var(--bg-soft); }

.nav-root {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  list-style: none;
  margin: 0;
  padding: 10px 0;
}
.nav-root > li > a { font-weight: 600; font-size: 15px; display: inline-block; padding: 4px 0; }
.nav-root > li.is-active > a { color: var(--accent); }

.nav-sub { display: none; }

@media (min-width: 900px) {
  .nav-root > li { position: relative; }
  .nav-root > li:hover .nav-sub, .nav-root > li:focus-within .nav-sub {
    display: block;
    position: absolute;
    top: 100%;
    left: -14px;
    z-index: 20;
    min-width: 210px;
    padding: 8px;
    margin: 0;
    list-style: none;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(28, 26, 27, .1);
  }
  .nav-sub a { display: block; padding: 7px 12px; border-radius: 6px; font-size: 15px; }
  .nav-sub a:hover { background: var(--accent-soft); }
}

/* ---------- сторінка ---------- */
main { padding: 28px 20px 56px; min-height: 60vh; }

.hero { padding: 24px 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.hero p { margin: 0; color: var(--ink-soft); max-width: 62ch; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0 16px;
}
.section-head h1, .section-head h2 { margin: 0; font-size: 22px; }
.section-head h1 { font-size: 26px; }

/* ---------- панель фільтрів ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.filters, .sorts { display: flex; flex-wrap: wrap; gap: 8px; }

.chip, .sort {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  background: var(--bg);
  white-space: nowrap;
}
.chip:hover, .sort:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active, .sort.is-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.chip-n { opacity: .65; font-size: 12px; }

/* ---------- сітка карток ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 26px 20px;
}

.card-link { display: block; height: 100%; }

.card-media {
  position: relative;
  /* Похідні — квадратні (вписані в біле полотно), тому й контейнер квадратний:
     нічого не обрізається, а сітка лишається рівною. */
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-media { box-shadow: 0 8px 22px rgba(28, 26, 27, .1); }

.card-placeholder {
  font-size: 52px;
  font-weight: 700;
  color: #d8ccd2;
  user-select: none;
}
.card-placeholder.big { font-size: 120px; }

.card-body { padding: 11px 2px 0; }
.card-brand {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.card-title { margin: 3px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.card-subtitle { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); }
.card-price { margin: 6px 0 0; font-size: 16px; font-weight: 700; }
.card-variants { margin: 3px 0 0; font-size: 12px; color: var(--ink-soft); }
.cur { font-weight: 400; font-size: .85em; color: var(--ink-soft); }

.cat-tiles {
  display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0;
}
.cat-tiles a {
  display: inline-block; padding: 9px 16px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; font-size: 15px; font-weight: 500;
}
.cat-tiles a:hover { border-color: var(--accent); }

/* ---------- пагінація ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin: 42px 0 0; padding-top: 24px; border-top: 1px solid var(--line);
}
.pager a { font-weight: 600; }
.pager-now { color: var(--ink-soft); font-size: 14px; }

.empty { padding: 60px 0; text-align: center; color: var(--ink-soft); }

/* ---------- картка товару ---------- */
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--ink-soft); margin-bottom: 20px; }

.product { display: grid; gap: 34px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .product { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 48px; } }

.gallery-main {
  aspect-ratio: 1 / 1; background: var(--bg-soft); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 82px; height: 82px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.product-brand {
  margin: 0; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.product-info h1 { margin: 6px 0 4px; font-size: clamp(22px, 3vw, 30px); line-height: 1.2; }
.product-subtitle { margin: 0 0 14px; color: var(--ink-soft); }
.product-price { margin: 18px 0 22px; font-size: 27px; font-weight: 700; }

.chooser { border: 0; padding: 0; margin: 0 0 18px; }
.chooser legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }

.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span {
  display: inline-block; padding: 8px 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; cursor: pointer; background: var(--bg);
}
.option input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.option.is-unavailable span { opacity: .38; text-decoration: line-through; cursor: not-allowed; }

.buy-btn { margin-top: 6px; padding: 13px 30px; font-size: 16px; }
.buy-note { margin: 10px 0 0; font-size: 14px; color: var(--accent); min-height: 1.2em; }

.product-description { margin: 26px 0; line-height: 1.65; }

.specs { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; }
.specs summary { cursor: pointer; font-weight: 600; }
.variants { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.variants th, .variants td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.variants th { color: var(--ink-soft); font-weight: 600; }

.notice { padding: 70px 0; text-align: center; }
.notice h1 { margin: 0 0 10px; }

/* ---------- підвал ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 30px 0;
  font-size: 14px;
}
.site-footer p { margin: 0 0 5px; }

.gallery-thumbs img { cursor: pointer; opacity: .78; transition: opacity .15s, border-color .15s; }
.gallery-thumbs img:hover { opacity: 1; }
.gallery-thumbs img.is-current { opacity: 1; border-color: var(--accent); }

/* ---------- кошик і оформлення ---------- */
.cart-count {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-align: center;
}

.cart { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .cart { grid-template-columns: minmax(0, 1fr) 320px; } }

.cart-line {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: 72px 1fr auto;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) {
  .cart-line { grid-template-columns: 72px 1fr 90px 120px auto; }
}
.cart-line.is-gone { opacity: .6; }

.cart-thumb {
  width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .card-placeholder { font-size: 26px; }

.cart-title { font-weight: 600; display: block; }
.cart-variant { margin: 3px 0 0; font-size: 13px; color: var(--ink-soft); }
.cart-gone { margin: 4px 0 0; font-size: 13px; color: var(--accent); }

.cart-qty input {
  width: 66px; padding: 7px 9px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px; font-size: 15px;
}
.cart-sum { text-align: right; }
.cart-price { font-weight: 700; display: block; }
.cart-unit { font-size: 12px; color: var(--ink-soft); }

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--ink-soft); font-size: 13px; text-decoration: underline;
}
.link-btn:hover { color: var(--accent); }

.cart-summary, .checkout-summary {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; background: var(--bg-soft);
}
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-total { font-size: 19px; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--line); }
.summary-note { font-size: 13px; color: var(--ink-soft); margin: 10px 0 16px; }
.btn.wide { display: block; width: 100%; text-align: center; padding: 13px; }
.link-back { display: block; text-align: center; margin-top: 12px; font-size: 14px; color: var(--ink-soft); }

.checkout { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .checkout { grid-template-columns: minmax(0, 1fr) 340px; } }

.block { border: 0; padding: 0; margin: 0 0 28px; }
.block legend { padding: 0; font-size: 17px; font-weight: 700; margin-bottom: 12px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; margin-bottom: 5px; color: var(--ink-soft); }
.field .opt { display: inline; color: var(--ink-soft); font-size: 13px; }
.field input, .field textarea {
  width: 100%; padding: 10px 13px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field.has-error input, .field.has-error textarea { border-color: var(--accent); }
.field em, .radio-list em { display: block; margin-top: 5px; font-size: 13px; color: var(--accent); font-style: normal; }

.radio-list { margin-bottom: 14px; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; cursor: pointer; }
.radio-row input { margin-top: 3px; }
.radio-row .hint { display: block; font-size: 13px; color: var(--ink-soft); font-style: normal; margin-top: 2px; }

.form-error-banner {
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--accent-soft); color: #8e1345; margin-bottom: 20px;
}

.summary-items { list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; }
.summary-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.si-name em { display: block; font-style: normal; font-size: 12px; color: var(--ink-soft); }
.si-qty, .si-sum { color: var(--ink-soft); white-space: nowrap; }

/* ---------- сторінка замовлення ---------- */
.order-done { padding: 20px 0 40px; }
.order-badge {
  display: inline-block; margin: 0 0 8px; padding: 5px 14px;
  background: var(--accent-soft); color: #8e1345;
  border-radius: 999px; font-size: 13px; font-weight: 600;
}
.order-done h1 { margin: 0 0 6px; }
.order-grid { display: grid; gap: 32px; grid-template-columns: 1fr; margin: 32px 0; }
@media (min-width: 800px) { .order-grid { grid-template-columns: 1fr 1fr; } }
.order-block h2 { font-size: 16px; margin: 0 0 12px; }
.order-items { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-items td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.order-items .num { text-align: right; white-space: nowrap; }
.order-items tfoot td { border-bottom: 0; padding-top: 12px; }
.order-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.order-facts dt { color: var(--ink-soft); }
.order-facts dd { margin: 0; }
.order-keep { font-size: 14px; color: var(--ink-soft); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- підказки Нової Пошти ---------- */
.np-field { position: relative; }
.np-field label { display: block; }
.np-field label span { display: block; font-size: 14px; margin-bottom: 5px; color: var(--ink-soft); }

.np-suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
  margin: 4px 0 0; padding: 5px; list-style: none;
  max-height: 280px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 28px rgba(28, 26, 27, .13);
}
.np-option {
  padding: 9px 12px; border-radius: 6px; cursor: pointer;
  font-size: 14px; line-height: 1.35;
}
.np-option:hover { background: var(--accent-soft); color: var(--accent); }

.np-option-label { display: block; }
.np-option-note {
  display: block; margin-top: 2px;
  font-size: 12px; color: #a4144e;
}
.np-option.is-restricted .np-option-label { color: var(--ink-soft); }
.np-note {
  margin: 7px 0 0; padding: 8px 12px;
  background: var(--accent-soft); color: #8e1345;
  border-radius: 8px; font-size: 13px;
}

/* ---------- смужка-повідомлення вгорі ---------- */
.site-notice {
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.site-notice .wrap { padding-top: 9px; padding-bottom: 9px; }

.site-notice--warning {
  background: #4a2233;
  color: #ffe3ee;
}
.site-notice--plain {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
