.delivery-page { overflow-x: clip; }

.delivery-hero { padding-bottom: var(--ds-section-space-bottom); }
.delivery-hero__layout, .delivery-calculator-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 64px; align-items: end; }
.delivery-hero__eyebrow, .delivery-heading > p, .delivery-heading__eyebrow { margin: 0 0 12px; color: var(--ds-color-brand); font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-semibold); letter-spacing: .12em; text-transform: uppercase; }
.delivery-hero h1 { margin: 0; font-family: var(--ds-font-display); font-size: var(--ds-font-size-h1); font-weight: var(--ds-font-weight-medium); line-height: var(--ds-line-height-heading); text-transform: uppercase; }
.delivery-hero__lead { max-width: 660px; margin: 24px 0 0; color: var(--ds-color-text-muted); font-size: var(--ds-font-size-lead); line-height: 1.4; font-weight: var(--ds-font-weight-semibold); }
.delivery-hero__note { display: flex; gap: 14px; padding: 24px; border: 1px solid var(--ds-color-border); border-radius: var(--ds-radius-lg); background: rgba(255,255,255,.5); box-shadow: var(--ds-shadow-card); }
.delivery-hero__note span { color: var(--primary); font-size: 26px; line-height: 1; }
.delivery-hero__note p { margin: 0; font-size: var(--ds-font-size-title); font-weight: var(--ds-font-weight-medium); line-height: 1.55; }

.delivery-section { padding-top: var(--ds-section-space-top); padding-bottom: var(--ds-section-space-bottom); }
.delivery-section--calculator { z-index: 5; }
.delivery-section--muted { background: rgba(239, 227, 207, .6); }
.delivery-section--narrow .ds-container { max-width: 920px; }
.delivery-heading { margin-bottom: 34px; }
.delivery-heading .ds-section__title, .delivery-calculator-layout .ds-section__title, .delivery-payment-intro .ds-section__title { font-size: var(--ds-font-size-h2); }
.delivery-heading__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ds-space-6); }
.delivery-table-hint { display: none; align-items: center; gap: var(--ds-space-2); margin: 0 0 4px; color: var(--ds-color-text-muted); font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); line-height: 1.3; text-align: right; }
.delivery-table-hint__icon, .delivery-table-hint__arrow { color: var(--ds-color-brand); font-size: var(--ds-font-size-md); line-height: 1; }
.delivery-table-container { position: relative; }
.delivery-table-wrap { overflow-x: auto; /* Технический скроллбар запрещён — см. AGENTS.md */ scrollbar-width: none; border: 1px solid var(--ds-color-border); border-radius: var(--ds-radius-lg); background: rgba(255,255,255,.5); }
.delivery-table-wrap::-webkit-scrollbar { display: none; }
.delivery-table { width: 100%; min-width: 800px; border-collapse: collapse; text-align: left; }
.delivery-table th, .delivery-table td { padding: 21px 24px; border-bottom: 1px solid var(--ds-color-border); vertical-align: top; line-height: 1.45; }
.delivery-table thead th { color: var(--ds-color-text-muted); font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-semibold); letter-spacing: .1em; text-transform: uppercase; }
.delivery-table tbody th { font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-semibold); white-space: nowrap; }
.delivery-table tbody tr:last-child > * { border-bottom: 0; }
.delivery-table-scroll-badge { display: none; }

.delivery-calculator__intro, .payment-intro__note { max-width: 620px; margin: 18px 0 0; color: var(--ds-color-text-muted); font-size: var(--ds-font-size-lead); line-height: 1.4; font-weight: var(--ds-font-weight-semibold); }
.delivery-calculator { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr auto; gap: 14px; align-items: end; margin-top: 30px; }
.delivery-calculator .ds-button { min-height: 52px; }

/* Custom dropdown, modeled on the catalog sort control (.ds-sort-control) but
 * sized to fit the calculator's full-width form fields. The left padding
 * (text to border) and right padding (border to chevron) both use
 * --ds-space-5 so the two insets match exactly. */
.ds-dropdown { position: relative; }
.ds-dropdown__trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 14px var(--ds-space-5);
  border: 1px solid var(--ds-color-border);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, .55);
  color: var(--ds-color-text);
  cursor: pointer;
  font: var(--ds-font-weight-medium) var(--ds-font-size-md) / 1.4 var(--ds-font-body);
  text-align: left;
  transition: border-color var(--ds-transition-base), background-color var(--ds-transition-base), box-shadow var(--ds-transition-base);
}
.ds-dropdown__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-dropdown__chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  /* The 45deg rotation grows the diamond's bounding box by ~2px on each
   * side (10 * (sqrt(2) - 1) / 2), which would otherwise eat into the
   * right padding and make the border-to-chevron gap look smaller than
   * the left text-to-border gap. The 2px right margin compensates so
   * both insets read as equal. */
  margin: 0 2px 0 12px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}
.ds-dropdown__trigger[aria-expanded="true"] .ds-dropdown__chevron { transform: translateY(-2px) rotate(225deg); }
.ds-dropdown__trigger:hover { border-color: rgba(35, 30, 19, .45); }
.ds-dropdown__trigger[aria-expanded="true"] {
  border-color: var(--primary);
  background-color: var(--ds-color-surface);
  box-shadow: 0 0 0 3px var(--ds-color-focus);
}
.ds-dropdown__trigger:focus-visible {
  border-color: var(--primary);
  outline: 3px solid var(--ds-color-focus);
  outline-offset: 2px;
}
.ds-dropdown__options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--ds-color-border);
  border-radius: 10px;
  background: var(--ds-color-surface);
  box-shadow: var(--ds-shadow-floating);
  color: var(--ds-color-text);
  list-style: none;
}
.ds-dropdown__options[hidden] { display: none; }
.ds-dropdown__options li {
  padding: 12px var(--ds-space-5);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--ds-font-size-md);
  line-height: 1.4;
}
.ds-dropdown__options li:hover,
.ds-dropdown__options li:focus,
.ds-dropdown__options li[aria-selected="true"] {
  background: var(--color-badge-bg);
}
.ds-dropdown__options li[aria-selected="true"] {
  color: var(--color-brown);
  font-weight: var(--ds-font-weight-bold);
}
.ds-dropdown__options li[aria-disabled="true"] {
  color: rgba(35, 30, 19, .4);
  cursor: not-allowed;
}
.ds-dropdown__options li[aria-disabled="true"]:hover,
.ds-dropdown__options li[aria-disabled="true"]:focus {
  background: transparent;
}
.delivery-summary { padding: 32px; border: 1px solid rgba(249, 231, 185, .32); border-radius: var(--ds-radius-lg); background: var(--ds-color-inverse); color: var(--ds-color-text-inverse); box-shadow: var(--ds-shadow-card); }
.delivery-summary__label { margin: 0 0 22px; color: rgba(247,239,222,.68); font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-semibold); letter-spacing: .1em; text-transform: uppercase; }
.delivery-summary output { display: flex; flex-direction: column; gap: 9px; }
.delivery-summary strong { color: var(--color-badge-bg); font-family: var(--ds-font-display); font-size: 42px; font-weight: var(--ds-font-weight-medium); line-height: 1; }
.delivery-summary span { font-size: var(--ds-font-size-title); }
.delivery-summary small { color: rgba(247,239,222,.78); font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-medium); }

.payment-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
.payment-card { display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 180px; box-sizing: border-box; padding: 25px; border: 1px solid var(--ds-color-border); border-top: 3px solid var(--ds-color-brand); border-radius: var(--ds-radius-lg); background: rgba(255,255,255,.5); box-shadow: var(--ds-shadow-card); transition: transform .2s ease, box-shadow .2s ease; }
.payment-card h3 { margin: 0; font-family: var(--ds-font-display); font-size: var(--ds-font-size-h3); font-weight: var(--ds-font-weight-medium); line-height: 1.15; }
.payment-card__logos { display: flex; align-items: center; flex-wrap: wrap; min-height: 30px; gap: 10px 14px; margin-top: 28px; }
.payment-card__logos img { display: block; width: auto; max-width: 76px; max-height: 58.8px; object-fit: contain; }
.payment-card__sbp-logo { display: block; width: auto; max-width: 148.4px; max-height: 58.8px; margin-top: 28px; aspect-ratio: 2500 / 1255; object-fit: contain; object-position: left center; }
.payment-card--invoice { border-top-color: var(--primary); }
.payment-card__invoice-icon { display: block; width: 58.8px; height: 58.8px; margin-top: 20px; color: var(--primary); }
.payment-card--invoice p { margin: 20px 0 0; color: var(--ds-color-text-muted); font-size: var(--ds-font-size-title); font-weight: var(--ds-font-weight-medium); line-height: var(--ds-line-height-body); }
.payment-card--invoice a { width: fit-content; margin-top: 20px; color: var(--ds-color-brand); font-weight: var(--ds-font-weight-semibold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.payment-card--invoice a:hover { color: var(--primary); }
.payment-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(54, 40, 22, .13); }

.delivery-details { margin-top: 30px; border-top: 1px solid var(--ds-color-border); }
.delivery-page :focus-visible { outline: 3px solid var(--ds-color-focus); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Issue #57: payment options and the result panel stack from the tablet tier
   (≤1024px) following the confirmed delivery-page feedback. */
@media (max-width: 1024px) {
  .delivery-page .payment-cards { grid-template-columns: 1fr !important; }
  .delivery-calculator-layout { grid-template-columns: 1fr; gap: var(--ds-space-8); }
  .delivery-summary { width: 100%; max-width: none; box-sizing: border-box; }
}

@media (max-width: 768px) {
  .delivery-hero__layout { grid-template-columns: 1fr; gap: 32px; }
  .delivery-calculator { grid-template-columns: repeat(2, 1fr); }
  .delivery-calculator .ds-button { width: 100%; }
  .delivery-heading__row { align-items: flex-start; flex-direction: column; gap: var(--ds-space-3); }
  .delivery-table-hint { display: flex; text-align: left; }
  .delivery-table-container.is-scrollable:not(.is-at-end)::after { position: absolute; z-index: 1; top: 1px; right: 1px; bottom: 1px; width: min(18%, 96px); border-radius: 0 var(--ds-radius-lg) var(--ds-radius-lg) 0; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(249, 231, 185, .94)); content: ""; pointer-events: none; }
  .delivery-table-scroll-badge { position: absolute; z-index: 2; right: var(--ds-space-3); bottom: var(--ds-space-3); display: none; align-items: center; gap: var(--ds-space-2); min-height: 38px; padding: 7px var(--ds-space-3); border: 1px solid var(--ds-color-brand); border-radius: var(--ds-radius-pill); background: var(--ds-color-surface); color: var(--ds-color-brand); box-shadow: var(--ds-shadow-card); cursor: pointer; font: var(--ds-font-weight-semibold) var(--ds-font-size-sm) / 1.2 var(--ds-font-body); }
  .delivery-table-container.is-scrollable:not(.is-at-end) .delivery-table-scroll-badge { display: inline-flex; }
  .delivery-table-scroll-badge:focus-visible { outline: 3px solid var(--ds-color-focus); outline-offset: 3px; }
}@media (max-width: 480px) {
  .delivery-heading .ds-section__title, .delivery-calculator-layout .ds-section__title, .delivery-payment-intro .ds-section__title { font-size: 36px; }
  .delivery-table th, .delivery-table td { padding: 16px; }
  .payment-cards { grid-template-columns: 1fr; gap: 12px; }
  .payment-card { min-height: 150px; }
}
@media (max-width: 480px) {
  .delivery-hero { text-align: center; }
  .delivery-hero__eyebrow, .delivery-hero h1, .delivery-hero__lead { text-align: center; margin-inline: auto; }
  .delivery-heading, .delivery-payment-intro { text-align: center; }
  .delivery-heading > p, .delivery-payment-intro .payment-intro__note { text-align: center; margin-inline: auto; }
  .delivery-hero h1 { font-size: 34px; }
  .delivery-calculator { grid-template-columns: 1fr; }
  .delivery-summary { padding: 24px; }
  .delivery-table-hint__icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .payment-card { transition: none; }
  .payment-card:hover { transform: none; }
}

/* Единый стандарт (feedback 2026-09-06): лиды героев по центру с 1024px */
@media (max-width: 1024px) {
  .audio-hero, .delivery-hero, .catalog-hero { text-align: center; }
  .delivery-hero__lead { margin-inline: auto; }, .delivery-calculator__intro { margin-inline: auto; }
}

/* Единый стандарт (feedback 2026-09-06): формы по центру с 1024px */
@media (max-width: 1024px) {
  .checkout-form, .delivery-calculator { text-align: center; }
  }
