/* The shop's floating interfaces share the page's materials and type. */
.modal-open { overflow: hidden; }
dialog {
  width: min(680px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg, #eeecea);
  color: var(--ink, #333231);
  font-family: var(--font, 'Bricolage Grotesque', sans-serif);
  font-size: 16px;
  line-height: 1.5;
  box-shadow: 0 20px 80px rgb(0 0 0 / .15); /* taste-skill-ignore: Native dialogs are real floating overlays. */
  scrollbar-gutter: stable;
}
dialog::backdrop { background: rgb(51 50 49 / .48); }
dialog[open] { display: block; }
dialog *, dialog *::before, dialog *::after { box-sizing: border-box; }
.modal-shell { position: relative; padding: 44px; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface, #e4e1dd);
  color: var(--ink, #333231);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms var(--ease, ease), background-color 160ms ease;
}
.modal-close:active { transform: scale(.94); }
dialog :focus-visible, .toast:focus-visible {
  outline: 3px solid var(--accent, #5c6b54);
  outline-offset: 4px;
}
.modal-title {
  margin: 0 40px 24px 0;
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.04em;
  white-space: normal;
}
dialog h3 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
}
dialog p { margin: 0 0 20px; }
dialog .caption, dialog small {
  display: block;
  color: var(--muted, #6b6763);
  font-size: 14px;
  line-height: 1.5;
}
dialog .progress-label {
  margin: 0 44px 14px 0;
  color: var(--muted, #6b6763);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
dialog .notice {
  padding: 18px 20px;
  background: var(--surface, #e4e1dd);
  color: var(--ink, #333231);
  font-size: 14px;
  line-height: 1.5;
}
dialog .button, dialog .text-button { min-height: 44px; font-size: 16px; }
dialog button:disabled { opacity: .45; cursor: not-allowed; }
dialog .field, dialog .field-group {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  color: var(--ink, #333231);
  font-size: 16px;
}
dialog input, dialog select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 13px 16px;
  border: 0;
  border-radius: 0;
  background: var(--surface, #e4e1dd);
  color: var(--ink, #333231);
  font: inherit;
  font-size: 18px;
  line-height: 1.3;
}
dialog input::placeholder { color: var(--muted, #6b6763); opacity: 1; }
dialog input[aria-invalid='true'] { outline: 2px solid var(--ink, #333231); outline-offset: 0; }
dialog .field-error { margin-top: 12px; color: var(--ink, #333231); font-size: 16px; font-weight: 600; }
dialog .swatches { display: flex; gap: 12px; }
dialog .swatch { width: 36px; height: 36px; min-width: 36px; }

/* Product detail: one generous product surface, followed by the actual choice. */
.product-dialog { width: min(1050px, calc(100% - 48px)); }
.product-dialog .modal-shell { padding: 58px 44px 44px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.product-detail-grid > * { min-width: 0; }
.product-detail-photo { background: var(--surface, #e4e1dd); }
.product-detail-photo .product-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 24px;
  object-fit: contain;
}
.product-detail-photo .caption { margin: 0; padding: 0 24px 24px; }
.product-detail-copy .modal-title { margin-right: 0; margin-bottom: 20px; }
.product-detail-copy .detail-price { margin: 0 0 24px; font-size: 26px; font-weight: 500; line-height: 1.2; }
.product-detail-copy .product-spec { display: grid; gap: 5px; margin: 24px 0; }
.product-spec dt { font-size: 14px; color: var(--muted, #6b6763); }
.product-spec dd { margin: 0; font-size: 20px; font-weight: 500; }
.product-detail-copy .button { width: 100%; justify-content: space-between; }
.product-detail-copy .caption:last-child { margin: 16px 0 0; }
#detail-quantity { max-width: 126px; }

/* Bag drawer. Product rows remain readable with a long translated name. */
.drawer-dialog {
  width: min(560px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
}
.drawer-dialog .modal-shell { min-height: 100%; padding: 56px 32px 32px; }
.cart-lines { display: grid; gap: 16px; margin: 28px 0; }
.cart-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.cart-thumb { width: 96px; height: 116px; background: var(--surface, #e4e1dd); }
.cart-thumb .product-photo { display: block; width: 100%; height: 100%; padding: 10px; object-fit: contain; }
.cart-line-details { padding: 5px 0; }
.cart-line-details h3 { margin: 0 0 5px; font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.cart-line-details p { margin: 0 0 10px; color: var(--muted, #6b6763); font-size: 14px; line-height: 1.4; }
.quantity-control { display: inline-grid; grid-template-columns: 36px 32px 36px; gap: 0; align-items: center; background: var(--surface, #e4e1dd); }
.quantity-control button {
  width: 36px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink, #333231);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease, ease);
}
.quantity-control button:active { transform: scale(.9); }
.quantity-control span { text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; }
.cart-line-end { display: grid; justify-items: end; gap: 12px; padding-top: 5px; }
.cart-line-end strong { font-size: 17px; white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.cart-line-end .text-button { min-height: 40px; padding: 0; color: var(--muted, #6b6763); font-size: 14px; }
.cart-summary { display: grid; gap: 14px; margin-top: 30px; padding: 24px; background: var(--surface, #e4e1dd); }
.cart-summary > p { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin: 0; font-size: 17px; }
.cart-summary strong { flex-shrink: 0; font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cart-summary > small { margin: 0; }
.cart-summary > .button { width: 100%; justify-content: space-between; margin-top: 6px; }
.empty-state { display: grid; justify-items: start; gap: 18px; padding: 52px 0 22px; }
.empty-state > span { display: none; }
.empty-state h3, .empty-state p { margin: 0; }

/* The finder stays a form: selected choices are strong, filled surfaces. */
.finder-step { margin-top: 30px; }
.finder-step > p { margin-bottom: 26px; }
.choice-grid { display: grid; gap: 10px; margin: 24px 0; }
.choice-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: var(--surface, #e4e1dd);
  color: var(--ink, #333231);
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms var(--ease, ease), background-color 160ms ease;
}
.choice-button.is-active { background: var(--accent, #5c6b54); color: var(--bg, #eeecea); }
.choice-button:active { transform: scale(.985); }
.choice-button .color-dot { display: block; width: 28px; height: 28px; flex: 0 0 28px; margin-right: auto; }
.choice-button:has(.color-dot) { justify-content: flex-start; }
.choice-button:has(.color-dot) .color-dot { margin-right: 0; }
.finder-navigation { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.finder-navigation .button { justify-content: space-between; gap: 28px; }
.finder-navigation .button-secondary { margin-right: auto; }
.finder-result .product-photo { display: block; width: min(250px, 100%); height: 210px; margin: 0 auto 24px; object-fit: contain; background: var(--surface, #e4e1dd); }
.finder-result h3 { margin-bottom: 14px; }
.finder-result .button { width: 100%; justify-content: space-between; }
.finder-step .empty-state { padding-top: 8px; }

/* Checkout is an explicit recap and contains no customer or payment fields. */
.checkout-lines { display: grid; gap: 12px; margin: 28px 0; }
.checkout-line { display: flex; justify-content: space-between; gap: 20px; padding: 16px 18px; background: var(--surface, #e4e1dd); font-size: 16px; }
.checkout-line span { min-width: 0; }
.checkout-line strong { flex-shrink: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
#checkout-content > .button { width: 100%; justify-content: space-between; margin-top: 24px; }
.checkout-success { display: grid; justify-items: start; gap: 24px; padding-top: 10px; }
.checkout-success .modal-title, .checkout-success p { margin: 0; }
.checkout-success .button { width: 100%; }

.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 16px 24px;
  background: var(--ink, #333231);
  color: var(--bg, #eeecea);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms var(--ease, ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) {
  .modal-close:hover, .quantity-control button:hover { background: var(--field, #cdc3b6); }
  .choice-button:not(.is-active):hover { background: var(--field, #cdc3b6); }
}
@media (max-width: 760px) {
  .product-detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .product-detail-photo .product-photo { max-height: 310px; padding: 20px; }
  .product-detail-photo .caption { padding: 0 20px 20px; }
}
@media (max-width: 480px) {
  dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .modal-shell { padding: 62px 24px 28px; }
  .modal-close { top: 10px; right: 10px; }
  .modal-title { margin-right: 0; font-size: 32px; }
  dialog h3 { font-size: 25px; }
  .product-dialog { width: calc(100% - 24px); }
  .product-dialog .modal-shell { padding: 62px 24px 28px; }
  .product-detail-photo .product-photo { max-height: 260px; }
  .drawer-dialog { width: 100%; max-height: 100dvh; }
  .drawer-dialog .modal-shell { padding: 62px 20px 28px; }
  .cart-line { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .cart-thumb { width: 76px; height: 102px; grid-row: span 2; }
  .cart-line-details h3 { font-size: 18px; }
  .cart-line-end { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0; }
  .cart-line-end .text-button { min-height: 44px; }
  .cart-lines { gap: 28px; }
  .cart-summary { padding: 20px; }
  .cart-summary > p { font-size: 16px; }
  .cart-summary strong { font-size: 20px; }
  .finder-navigation { gap: 10px; }
  .finder-navigation .button { flex: 1 1 auto; gap: 14px; }
  .finder-navigation .button-secondary { margin: 0; }
  .choice-button { min-height: 60px; padding: 16px 18px; }
  .checkout-line { flex-wrap: wrap; gap: 8px; }
  .checkout-line strong { margin-left: auto; }
  .toast { bottom: max(16px, env(safe-area-inset-bottom)); padding: 14px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-close, .quantity-control button, .choice-button, .toast { transition: none; }
  .modal-close:active, .quantity-control button:active, .choice-button:active { transform: none; }
}
