/* Proposal branch: use existing material palette; keep the public identity. */
:root { --ux-space: 24px; --ux-target: 44px; --ux-radius: 12px; --ux-muted: #4e5c55; --ux-error: #8a241c; }
html { scrollbar-gutter: stable; scrollbar-color: var(--muted) var(--paper); }
* { scrollbar-width: auto; scrollbar-color: var(--muted) var(--paper); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--muted); border: 3px solid var(--paper); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }
::selection { color: var(--paper); background: var(--ink); }
input, textarea { caret-color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.overlay-open { overflow: hidden; }
.cart-drawer { overflow-y: auto; visibility: hidden; }
.cart-drawer.open { visibility: visible; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal:has(.order-summary) { width: min(760px, 94vw); }
.order-summary { margin: var(--ux-space) 0; padding: var(--ux-space); background: var(--cream); border-radius: var(--ux-radius); }
.order-summary h3 { font-size: 20px; margin: 0 0 16px; letter-spacing: -.02em; }
.order-summary ul { list-style: none; padding: 0; margin: 0; }
.order-summary li, .order-subtotal { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; font-size: 15px; line-height: 1.6; }
.order-summary li { padding: 10px 0; }
.order-summary li span { overflow-wrap: anywhere; }
.order-summary strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.order-subtotal { border-top: 1px solid var(--line); padding-top: 16px; margin: 12px 0; }
.order-explanation { color: var(--ink); font-size: 14px; line-height: 1.7; max-width: 65ch; }
.order-summary a, .modal .check a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.order-summary a { display: inline-block; padding-block: 10px; font-size: 14px; }
.modal label.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.8; }
.modal label.check .consent-text { display: block; flex: 1; min-width: 0; white-space: normal; overflow-wrap: break-word; }
.modal label.check .consent-text a { display: inline; white-space: normal; }
.modal label.check input[type="checkbox"] { flex: 0 0 16px; width: 16px; height: 16px; margin: 4px 0 0; }
.modal label { font-size: 14px; }
.modal input:not([type='checkbox']), .modal textarea, .modal select { font-size: 16px; }
.modal textarea { min-height: 110px; }
.catalog-results { color: var(--ux-muted); font-size: 14px; line-height: 1.6; margin: 20px 0; }
.catalog-empty { grid-column: 1 / -1; padding: 48px 24px; text-align: center; background: var(--cream); border-radius: var(--ux-radius); }
.catalog-empty h3 { margin: 0 0 12px; font-size: clamp(20px, 3vw, 28px); }
.catalog-empty p { color: var(--ux-muted); line-height: 1.7; }
.catalog-empty .button { margin-top: 12px; }
.filter, .cart-action, .cart-item-remove, .product-gallery-controls button, .modal-gallery-arrow, .pagination-arrow, .pagination-page, .add-button { min-width: var(--ux-target); min-height: var(--ux-target); }
.filter { padding: 10px 14px; }
/* Touch devices must not retain a hover fill after tapping a category. */
@media (hover: hover) and (pointer: fine) {
  .filter:hover:not(.active) { background: var(--cream); color: var(--ink); }
}
.filter:disabled, .button:disabled, .add-button:disabled { cursor: default; }
.modal button[type='submit'] { min-width: 220px; justify-content: center; }
.product-stock { font-size: 12px; }
.footer-links a { font-size: 13px; padding-block: 10px; }
@media (max-width: 600px) {
  .order-summary { padding: 18px; }
  .order-summary li { display: block; }
  .order-summary li strong { display: block; margin-top: 2px; }
  .filter-groups { width: 100%; }
  .filters { flex-wrap: wrap; overflow: visible; gap: 6px; }
  .modal { padding: 52px 20px 24px; max-height: calc(100dvh - 16px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  :focus-visible { outline-color: Highlight; }
}

/* Shape: page views share the established palette, controls and gallery. */
[hidden] { display: none !important; }
.route-view { padding-block: 36px 80px; min-height: 65vh; }
.route-navigation { margin-bottom: 36px; }
.route-navigation a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 5px; }
.route-surface { max-width: 760px; margin-inline: auto; }
.route-surface h1 { font-size: clamp(30px, 4vw, 52px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 24px; text-wrap: balance; overflow-wrap: anywhere; }
.route-surface > p { font-size: 16px; line-height: 1.8; max-width: 65ch; }
.route-surface form { display: grid; gap: 20px; margin-top: 24px; }
.route-surface label { display: block; color: var(--ink); font-size: 14px; line-height: 1.6; }
.route-surface input, .route-surface textarea, .route-surface select { display: block; border: 1px solid var(--muted); border-radius: 6px; background: white; color: var(--ink); padding: 13px; font: 16px Manrope, system-ui, sans-serif; width: 100%; margin-top: 6px; }
.route-surface textarea { min-height: 130px; resize: vertical; }
.route-surface label.check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; }
.route-surface label.check input { width: 18px; height: 18px; flex: 0 0 18px; margin: 3px 0 0; accent-color: var(--ink); }
.route-surface .consent-text { min-width: 0; line-height: 1.8; }
.route-surface .consent-text a { display: inline; color: var(--ink); text-underline-offset: 3px; }
.route-surface form > button { min-height: 48px; min-width: 230px; justify-self: start; justify-content: center; }
.route-surface .form-note { min-height: 24px; margin: 0; font-size: 14px; line-height: 1.6; }
.route-surface .order-edit { display: block; margin-top: 12px; min-height: 44px; }
.route-surface .form-success-panel { padding-block: 40px; }
.route-surface[data-kind='checkout'] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 48px; max-width: none; }
.route-surface[data-kind='checkout'] > h1, .route-surface[data-kind='checkout'] > p { grid-column: 1 / -1; }
.route-surface[data-kind='checkout'] .order-summary { grid-column: 1; grid-row: 3; align-self: start; }
.route-surface[data-kind='checkout'] form { grid-column: 2; grid-row: 3; }
.route-surface:has(.form-success-panel) { display: block; max-width: 760px; }
.route-surface[data-kind='product'] { max-width: none; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 56px; align-items: start; }
.route-surface[data-kind='product'] > * { grid-column: 2; }
.route-surface[data-kind='product'] > .modal-product-gallery, .route-surface[data-kind='product'] > .product-no-photo { grid-column: 1; grid-row: 1 / span 10; }
.route-surface .modal-gallery-main { aspect-ratio: 1; height: auto; max-height: none; }
.route-surface .modal-product-gallery { margin: 0; }
.route-surface .modal-gallery-main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.route-surface .modal-description, .route-surface .product-specs { color: var(--ink); line-height: 1.8; }
.route-surface .modal-price { font-size: 28px; margin-block: 20px; }
.route-surface .product-detail-status { margin-bottom: 20px; }
.route-surface .product-detail-status .product-stock { font-size: 12px !important; }
.route-surface #modalAdd, .route-surface #modalInquiry, .detail-cart-button { justify-self: start; margin-block: 4px; min-height: 48px; }
.product-no-photo { aspect-ratio: 1; display: grid; place-items: center; background: var(--cream); color: var(--ux-muted); padding: 36px; text-align: center; line-height: 1.7; }
.product-art.no-photo { background: var(--cream); }
.product-art.no-photo::before, .product-art.no-photo::after { display: none; }
.product-detail-link { position: absolute; inset: 0; z-index: 1; }
.product-gallery-controls { z-index: 2; }
.product-tag, .product-stock, .photo-unavailable { pointer-events: none; }
.photo-unavailable { position: absolute; inset: 0; display: grid; place-items: center; padding: 56px 24px; color: var(--ux-muted); font-size: 14px; text-align: center; line-height: 1.6; }
.product-meta h3 a { color: inherit; text-decoration: none; }
.product-meta h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.filter-group { display: grid; gap: 8px; }
.filter-label { color: var(--ux-muted); font-size: 13px; }
.catalog-notice { color: var(--ux-muted); font-size: 14px; line-height: 1.7; margin-top: 24px; }
.catalog-notice p { margin: 0 0 8px; }
.catalog-notice button { min-height: 44px; }
@media (max-width: 800px) {
  .route-view { padding-block: 20px 56px; }
  .route-navigation { margin-bottom: 24px; }
  .route-surface[data-kind='checkout'], .route-surface[data-kind='product'] { display: block; }
  .route-surface .modal-product-gallery, .product-no-photo { margin-block: 24px; }
  .route-surface .order-summary { margin-block: 24px; }
  .route-surface form > button { width: 100%; justify-self: stretch; }
}

.field-error { display: block; color: var(--ux-error); font-size: 14px; line-height: 1.6; margin-top: 6px; text-transform: none; letter-spacing: normal; }
[aria-invalid='true'] { outline: 2px solid var(--ux-error); outline-offset: 2px; }

.gallery-enlarge { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }

/* Equal-height cards and bottom-aligned prices on desktop and mobile. */
.product-grid { align-items: stretch; }
.product-grid .product-card { display: flex; flex-direction: column; }
.product-grid .product-art { flex-shrink: 0; }
.product-grid .product-meta {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ux-target);
  grid-template-rows: auto 1fr minmax(var(--ux-target), auto);
  column-gap: 10px;
  align-items: start;
}
.product-grid .product-meta > div:first-child { display: contents; }
.product-grid .product-meta h3 { grid-column: 1 / -1; grid-row: 1; overflow-wrap: anywhere; }
.product-grid .product-meta p:not(.price) {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.4;
  min-height: 2.8em;
  max-height: 2.8em;
}
.product-grid .product-meta .price {
  grid-column: 1;
  grid-row: 3;
  align-self: center;
  min-width: 0;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.product-grid .product-meta > .add-button { grid-column: 2; grid-row: 3; align-self: center; justify-self: end; }

/* Product copy is presentation-limited, never shortened in stored catalog data. */
.route-surface[data-kind='product'] > *, .product-copy-block, .product-specs { min-width: 0; max-width: 100%; }
.route-surface[data-kind='product'], .modal-description, .product-detail-copy, .product-specs, .product-size {
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: left;
}
.product-copy-block .modal-description, .product-copy-block .product-detail-copy { margin: 0; }
.product-copy-block { margin-block: 12px; }
.product-detail-copy, .product-size { font-size: 14px; line-height: 1.8; }
.product-copy-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; max-height: 7.2em; line-height: 1.8; }
.product-copy-more > summary { width: fit-content; max-width: 100%; min-height: 44px; padding-block: 10px; font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.product-copy-more > summary:hover { color: var(--blue); }
.product-copy-more .copy-show-less { display: none; }
.product-copy-more[open] .copy-show-more { display: none; }
.product-copy-more[open] .copy-show-less { display: inline; }
.product-copy-block:has(> .product-copy-more[open]) > .product-copy-preview { display: none; }
.route-surface[data-kind='product'] { overflow-anchor: none; }

/* Category choices lead; availability is a secondary native select. */
.product-section .section-heading { display: block; }
.product-section .filter-groups { width: 100%; margin-top: 24px; display: flex; flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 24px; }
.product-section .filter-group { flex: 1; min-width: 0; }
.product-section .filter-label { display: block; font-size: 13px; color: var(--ux-muted); }
.product-section .filters { margin-top: 0; justify-content: flex-start; }
.product-section .availability-control { flex: 0 0 220px; max-width: 100%; }
.product-section .availability-control label { margin-bottom: 8px; }
.product-section .availability-control select { appearance: auto; width: 100%; min-height: var(--ux-target); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 14px/1.4 Manrope, system-ui, sans-serif; }
@media (max-width: 800px) {
  .product-section .filter-groups { flex-direction: column; align-items: stretch; gap: 18px; }
  .product-section .availability-control { flex: none; width: 100%; }
  .product-section .availability-control select { font-size: 16px; }
}
