/* ============================================================
   SOURCE-RENDERED CATALOG
   ============================================================ */

.catalog-section {
  width: 100%;
  min-width: 0;
  padding-top: clamp(96px, 10vw, 144px);
  padding-bottom: clamp(104px, 11vw, 160px);
  overflow: clip;
  scroll-margin-top: 72px;
}
.catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(28px, 6vw, 88px);
  margin-bottom: clamp(42px, 6vw, 76px);
}

.catalog-heading > div {
  min-width: 0;
}

.catalog-heading .section-title {
  max-width: 780px;
  scroll-margin-top: 96px;
}

.catalog-heading .section-subtitle {
  max-width: 660px;
}

.catalog-count {
  flex: 0 0 auto;
  min-width: 116px;
  padding-bottom: 10px;
  color: var(--warm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.catalog-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  margin-bottom: clamp(28px, 4vw, 48px);
  padding: 18px 0;
  border-top: 1px solid rgba(51, 51, 51, 0.14);
  border-bottom: 1px solid rgba(51, 51, 51, 0.14);
}

.catalog-category-rail {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.catalog-category-button {
  min-width: 76px;
  min-height: 44px;
  padding: 10px 21px;
  border: 1px solid rgba(51, 51, 51, 0.2);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.42);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.05em;
  transition:
    color 0.35s var(--ease-expo),
    background 0.35s var(--ease-expo),
    border-color 0.35s var(--ease-expo),
    transform 0.35s var(--ease-expo);
}

.catalog-category-button:hover {
  border-color: rgba(58, 143, 163, 0.7);
  transform: translateY(-1px);
}

.catalog-category-button.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.catalog-category-button:focus-visible,
.catalog-sort select:focus-visible,
.catalog-card:focus-visible,
.catalog-preview-fork button:focus-visible,
.catalog-error button:focus-visible {
  outline: 3px solid rgba(58, 143, 163, 0.38);
  outline-offset: 3px;
}

.catalog-sort {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  color: var(--warm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-sort select {
  width: min(232px, 100%);
  min-height: 44px;
  padding: 9px 38px 9px 14px;
  border: 1px solid rgba(51, 51, 51, 0.2);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.68);
  font: 400 14px/1.2 'DM Sans', sans-serif;
  letter-spacing: -0.01em;
  text-transform: none;
}

.catalog-filters {
  display: grid;
  gap: 12px;
  margin: -18px 0 clamp(28px, 4vw, 48px);
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(51, 51, 51, 0.14);
  font-family: 'DM Sans', sans-serif;
}

.catalog-filters-toggle {
  display: none;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(51, 51, 51, 0.2);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.68);
  font: 500 14px/1.2 'DM Sans', sans-serif;
}

.catalog-filters-count {
  display: inline-grid;
  min-width: 25px;
  min-height: 25px;
  place-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
}

.catalog-filter-fields,
.catalog-table-filters,
.catalog-chair-filters {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.catalog-table-filters[hidden],
.catalog-chair-filters[hidden],
.catalog-filter-fields[hidden] {
  display: none;
}

.catalog-filter-fields {
  flex-wrap: wrap;
}
.catalog-table-filters,
.catalog-chair-filters {
  flex-wrap: wrap;
}
.catalog-table-filters {
  flex-basis: 660px;
}
.catalog-chair-filters {
  flex-basis: 260px;
}
.catalog-filter-shape-group {
  display: grid;
  flex: 1 1 190px;
  gap: 7px;
  min-width: 0;
}

.catalog-filter-shape-group .catalog-filter-field {
  width: 100%;
}

.catalog-shape-hint {
  display: block;
  max-width: 42ch;
  font-size: 12px;
  line-height: 1.4;
}

.catalog-filter-field {
  display: grid;
  flex: 1 1 190px;
  gap: 6px;
  min-width: 0;
  color: var(--warm);
  font-size: 14px;
  line-height: 1.2;
}

.catalog-filter-field--price {
  max-width: 230px;
}

.catalog-filter-field select,
.catalog-filter-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(51, 51, 51, 0.2);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  font: 400 14px/1.2 'DM Sans', sans-serif;
}

.catalog-filter-field input[aria-invalid="true"] {
  border-color: #a64b3c;
}

.catalog-filter-error {
  margin: 0;
  color: #8c3e33;
  font-size: 14px;
  line-height: 1.45;
}

.catalog-filter-error[hidden] {
  display: none;
}

.catalog-filter-hint {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.45;
}

.catalog-filter-hint[hidden] {
  display: none;
}

.catalog-active-filters {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.catalog-active-filters p {
  margin: 0;
  color: var(--warm);
  font-size: 14px;
  line-height: 1.45;
}

.catalog-active-filters button,
.catalog-empty button {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(58, 143, 163, 0.42);
  border-radius: 16px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.66);
  font: 500 14px/1.2 'DM Sans', sans-serif;
}

.catalog-active-filters button[hidden] {
  display: none;
}

.catalog-filters-toggle:focus-visible,
.catalog-filter-field select:focus-visible,
.catalog-filter-field input:focus-visible,
.catalog-active-filters button:focus-visible,
.catalog-empty button:focus-visible {
  outline: 3px solid rgba(58, 143, 163, 0.38);
  outline-offset: 3px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(14px, 2vw, 28px);
  width: 100%;
  min-width: 0;
}

.catalog-preview-fork {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(24px, 3vw, 36px);
}

.catalog-preview-fork[hidden] {
  display: none;
}

.catalog-preview-fork button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(58, 143, 163, 0.42);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.48);
  font: 500 14px/1.1 'DM Sans', sans-serif;
  letter-spacing: 0.02em;
  transition:
    border-color 0.35s var(--ease-expo),
    transform 0.35s var(--ease-expo),
    color 0.35s var(--ease-expo),
    background 0.35s var(--ease-expo);
}

.catalog-preview-fork button:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  transform: translateY(-1px);
}

.catalog-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(51, 51, 51, 0.12);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 34px rgba(30, 30, 30, 0.055);
  transition:
    border-color 0.45s var(--ease-expo),
    box-shadow 0.45s var(--ease-expo),
    transform 0.45s var(--ease-expo);
}

.catalog-card:hover {
  border-color: rgba(58, 143, 163, 0.34);
  box-shadow: 0 20px 52px rgba(30, 30, 30, 0.1);
  transform: translateY(-4px);
}

.catalog-card-media {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: 4 / 3;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(235, 229, 221, 0.78));
}

.catalog-card-media::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
  transition: width 0.45s var(--ease-expo);
}

.catalog-card:hover .catalog-card-media::after {
  width: 54px;
}

.catalog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.75s var(--ease-expo);
}

.catalog-card:hover .catalog-card-media img {
  transform: scale(1.035);
}

.catalog-card[data-product-category="tables"] .catalog-card-media img {
  width: calc(100% * var(--table-card-scale, 1));
  height: calc(100% * var(--table-card-scale, 1));
  max-width: none;
  flex: none;
  object-fit: contain;
  object-position: var(--table-card-x, 50%) var(--table-card-y, 50%);
  translate: calc(var(--table-card-x, 50%) - 50%) calc(var(--table-card-y, 50%) - 50%);
}

.catalog-card[data-product-category="tables"]:hover .catalog-card-media img {
  transform: scale(1.035);
}

.catalog-card[data-product-category="chairs"] .catalog-card-media img {
  object-fit: contain;
  object-position: center;
}

.catalog-card[data-product-category="chairs"] .catalog-card-media {
  aspect-ratio: 3 / 4;
}

.catalog-card-media.is-image-missing::before {
  content: 'Фото скоро появится';
  color: var(--warm);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.catalog-card-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  padding: clamp(18px, 2vw, 28px);
}

.catalog-card-category {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.catalog-card h3 {
  margin: 0 0 12px;
  min-height: 2.12em;
  color: var(--dark);
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.catalog-card-specs {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  color: #666;
  font-size: 14px;
  line-height: 1.42;
}

.catalog-card-specs > span {
  display: block;
}

.catalog-card-price {
  margin-top: auto;
  color: var(--text);
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.015em;
}

.catalog-card-price-basis {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
}

.catalog-card-delivery {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(51, 51, 51, 0.1);
  color: #6f665f;
  font-size: 14px;
  line-height: 1.4;
}

.catalog-card-details {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.catalog-card-details span {
  display: inline-block;
  transition: transform 0.35s var(--ease-expo);
}

.catalog-card:hover .catalog-card-details span,
.catalog-card:focus-visible .catalog-card-details span {
  transform: translateX(4px);
}

.catalog-empty,
.catalog-error {
  grid-column: 1 / -1;
  padding: clamp(32px, 5vw, 64px);
  border: 1px solid rgba(51, 51, 51, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.catalog-empty {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.catalog-empty p {
  max-width: 680px;
  margin: 0;
  color: #666;
  font-size: 15px;
  line-height: 1.55;
}

.catalog-error {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.catalog-error button {
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

@media (min-width: 1280px) {
  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .catalog-filter-fields,
  .catalog-table-filters,
  .catalog-chair-filters {
    flex-direction: column;
    align-items: stretch;
    flex-basis: auto;
  }
  .catalog-filter-field,
  .catalog-filter-field--price,
  .catalog-filter-shape-group {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }
  .catalog-section {
    padding-top: clamp(76px, 14vw, 104px);
    padding-bottom: clamp(88px, 16vw, 120px);
  }

  .catalog-heading {
    display: grid;
    gap: 18px;
    margin-bottom: 32px;
  }

  .catalog-count {
    min-width: 0;
    padding-bottom: 0;
    text-align: left;
  }

  .catalog-toolbar {
    align-items: stretch;
  }

  .catalog-filters {
    margin-top: -12px;
  }

  .catalog-filters-toggle {
    display: flex;
  }

  .catalog-filter-fields {
    padding-top: 2px;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 2.8vw, 18px);
  }

  .catalog-card-body {
    padding: clamp(14px, 3.2vw, 22px);
  }

  .catalog-card h3 {
    font-size: clamp(23px, 5vw, 30px);
    overflow-wrap: break-word;
  }
}

@media (max-width: 600px) {
  .catalog-section {
    padding-top: 64px;
    padding-bottom: 88px;
  }

  .catalog-heading {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
  }

  .catalog-heading .section-label {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .catalog-heading .section-title {
    margin-bottom: 0;
    font-size: 38px;
  }

  .catalog-heading .section-subtitle {
    display: none;
  }

  .catalog-count {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .catalog-toolbar {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 0;
  }

  .catalog-category-button {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: 12px;
  }

  .catalog-sort {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .catalog-sort,
  .catalog-sort select {
    width: 100%;
  }

  .catalog-filters {
    gap: 8px;
    margin: 0 0 12px;
    padding-bottom: 10px;
  }

  .catalog-filters[data-has-active-filters="false"] .catalog-active-filters {
    display: none;
  }

  .catalog-filter-fields,
  .catalog-table-filters,
  .catalog-chair-filters,
  .catalog-active-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-filter-field,
  .catalog-filter-field--price,
  .catalog-filter-shape-group {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  .catalog-active-filters {
    min-height: 0;
  }

  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 360px) {
  .catalog-sort {
    width: 100%;
  }

  .catalog-sort select {
    width: 100%;
  }

  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .catalog-card h3 {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-category-button,
  .catalog-preview-fork button,
  .catalog-card,
  .catalog-card-media::after,
  .catalog-card-media img,
  .catalog-card-details span {
    transition: none;
  }

  .catalog-category-button:hover,
  .catalog-preview-fork button:hover,
  .catalog-card:hover,
  .catalog-card:hover .catalog-card-media img,
  .catalog-card:hover .catalog-card-details span,
  .catalog-card:focus-visible .catalog-card-details span {
    transform: none;
  }
}

/* ===== TILE (shared card-like style for text blocks) ===== */
.tile {
  background: #fff;
  border-radius: 16px;
  padding: clamp(32px, 4vw, 48px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}
.about-stats.tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ===== ABOUT ===== */
#about {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(50px, 7vh, 90px);
  padding-bottom: clamp(50px, 7vh, 90px);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 7vw, 120px);
  align-items: center;
}
.about-text h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 400;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.about-text p {
  font-size: max(16px, 1.1rem);
  color: #666;
  font-weight: 400;
  line-height: 1.8;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 40px;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(52px, 6vw, 84px);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.04em;
}
.stat-label {
  font-size: 15px;
  color: var(--warm);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== ABOUT RESPONSIVE (unchanged) ===== */
@media (max-width: 900px) {
  #about {
    min-height: auto;
    padding-top: clamp(40px, 6vh, 70px);
    padding-bottom: clamp(40px, 6vh, 70px);
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: stretch;
  }
  .about-stats.tile {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: center;
  }
  .about-stats .stat-number {
    font-size: clamp(40px, 9vw, 60px);
    margin-bottom: 6px;
  }
  .about-stats .stat-label {
    font-size: 12px;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 420px) {
  .about-stats.tile {
    padding: clamp(24px, 5vw, 32px) clamp(16px, 4vw, 24px);
    gap: 12px;
  }
  .about-stats .stat-number {
    font-size: clamp(32px, 10vw, 48px);
  }
  .about-stats .stat-label {
    font-size: 11px;
  }
}

/* ===== DELIVERY ===== */
#delivery {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(50px, 7vh, 90px);
  padding-bottom: clamp(50px, 7vh, 90px);
}

/* Override the base .about-stats grid (3 stat columns) — delivery is a
   vertical list of icon-row blocks. Higher specificity than the 900px
   media rule below would set on .about-stats.tile. */
.about-stats.delivery-points {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.4vw, 28px);
  justify-content: center;
  text-align: left;
}

.delivery-point {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: clamp(16px, 1.6vw, 20px);
  align-items: start;
}

.delivery-point-icon {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(58, 143, 163, 0.08);
  border: 1px solid rgba(58, 143, 163, 0.22);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.delivery-point-icon svg {
  width: 22px;
  height: 22px;
}

.delivery-point-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(20px, 2vw, 24px);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.2;
}

.delivery-point-desc {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: max(14px, 0.95rem);
  color: var(--warm);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ===== DELIVERY RESPONSIVE ===== */
@media (max-width: 900px) {
  #delivery {
    min-height: auto;
    padding-top: clamp(40px, 6vh, 70px);
    padding-bottom: clamp(40px, 6vh, 70px);
  }
  /* The base 900px rule below resets .about-grid to single column for #about;
     #delivery inherits that automatically. Tighten the inter-point gap on mobile. */
  .about-stats.delivery-points {
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .delivery-point {
    grid-template-columns: 40px 1fr;
    gap: 14px;
  }
  .delivery-point-icon {
    width: 40px;
    height: 40px;
  }
  .delivery-point-icon svg {
    width: 18px;
    height: 18px;
  }
}
