/*  Основа  */
:root {
  --ink: #121212;
  --muted: #524f48;
  --burgundy: #4e0c1b;
  --gold: #c59e5f;
  --gold-text: #8a6a2f;       /* золотой для текста на светлом фоне: контраст не ниже 4,5 : 1 */
  --gold-light: #d5b27a;
  --cream: #faf9f5;
  --line: #e2ddd3;
  --soft: #c8c4bc;
  --field-border: #d7c4c8;
  --placeholder: #6a6263;
  --error: #ffc9c9;
  --pad: clamp(1.25rem, 5.5vw, 5rem);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 7vw, 4rem); }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: 1.75rem; line-height: 1.2; }

:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }
.on-dark :focus-visible, .form-panel :focus-visible, .hero :focus-visible, .site-footer :focus-visible {
  outline-color: var(--gold-light);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--burgundy); color: #fff; padding: .75rem 1rem;
}
.skip-link:focus { top: 1rem; }

.section { padding: clamp(3rem, 8vw, 7rem) var(--pad); }
.section--cream { background: var(--cream); }
.section__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; margin-bottom: clamp(2rem, 5vw, 4rem);
}
.lead { color: var(--muted); font-size: 1rem; max-width: 48rem; margin-top: 1rem; }
.eyebrow {
  font-size: .8125rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--gold-text); font-family: var(--sans); line-height: 1.55;
}

/*  Кнопки  */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .75rem;
  padding: 1rem 2.25rem; border: 1px solid var(--gold);
  font: 600 .8125rem/1.2 var(--sans); text-transform: uppercase; text-decoration: none;
  cursor: pointer; background: var(--burgundy); color: #fff;
}
.btn:hover { background: #6a1226; }
.btn--light { background: var(--cream); color: var(--burgundy); }
.btn--light:hover { background: #fff; }
.btn--small { padding: .75rem 1.25rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn img { width: 12px; height: 12px; }

/*  Шапка  */
.site-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand tools" "nav nav";
  align-items: center; gap: .75rem 1rem;
  padding: 1rem var(--pad); border-bottom: 1px solid var(--line); background: #fff;
}
.brand {
  grid-area: brand; display: inline-flex; align-items: center; gap: .5rem;
  font: 400 clamp(1.25rem, 4vw, 2.5rem)/1.4 var(--serif); text-decoration: none; justify-self: start; min-width: 0;
}
.brand img { width: 24px; height: 24px; flex: none; }
.site-nav { grid-area: nav; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.site-nav a, .tools a { font-size: .8125rem; font-weight: 500; text-decoration: none; }
.site-nav a:hover, .tools a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--burgundy); font-weight: 700; }
.tools { grid-area: tools; display: flex; align-items: center; gap: .75rem; }
.tools .lang { display: none; font-size: .8125rem; font-weight: 500; color: var(--muted); }
.tools img { width: 20px; height: 20px; }
.tools a { display: inline-flex; align-items: center; gap: .25rem; }
.cart-link { color: var(--burgundy); font-weight: 600; }

@media (min-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "nav brand tools"; padding-block: 2rem;
  }
  .brand { justify-self: center; }
  .tools { justify-self: end; gap: 1.5rem; }
  .tools .lang { display: inline; }
}

/* Главная */
.hero {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6rem;
  min-height: min(55rem, 85vh); padding: clamp(3rem, 8vw, 7.5rem) var(--pad) clamp(2rem, 5vw, 5rem);
  color: #fff;
  background: linear-gradient(rgba(18, 18, 18, .5), rgba(18, 18, 18, .5)) , url("../img/hero.png") center / cover #2a2623;
}
.hero h1 { font-size: clamp(2.75rem, 8vw, 5.5rem); line-height: .95; max-width: 40rem; }
.hero__intro { max-width: 26rem; display: grid; gap: 1.25rem; justify-items: start; }

.manifesto { display: grid; justify-items: center; gap: 2.5rem; text-align: center; }
.manifesto img { width: 48px; height: 48px; }
.manifesto p { max-width: 60rem; font: 400 clamp(1.5rem, 3.5vw, 2.5rem)/1.4 var(--serif); }

.divider { display: flex; align-items: center; gap: 1.5rem; padding: 2rem var(--pad); }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.divider img { width: 32px; height: 32px; }

/*  Сетка карточек  */
.grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.grid--centered {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 24rem));
  justify-content: center;
}

.card { display: flex; flex-direction: column; gap: 1.25rem; }
.card__media { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #ece8de; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__text { font-size: .875rem; color: var(--muted); }
.card__price { font-weight: 600; }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: .5rem; flex-wrap: wrap; }
.card__color { font-size: .8125rem; color: var(--muted); }

/*  Состояния загрузки  */
.state { padding: 2.5rem 1rem; text-align: center; display: grid; justify-items: center; gap: 1rem; color: var(--muted); }
.state[data-type="error"] { color: var(--burgundy); }
.state[data-type="loading"] p::before {
  content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .6em;
  border: 2px solid var(--line); border-top-color: var(--burgundy); border-radius: 50%;
  vertical-align: -.1em; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .state[data-type="loading"] p::before { animation: none; } }

/*  Каталог: фильтры  */
.filters { display: grid; gap: 2rem; }
.filters__group { display: grid; gap: 1rem; align-content: start; }
.filters__group > legend, .filters__group > .eyebrow { padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-list { display: grid; gap: .75rem; max-width: 20rem; }
.choice {
  display: flex; justify-content: space-between; gap: 1rem; width: 100%;
  padding: .875rem 1rem; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: 400 .875rem/1.4 var(--sans); cursor: pointer; text-align: left;
}
.choice[aria-pressed="true"] { background: var(--burgundy); border-color: var(--gold); color: #fff; font-weight: 600; }
.choice span:last-child { font-size: .8125rem; opacity: .85; }
.swatches { display: flex; flex-wrap: wrap; gap: .75rem; }
.swatch {
  display: grid; justify-items: center; gap: .5rem; padding: .25rem; min-width: 3rem;
  border: 0; background: none; font: 400 .75rem/1.3 var(--sans); color: var(--muted); cursor: pointer;
}
.swatch i { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--field-border); }
.swatch[aria-pressed="true"] i { outline: 2px solid var(--burgundy); outline-offset: 2px; }
.swatch[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.toolbar { display: grid; gap: 1rem; }
.toolbar label { display: grid; gap: .5rem; }

select, input[type="search"], input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], textarea {
  width: 100%; padding: .875rem 1rem; border: 1px solid var(--field-border);
  border-radius: 0; background: #fff; color: var(--ink); font: 400 .875rem/1.5 var(--sans);
}
textarea { min-height: 7.5rem; resize: vertical; }
::placeholder { color: var(--placeholder); opacity: 1; }
.toolbar select, .toolbar input { border-color: var(--gold); }

@media (min-width: 900px) {
  .filters { grid-template-columns: 20rem 1fr auto; align-items: start; gap: 4rem; }
  .toolbar { width: 16rem; }
}

/*  Карточка товара  */
.product { display: grid; gap: 2.5rem; }
.product__image { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; background: #ece8de; }
.product__info { display: grid; gap: 1.5rem; align-content: start; }
.product__price { font-size: 1.75rem; font-weight: 600; }
.currency { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.currency select { width: auto; }
.note { font-size: .8125rem; color: var(--muted); min-height: 1.25rem; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.5rem; font-size: .875rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.buy-form { display: grid; gap: 1.25rem; }
.buy-form fieldset { display: grid; gap: .75rem; }
.buy-form legend { padding: 0; margin-bottom: .75rem; }
.size-options { display: flex; flex-wrap: wrap; gap: .75rem; }
.size-option { position: relative; }
.size-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.size-option span {
  display: grid; place-items: center; min-width: 3.25rem; height: 3.25rem; padding: 0 .75rem;
  border: 1px solid var(--field-border); font-weight: 600; background: #fff;
}
.size-option input:checked + span { background: var(--burgundy); color: #fff; border-color: var(--gold); }
.size-option input:focus-visible + span { outline: 2px solid var(--burgundy); outline-offset: 3px; }
.qty { width: 6rem; }

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

.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .875rem; }
caption { text-align: left; padding-bottom: .75rem; color: var(--muted); }
th, td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
thead th { background: var(--cream); font-weight: 700; }
.two-col { display: grid; gap: 3rem; }
.two-col > *, .product > *, .checkout > *, .form-grid > * { min-width: 0; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 4rem; } }

/*  Формы  */
.form-panel { background: var(--burgundy); color: #fff; padding: clamp(1.5rem, 5vw, 3rem); border-radius: 4px; }
.form-panel h2, .form-panel h3 { color: #fff; }
.form-panel .hint, .form-panel .lead { color: #e4d9da; }
.form-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .form-grid--split { grid-template-columns: 26rem 1fr; gap: 3.5rem; } }
.form-fields { display: grid; gap: 1.25rem; }
.field { display: grid; gap: .5rem; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-size: .875rem; padding: 0; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #ff7a7a; outline: 2px solid #ff7a7a; }
.field__error { font-size: .8125rem; color: var(--error); font-weight: 600; }
.field__error[hidden] { display: none; }
.hint { font-size: .75rem; }
.form-status { font-size: .875rem; min-height: 1.3rem; }
.form-status[data-type="error"] { color: var(--error); font-weight: 600; }
.form-status[data-type="ok"] { color: #fff; font-weight: 600; }
.form-panel .btn { background: #fff; color: var(--burgundy); border-color: #fff; justify-self: start; }
.form-panel .btn:hover { background: var(--cream); }
.form-panel a { color: #fff; }

.choice-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.choice-row label { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; }
.choice-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--gold); }

.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .25rem; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2rem; line-height: 1; cursor: pointer; color: #d7c4c8; padding: 0 .1rem; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--gold-light); }
.stars input:focus-visible + label { outline: 2px solid var(--gold-light); outline-offset: 2px; }

/*  Отзывы  */
.reviews-head { display: grid; justify-items: center; gap: 1.25rem; margin-bottom: 3rem; text-align: center; }
.reviews-head img { width: 48px; height: 48px; }
.empty-box {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem); text-align: center; margin-bottom: 3rem;
  display: grid; gap: 1rem;
}
.empty-box h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.empty-box p { color: var(--muted); }
.review-list { display: grid; gap: 1.5rem; margin-bottom: 3rem; }
.review { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1.5rem; display: grid; gap: .5rem; }
.review__stars { color: var(--gold-text); letter-spacing: .1em; }
.review__meta { font-size: .8125rem; color: var(--muted); }

/*  Корзина и заказ  */
.cart-list { display: grid; gap: 1.25rem; }
.cart-item { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.cart-item img { width: 5rem; aspect-ratio: 3 / 4; object-fit: cover; }
.cart-item__body { display: grid; gap: .5rem; }
.cart-item__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.cart-item__meta { font-size: .8125rem; color: var(--muted); }
.link-button { background: none; border: 0; padding: .25rem 0; font: inherit; font-size: .8125rem; color: var(--burgundy); text-decoration: underline; cursor: pointer; }
.totals { display: grid; gap: .5rem; margin-top: 1.5rem; max-width: 24rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals .total { font-weight: 700; font-size: 1.25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.checkout { display: grid; gap: 3rem; }
@media (min-width: 960px) { .checkout { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; } }
.notice { border: 1px solid var(--gold); background: var(--cream); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.terms { margin-top: 3rem; display: grid; gap: .75rem; max-width: 48rem; }
.terms ul { list-style: disc; padding-left: 1.25rem; color: var(--muted); display: grid; gap: .5rem; }

/*  Аккаунт и заказы  */
.order { border: 1px solid var(--line); padding: 1.25rem; display: grid; gap: .75rem; }
.order ul { display: grid; gap: .25rem; font-size: .875rem; }
.order__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-weight: 600; }
.orders { display: grid; gap: 1rem; margin-top: 1.5rem; }

/*  Контакты  */
address { font-style: normal; display: grid; gap: .5rem; }
.contact-phone { font-size: 1.5rem; font-weight: 600; text-decoration: none; }

/*  Подвал  */
.site-footer { background: var(--ink); color: var(--soft); padding: clamp(3rem, 8vw, 6rem) var(--pad) 3rem; }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; } }
.footer-brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--gold); font: 600 clamp(1.75rem, 4vw, 2.25rem)/1.2 var(--serif); text-decoration: none; }
.footer-brand img { width: 32px; height: 32px; }
.site-footer p.about { margin-top: 1rem; max-width: 30rem; font-size: .875rem; opacity: .8; }
.site-footer h2 { font: 700 .75rem/1.55 var(--sans); text-transform: uppercase; color: var(--gold-light); margin-bottom: 1rem; }
.site-footer ul { display: grid; gap: .75rem; font-size: .875rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-phone { color: #fff; font-size: 1.125rem; font-weight: 600; display: inline-block; margin: .5rem 0; }
.socials { display: flex; gap: 1rem; margin-top: .75rem; }
.socials img { width: 20px; height: 20px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #2c2c2c; font-size: .75rem; }
.footer-bottom p { opacity: .7; }
.footer-bottom div { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/*  Вспомогательные  */
.mt-lg { margin-top: 3rem; }
