.commerce-screen { min-width: 0; container-type: inline-size; }
.commerce-panel { min-width: 0; }
.commerce-panel .panel-head h1 { font-size: 1.45rem; line-height: 1.3; }
.commerce-panel .commerce-empty { display: block; padding: 3px 0 8px; color: var(--muted); text-align: left; }
.commerce-table td { overflow-wrap: anywhere; }
.commerce-table td > .muted { margin-top: 3px; }
.commerce-table td a:not(.button), .commerce-summary a { display: block; margin-top: 5px; }
.commerce-table tr:has(.commerce-row-trigger) { cursor: pointer; }
.commerce-row-trigger { color: var(--ink); border: 0; background: transparent; padding: 4px 0; margin-block: -4px; font-weight: 650; text-align: start; text-decoration-color: transparent; text-underline-offset: 3px; }
.commerce-table tr:hover .commerce-row-trigger, .commerce-row-trigger:focus-visible { color: var(--accent); text-decoration: underline; }
.commerce-table .actions.commerce-row-actions { justify-content: flex-start; gap: 5px; }
.commerce-numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.commerce-range { display: inline-block; min-width: 9ch; }
.commerce-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.commerce-inline-note { color: var(--muted); padding-bottom: 11px; font-size: .88rem; }

.commerce-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.commerce-summary-item { min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; align-items: start; background: var(--surface-2, #f1f4f8); border-radius: 12px; }
.commerce-summary-item > .muted { font-size: .8rem; }
.commerce-summary-item .button.quiet { margin-left: -8px; }
.commerce-summary-primary { font-size: clamp(1rem, 2.1cqi, 1.23rem); font-weight: 700; overflow-wrap: anywhere; }

.commerce-props { margin: 0; padding: 5px 14px; font-size: .9rem; display: grid; gap: 0; background: var(--surface-2, #f1f4f8); border-radius: 12px; }
.commerce-props > div { display: grid; grid-template-columns: minmax(0, min(120px, 33%)) minmax(0, 1fr); gap: 12px; padding: 7px 0; }
.commerce-props dt { color: var(--muted); }
.commerce-props dd { margin: 0; overflow-wrap: anywhere; }
.commerce-props dd .commerce-prose { margin-top: 4px; }
.commerce-props dd a { display: inline-block; margin-top: 5px; }
.commerce-price { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.commerce-detail-title { margin-bottom: 8px; font-size: .95rem; }
.commerce-form-note { margin: -5px 0 0; font-size: .82rem; }

.commerce-choice, .commerce-inset-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.commerce-choice legend { margin-bottom: 5px; padding: 0; font-size: .84rem; font-weight: 650; }
.commerce-options { display: grid; gap: 5px; max-height: 245px; overflow: auto; padding: 2px; margin: -2px; }
.commerce-option { display: flex; align-items: start; gap: 9px; border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.commerce-option:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
.commerce-option:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.commerce-option span { min-width: 0; overflow-wrap: anywhere; }
.commerce-option input, .commerce-check input { margin: 3px 0 0; flex: 0 0 auto; width: 16px; height: 16px; }
.commerce-option small { display: block; color: var(--muted); margin-top: 2px; }
.commerce-choice-search { margin-bottom: 8px; }
.commerce-search-empty { font-size: .84rem; padding-block: 5px; }
.commerce-check { display: flex; align-items: start; gap: 9px; padding-block: 4px; cursor: pointer; }
.commerce-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@container (max-width: 625px) {
  .commerce-panel > .table-wrap { max-height: none; }
  .commerce-panel .commerce-table, .commerce-panel .commerce-table tbody { display: block; }
  .commerce-panel .commerce-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .commerce-panel .commerce-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 15px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .commerce-panel .commerce-table td { display: block; border: 0; padding: 0; }
  .commerce-panel .commerce-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .74rem; margin-bottom: 2px; }
  .commerce-panel .commerce-table td[data-label="Действия"], .commerce-panel .commerce-table td[data-label="Состав услуг"] { grid-column: 1 / -1; }
  .commerce-panel .commerce-table td[data-label="Действия"]::before { display: none; }
  .commerce-panel .commerce-table td[data-label="Действия"] { margin-top: 4px; }
  .commerce-panel .commerce-table td:has(> .commerce-no-actions) { display: none; }
}

@media (max-width: 340px) {
  .commerce-props > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}

.commerce-offer { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.commerce-offer summary { color: var(--accent); font-weight: 650; cursor: pointer; }
.commerce-offer-text { margin-top: 10px; }
