:root {
  /* Основные CSS-переменные: здесь удобно уточнять палитру сайта. */
  --color-bg: #f4eee4;
  --color-bg-soft: #f9f4ec;
  --color-surface: #fffaf2;
  --color-surface-strong: #efe2d0;
  --color-text: #2b241d;
  --color-muted: #7d6c5c;
  --color-accent: #b98639;
  --color-accent-dark: #7b5523;
  --color-line: rgba(77, 58, 42, 0.18);
  --shadow-soft: 0 18px 48px rgba(66, 45, 25, 0.13);
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", Arial, sans-serif;
  --header-height: 82px;
  --page-x: clamp(18px, 4vw, 64px);
  --content-max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(43, 36, 29, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(43, 36, 29, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: var(--header-height);
  padding: 12px var(--page-x);
  border-bottom: 1px solid var(--color-line);
  background: rgba(244, 238, 228, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand__text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.header-nav a {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 0;
  font-size: 13px;
  color: var(--color-muted);
  white-space: nowrap;
}

.header-nav a::after {
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 100%;
  height: 1px;
  content: "";
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.4);
  transition: 180ms ease;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--color-text);
}

.header-nav a:hover::after,
.header-nav a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

main {
  overflow: clip;
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-height));
  display: grid;
  align-items: end;
  padding: clamp(72px, 10vw, 118px) var(--page-x) clamp(36px, 6vw, 64px);
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("../assets/images/hero/hero-collection.png");
  background-position: center;
  background-size: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(37, 28, 20, 0.64), rgba(37, 28, 20, 0.2) 54%, rgba(37, 28, 20, 0.06)),
    linear-gradient(0deg, rgba(244, 238, 228, 0.7), rgba(244, 238, 228, 0) 48%);
}

.hero__content {
  width: min(680px, 100%);
  color: #fffaf2;
}

.hero__logo {
  width: clamp(92px, 10vw, 144px);
  margin-bottom: 28px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.22));
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e7c381;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 0.95;
}

h1 {
  max-width: 12ch;
  font-size: clamp(58px, 10vw, 132px);
}

h2 {
  font-size: clamp(38px, 5vw, 76px);
}

h3 {
  font-size: clamp(28px, 3vw, 44px);
}

.hero__lead {
  max-width: 620px;
  margin: 22px 0 0;
  font-size: clamp(18px, 2.1vw, 28px);
  line-height: 1.35;
}

.hero__actions,
.product-card__actions,
.detail__actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__actions {
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button--primary {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fffaf2;
}

.button--secondary {
  border-color: var(--color-line);
  background: var(--color-surface);
}

.button--ghost {
  border-color: rgba(255, 250, 242, 0.72);
  color: #fffaf2;
}

.intro,
.catalog,
.terms,
.order,
.contacts,
.site-footer {
  padding-right: var(--page-x);
  padding-left: var(--page-x);
}

.intro {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 6vw, 92px);
  max-width: var(--content-max);
  margin: 0 auto;
  padding-top: clamp(72px, 10vw, 128px);
  padding-bottom: clamp(54px, 8vw, 94px);
}

.intro__body p,
.terms p,
.contacts p {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.75;
}

.feature-list,
.line-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 30px 0 0;
  list-style: none;
}

.feature-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-list li,
.line-list li {
  padding-top: 14px;
  border-top: 1px solid var(--color-line);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
}

.category-index {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-x) clamp(72px, 10vw, 122px);
}

.category-index a {
  display: grid;
  grid-template-columns: 54px minmax(180px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 18px;
  min-height: 64px;
  padding: 16px 0;
  border-top: 1px solid var(--color-line);
  font-family: var(--font-heading);
  font-size: clamp(27px, 3.3vw, 48px);
  line-height: 1;
}

.category-index a:last-child {
  border-bottom: 1px solid var(--color-line);
}

.category-index span,
.category-index em {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: normal;
  color: var(--color-muted);
}

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

.section-heading {
  max-width: var(--content-max);
  margin: 0 auto clamp(36px, 5vw, 58px);
}

.catalog {
  padding-top: clamp(34px, 6vw, 70px);
  padding-bottom: clamp(58px, 9vw, 110px);
  background: var(--color-bg-soft);
}

.catalog-root {
  max-width: var(--content-max);
  margin: 0 auto;
}

.category-section {
  padding: clamp(36px, 6vw, 68px) 0;
  border-top: 1px solid var(--color-line);
}

.category-section:first-child {
  border-top: 0;
}

.category-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.category-count {
  color: var(--color-muted);
  font-size: 13px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  display: grid;
  min-height: 100%;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  cursor: pointer;
  transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

.product-card:hover,
.product-card:focus-within {
  border-color: rgba(185, 134, 57, 0.55);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 4 / 3.35;
  border-bottom: 1px solid var(--color-line);
  background: #f7f1e9;
  object-fit: contain;
}

.product-card__body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.product-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--color-muted);
  font-size: 12px;
}

.product-card h3 {
  min-height: 2.2em;
  font-size: clamp(27px, 2.7vw, 36px);
}

.product-card__spec {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
}

.price-label {
  color: var(--color-accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.product-card .button {
  flex: 1 1 152px;
  min-height: 42px;
}

.detail-slot {
  grid-column: 1 / -1;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(22px, 4vw, 54px);
  margin-top: 22px;
  padding: clamp(18px, 4vw, 38px);
  border: 1px solid rgba(185, 134, 57, 0.36);
  background: #fffaf2;
  box-shadow: var(--shadow-soft);
  animation: detailIn 260ms ease both;
}

@keyframes detailIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail__media {
  display: grid;
  gap: 14px;
}

.detail__main {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: var(--color-bg-soft);
}

.detail__mobile-drawing {
  display: none;
}

.detail__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.detail__gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--color-bg-soft);
}

.detail__content {
  align-self: start;
}

.detail__content h3 {
  margin-bottom: 18px;
}

.detail__text {
  margin: 0 0 22px;
  color: var(--color-muted);
  line-height: 1.7;
}

.spec-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.spec-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-line);
  font-size: 14px;
}

.spec-row dt {
  color: var(--color-muted);
}

.spec-row dd {
  margin: 0;
  font-weight: 700;
}

.detail__actions {
  margin-top: 26px;
}

.terms,
.order,
.contacts {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-top: clamp(62px, 10vw, 118px);
  padding-bottom: clamp(54px, 8vw, 92px);
}

.terms__grid,
.contacts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 6vw, 90px);
}

.terms__grid {
  gap: 14px;
  margin-top: 34px;
}

.terms__grid article {
  min-height: 250px;
  padding: 22px;
  border-top: 1px solid var(--color-line);
  background: rgba(255, 250, 242, 0.68);
}

.terms__grid h3 {
  margin-bottom: 18px;
  font-size: clamp(26px, 2.35vw, 34px);
  line-height: 1.05;
}

.payment h3 {
  margin-bottom: 18px;
  font-size: clamp(27px, 2.8vw, 38px);
}

.terms__grid p {
  margin: 0;
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.65;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 34px 0 0;
  list-style: none;
}

.steps li {
  min-height: 138px;
  padding: 18px;
  border-top: 1px solid var(--color-line);
  background: rgba(255, 250, 242, 0.62);
  font-weight: 700;
  line-height: 1.45;
}

.steps span {
  display: block;
  margin-bottom: 22px;
  color: var(--color-accent);
  font-size: 12px;
}

.payment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 72px);
  margin-top: clamp(38px, 6vw, 64px);
}

.contacts {
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
  border-top: 1px solid var(--color-line);
}

.contact-actions {
  align-content: start;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 24px;
  padding-top: 34px;
  padding-bottom: 34px;
  border-top: 1px solid rgba(255, 250, 242, 0.16);
  color: rgba(255, 250, 242, 0.76);
  background: #2d251f;
}

.site-footer img {
  width: 182px;
  margin-bottom: 14px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 16px;
  font-size: 13px;
  color: #fffaf2;
}

.footer-note,
.copyright {
  font-size: 12px;
}

.footer-note {
  color: #d7ad67;
}

.legal-footer {
  padding: 18px var(--page-x) 22px;
  border-top: 1px solid rgba(255, 250, 242, 0.22);
  color: rgba(255, 250, 242, 0.62);
  background: #241d18;
  font-size: 12px;
  line-height: 1.6;
}

.legal-footer p {
  max-width: var(--content-max);
  margin: 0 auto;
}

.legal-footer p + p {
  margin-top: 6px;
}

.error-state,
.empty-state {
  padding: 28px;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  color: var(--color-muted);
}

.section-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    min-height: auto;
  }

  .header-nav {
    grid-column: 1 / -1;
    justify-content: start;
    order: 3;
    margin: 0 calc(var(--page-x) * -1);
    padding: 0 var(--page-x);
    border-top: 1px solid rgba(77, 58, 42, 0.1);
  }

  .intro,
  .terms__grid,
  .payment,
  .contacts,
  .detail {
    grid-template-columns: 1fr;
  }

  .detail__mobile-drawing {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--color-bg-soft);
  }

  .detail__drawing {
    display: none;
  }

  .hero {
    min-height: 78svh;
    align-items: end;
  }

  .hero__content {
    width: min(620px, 100%);
  }

  .category-index a {
    grid-template-columns: 46px minmax(180px, auto);
  }

  .category-index em {
    grid-column: 2;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terms__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terms__grid article {
    min-height: 210px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 112px;
    --page-x: 16px;
  }

  .site-header {
    grid-template-columns: auto 1fr;
    padding-top: 8px;
    padding-bottom: 0;
  }

  .brand {
    gap: 8px;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
  }

  .brand__text {
    display: inline;
    max-width: 112px;
    overflow: hidden;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-overflow: ellipsis;
  }

  .header-contact {
    justify-self: end;
    min-height: 38px;
    padding: 0 14px;
  }

  .header-nav {
    gap: 20px;
    min-height: 43px;
    align-items: center;
    padding-bottom: 2px;
  }

  .header-nav a {
    font-size: 12px;
  }

  .hero {
    min-height: calc(100svh - var(--header-height));
    padding-top: 64px;
    padding-bottom: 34px;
  }

  .hero__media {
    background-position: 58% center;
  }

  .hero::after {
    background:
      linear-gradient(90deg, rgba(37, 28, 20, 0.78), rgba(37, 28, 20, 0.34)),
      linear-gradient(0deg, rgba(244, 238, 228, 0.88), rgba(244, 238, 228, 0.04) 58%);
  }

  .hero__logo {
    width: 76px;
    margin-bottom: 18px;
  }

  h1 {
    font-size: clamp(48px, 16vw, 72px);
  }

  h2 {
    font-size: clamp(34px, 12vw, 52px);
  }

  h3 {
    font-size: clamp(27px, 9vw, 38px);
  }

  .hero__lead {
    max-width: 15em;
    margin-top: 16px;
    font-size: 18px;
  }

  .hero__actions {
    margin-top: 24px;
  }

  .category-index a {
    grid-template-columns: 38px 1fr;
    gap: 12px;
    min-height: 70px;
    padding: 14px 0;
    font-size: clamp(26px, 10vw, 38px);
  }

  .category-index em {
    grid-column: 2;
    line-height: 1.45;
  }

  .feature-list,
  .product-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .category-header {
    align-items: start;
    flex-direction: column;
  }

  .product-card__image {
    aspect-ratio: 4 / 3.1;
  }

  .product-card__body {
    padding: 16px;
  }

  .product-card h3 {
    min-height: auto;
  }

  .product-card__actions,
  .detail__actions,
  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .detail {
    margin-top: 14px;
    padding: 14px;
  }

  .detail__main {
    max-height: 520px;
  }

  .detail__gallery {
    grid-template-columns: 1fr;
  }

  .steps li {
    min-height: auto;
  }
}

@media (max-width: 420px) {
  .brand__text {
    max-width: 92px;
  }

  .header-contact {
    padding: 0 12px;
    font-size: 12px;
  }

  .hero__content {
    max-width: 100%;
  }

  .intro,
  .terms,
  .order,
  .contacts {
    padding-top: 52px;
    padding-bottom: 48px;
  }

  .category-section {
    padding: 40px 0;
  }

  .product-card__meta {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
