:root {
  --bg: #15140F;
  --surface: #1D1C15;
  --surface-2: #262419;
  --text: #EDE6D6;
  --muted: #9C9483;
  --accent: #B08D57;
  --line: #33311F;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: inherit; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.header-nav { display: flex; gap: 28px; font-size: 14px; }
.header-nav a { text-decoration: none; color: var(--muted); }
.header-nav a:hover { color: var(--text); }
.cart-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 3px;
  cursor: pointer;
}
.cart-toggle:hover { border-color: var(--accent); }
.cart-count {
  display: inline-block;
  margin-left: 6px;
  color: var(--accent);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding: 80px 48px 100px;
  max-width: 1280px;
  margin: 0 auto;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 52px;
  line-height: 1.08;
  margin: 0 0 24px;
  max-width: 12ch;
}
.hero-text p {
  color: var(--muted);
  max-width: 42ch;
  margin: 0 0 32px;
  font-size: 16px;
}
.hero-cta {
  display: inline-block;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 15px;
  padding-bottom: 3px;
}
.hero-figure {
  aspect-ratio: 4 / 5;
  background: linear-gradient(155deg, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--line);
  position: relative;
}
.hero-figure::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid var(--line);
}

/* Catalog */
.catalog { padding: 20px 48px 80px; max-width: 1280px; margin: 0 auto; }
.catalog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 32px;
}
.catalog-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  margin: 0;
}
.filters { display: flex; gap: 10px; }
.filter-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
}
.filter-btn.active { color: var(--text); border-color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 32px 24px;
}
.card { cursor: default; }
.card-image {
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.card-image::after {
  content: attr(data-initial);
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--surface-2);
}
.card-name { font-size: 15px; margin: 0 0 4px; }
.card-description {
  min-height: 63px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.add-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.add-btn:hover { text-decoration: underline; }

/* About */
.about {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 48px 100px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 15px;
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-links { display: flex; gap: 22px; align-items: center; }
.footer-links a { color: var(--text); text-underline-offset: 3px; }

/* Legal and seller information */
.legal-page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 110px;
}
.legal-eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-page h1 {
  margin: 0 0 42px;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 500;
}
.requisites-list { margin: 0; border-top: 1px solid var(--line); }
.requisites-list > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.requisites-list dt { color: var(--muted); font-size: 14px; }
.requisites-list dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.requisites-list a { color: var(--text); text-underline-offset: 3px; }
.legal-note { margin: 36px 0 0; color: var(--muted); font-size: 14px; }
.legal-copy section { margin: 0 0 38px; }
.legal-copy h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
}
.legal-copy p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.legal-copy a { color: var(--text); text-underline-offset: 3px; }

/* Cart drawer */
.drawer-overlay, .modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,7,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}
.drawer-overlay.open, .modal-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 90vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 50;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-family: var(--font-display); font-weight: 500; margin: 0; font-size: 20px; }
.drawer-close {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px;
}
.drawer-items { flex: 1; overflow-y: auto; padding: 12px 24px; }
.drawer-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.drawer-item-name { margin: 0 0 4px; }
.drawer-item-controls { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.qty-btn {
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 22px; height: 22px; border-radius: 3px; cursor: pointer; font-size: 13px; line-height: 1;
}
.drawer-empty { color: var(--muted); font-size: 14px; padding: 24px 0; }
.drawer-footer { padding: 20px 24px; border-top: 1px solid var(--line); }
.drawer-summary-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.drawer-total {
  display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 16px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.checkout-btn, .pay-btn {
  width: 100%; padding: 13px; background: var(--accent); color: #15140F;
  border: none; border-radius: 3px; font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body);
}
.checkout-btn:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* Modal */
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 1px solid var(--line);
  width: 420px; max-width: 90vw; max-height: 88vh; overflow-y: auto;
  padding: 32px; z-index: 51;
}
.modal-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px;
}
.modal h3 { font-family: var(--font-display); font-weight: 500; margin: 0 0 24px; font-size: 22px; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.modal input:not([type="checkbox"]), .modal select {
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 3px; font-family: var(--font-body); font-size: 14px;
}
.modal input:not([type="checkbox"]):focus, .modal select:focus { outline: none; border-color: var(--accent); }
.modal-breakdown {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.modal-breakdown div { display: flex; justify-content: space-between; }
.modal-total {
  display: flex; justify-content: space-between; font-size: 16px;
  padding: 4px 0 12px;
}
.modal .consent-label {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}
.consent-label input { margin: 3px 0 0; flex: 0 0 auto; }
.consent-label a { color: var(--text); text-underline-offset: 2px; }
.modal-note { font-size: 12px; color: var(--muted); margin: 0; }

@media (max-width: 780px) {
  .site-header, .hero, .catalog, .about, .site-footer { padding-left: 20px; padding-right: 20px; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 48px; }
  .hero-figure { order: -1; }
  .hero-text h1 { font-size: 38px; }
  .header-nav { display: none; }
  .site-footer { flex-direction: column; gap: 14px; }
  .footer-links { align-items: flex-start; flex-direction: column; gap: 8px; }
  .legal-page { padding-top: 48px; }
  .legal-page h1 { font-size: 38px; }
  .requisites-list > div { grid-template-columns: 1fr; gap: 6px; }
}
