:root {
  --ink: #20231f;
  --muted: #696d65;
  --paper: #f5f0e8;
  --surface: #fffdf9;
  --line: #ded6ca;
  --olive: #536148;
  --terracotta: #a95f40;
  --terracotta-dark: #83442d;
  --shadow: 0 24px 65px rgba(53, 43, 31, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select { font: inherit; }
img { display: block; max-width: 100%; }

.catalog-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
  padding: 12px clamp(20px, 5vw, 76px);
  background: rgba(255, 253, 249, .96);
  border-bottom: 1px solid rgba(83, 97, 72, .14);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}
.brand img { width: 150px; height: auto; }
.catalog-header nav { display: flex; justify-content: center; gap: 30px; }
.catalog-header nav a, .header-actions a { text-decoration: none; font-size: 14px; font-weight: 650; }
.catalog-header nav a { padding: 10px 0; border-bottom: 2px solid transparent; }
.catalog-header nav a:hover, .catalog-header nav a.active { color: var(--terracotta-dark); border-bottom-color: var(--terracotta); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.supplier-link, .cabinet-link, .hero-action, .catalog-consultation > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
}
.supplier-link { color: var(--olive); border: 1px solid var(--olive); }
.cabinet-link, .hero-action, .catalog-consultation > a { color: white; background: var(--terracotta); }
.cabinet-link:hover, .hero-action:hover, .catalog-consultation > a:hover { background: var(--terracotta-dark); }

main { overflow: hidden; }
.catalog-hero {
  max-width: 1320px;
  min-height: 475px;
  margin: 0 auto;
  padding: clamp(78px, 10vw, 138px) clamp(22px, 7vw, 100px);
  position: relative;
  isolation: isolate;
}
.catalog-hero::before, .catalog-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  z-index: -1;
}
.catalog-hero::before {
  width: 480px;
  height: 480px;
  right: 2%;
  top: 12px;
  background: radial-gradient(circle at 35% 30%, #e6b79f, #a75f42 56%, #6d3e2d);
  opacity: .88;
  box-shadow: var(--shadow);
}
.catalog-hero::after {
  width: 265px;
  height: 410px;
  right: 19%;
  top: 46px;
  border: 1px solid rgba(255,255,255,.65);
  background: linear-gradient(140deg, rgba(255,255,255,.42), rgba(83,97,72,.26));
  transform: rotate(23deg);
  backdrop-filter: blur(2px);
}
.catalog-hero h1 {
  max-width: 760px;
  margin: 10px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 6.2vw, 84px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.045em;
}
.catalog-hero > p:not(.eyebrow) { max-width: 620px; margin: 0 0 28px; color: var(--muted); font-size: 18px; }
.eyebrow { margin: 0 0 8px; color: var(--terracotta-dark); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.category-section, .products-section { max-width: 1320px; margin: 0 auto; padding: 58px clamp(20px, 4vw, 52px); }
.category-section { background: var(--surface); border-radius: 34px; }
.section-heading, .product-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.section-heading h2, .product-toolbar h2, .catalog-consultation h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 4vw, 52px); font-weight: 500; line-height: 1.05; }
.section-heading > p { max-width: 500px; margin: 0; color: var(--muted); }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.category-card {
  min-height: 280px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  text-align: left;
  color: white;
  background: #555;
  position: relative;
  cursor: pointer;
  box-shadow: 0 12px 35px rgba(35, 31, 26, .13);
}
.category-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .45s ease; }
.category-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 28%, rgba(15,18,14,.84)); }
.category-card span { position: absolute; z-index: 2; left: 22px; right: 22px; bottom: 20px; }
.category-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 27px; line-height: 1.05; }
.category-card small { display: block; margin-top: 7px; color: rgba(255,255,255,.78); line-height: 1.35; }
.category-card:hover img, .category-card.active img { transform: scale(1.045); }
.category-card.active { outline: 4px solid rgba(169,95,64,.35); outline-offset: 3px; }

.products-section { padding-top: 90px; padding-bottom: 90px; }
.catalog-filters { display: flex; gap: 12px; }
.catalog-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.catalog-filters input, .catalog-filters select {
  min-width: 235px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.catalog-filters input:focus, .catalog-filters select:focus { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(83,97,72,.12); }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.product-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface);
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-image { height: 255px; background: #e5ddd1; position: relative; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.segment-badge { position: absolute; left: 14px; top: 14px; padding: 7px 11px; border-radius: 999px; background: rgba(255,253,249,.93); color: var(--terracotta-dark); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.product-copy { padding: 20px; }
.product-copy small { color: var(--muted); }
.product-copy h3 { margin: 7px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; line-height: 1.12; font-weight: 500; }
.product-copy p { min-height: 48px; margin: 0; color: var(--muted); }
.product-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.product-tags span { padding: 5px 9px; border-radius: 999px; background: #eee8df; color: #595d55; font-size: 11px; }
.catalog-loading, .empty-state {
  grid-column: 1 / -1;
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 42px;
  border: 1px dashed #c9bdad;
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
}
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 27px; }

.catalog-consultation {
  max-width: 1215px;
  margin: 0 auto 90px;
  padding: clamp(34px, 6vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  border-radius: 30px;
  background: var(--olive);
  color: white;
}
.catalog-consultation .eyebrow { color: #e9c2af; }
.catalog-consultation p:not(.eyebrow) { max-width: 720px; margin-bottom: 0; color: rgba(255,255,255,.72); }
.catalog-consultation > a { flex: none; background: white; color: var(--olive); }

footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px 36px; padding: 30px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer a { text-decoration: none; }

.product-dialog { width: min(900px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 26px; background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.product-dialog::backdrop { background: rgba(24,25,22,.62); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; z-index: 3; right: 14px; top: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 26px; cursor: pointer; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; }
.product-detail > img { width: 100%; height: 100%; min-height: 520px; object-fit: cover; background: #e7dfd3; }
.product-detail-copy { padding: 50px 40px 40px; }
.product-detail-copy h2 { margin: 9px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: 38px; line-height: 1.05; font-weight: 500; }
.product-detail-copy > p { color: var(--muted); }
.spec-list { display: grid; gap: 0; margin: 24px 0; }
.spec-list div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; text-align: right; font-weight: 650; }
.detail-action { display: inline-flex; margin-top: 12px; padding: 12px 18px; border-radius: 999px; background: var(--terracotta); color: white; text-decoration: none; font-weight: 750; }

@media (max-width: 980px) {
  .catalog-header { grid-template-columns: auto 1fr; gap: 16px; }
  .catalog-header nav { display: none; }
  .header-actions { justify-self: end; }
  .catalog-hero::before { right: -180px; opacity: .42; }
  .catalog-hero::after { display: none; }
  .category-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
  .section-heading, .product-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 650px) {
  .catalog-header { min-height: 68px; padding: 10px 16px; }
  .brand img { width: 118px; }
  .supplier-link { display: none; }
  .cabinet-link { min-height: 39px; padding: 0 15px; }
  .catalog-hero { min-height: 410px; padding-top: 72px; }
  .catalog-hero h1 { font-size: 47px; }
  .catalog-hero::before { width: 330px; height: 330px; right: -190px; top: 55px; }
  .category-section { border-radius: 24px; }
  .category-grid, .product-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 245px; }
  .catalog-filters { width: 100%; flex-direction: column; }
  .catalog-filters label, .catalog-filters input, .catalog-filters select { width: 100%; min-width: 0; }
  .catalog-consultation { margin-inline: 16px; flex-direction: column; align-items: flex-start; }
  .product-detail { grid-template-columns: 1fr; }
  .product-detail > img { min-height: 260px; max-height: 340px; }
  .product-detail-copy { padding: 30px 22px; }
}
