/* Shop storefront pages (layouts/storefront). Deliberately separate from the
   FabWorks design system: these are the shop's pages, themed by --brand and
   --on-brand, which the layout sets from the shop's brand color. */
.storefront { --brand: #3b82f6; --on-brand: #000000; margin: 0; background: #fff; color: #1a1a1a; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.storefront *, .storefront *::before, .storefront *::after { box-sizing: border-box; }
.storefront h1 { margin: 0; font-size: clamp(28px, 7vw, 44px); line-height: 1.15; overflow-wrap: anywhere; }
.storefront p { margin: 0; }
:where(.storefront) a { color: inherit; }
.storefront img { max-width: 100%; }
.storefront .skip-link { position: fixed; left: 15px; top: -100px; z-index: 100; background: #fff; color: #000; padding: 12px 20px; }
.storefront .skip-link:focus { top: 12px; }
.storefront a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.storefront-preview-banner { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; padding: 10px 16px; background: #fff3bf; color: #1a1a1a; border-bottom: 1px solid #e0c85a; font-size: 14px; text-align: center; }
/* The header pads its content into the same 720px column as .storefront-main. */
.storefront-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 14px max(16px, calc((100% - 720px) / 2 + 16px)); border-top: 6px solid var(--brand); border-bottom: 1px solid #e5e5e5; }
.storefront-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.storefront-back { font-size: 14px; }
.storefront-logo { display: block; width: 128px; height: 128px; object-fit: contain; }
.storefront-logo-small { width: 40px; height: 40px; flex: none; }
.storefront-main { width: min(720px, 100%); margin-inline: auto; padding: 40px 16px 64px; }
.storefront-hero { display: grid; justify-items: start; gap: 20px; }
.storefront-description { max-width: 60ch; white-space: pre-line; overflow-wrap: anywhere; color: #444; }
.storefront-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; background: var(--brand); color: var(--on-brand); border-radius: 6px; font-weight: 700; text-decoration: none; text-align: center; max-width: 100%; overflow-wrap: anywhere; }
.storefront-button:hover { filter: brightness(.92); }
.storefront-contact { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }

/* Quote page (storefront/quotes). One 720px column like the rest of the
   storefront; from 700px the preview and price sit beside the specs. */
.storefront h2 { margin: 0; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.quote-intro, .quote-unavailable { margin-top: 16px; }
.quote-unavailable { display: grid; justify-items: start; gap: 16px; }
.quote-layout { display: grid; gap: 24px; margin-top: 24px; }
@media (min-width: 700px) {
  .quote-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .quote-model { position: sticky; top: 16px; }
}
.quote-model, .quote-side { display: grid; gap: 16px; min-width: 0; }
.quote-file-name { font-size: 16px; }
.quote-viewer { position: relative; aspect-ratio: 4 / 3; background: #f3f4f6; border: 1px solid #e5e5e5; border-radius: 8px; overflow: hidden; }
.quote-viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.quote-viewer-caption { position: absolute; left: 8px; bottom: 8px; right: 8px; margin: 0; padding: 4px 8px; font-size: 13px; background: rgba(255, 255, 255, .85); border-radius: 4px; width: fit-content; max-width: calc(100% - 16px); }
.quote-replace summary, .quote-breakdown summary { cursor: pointer; color: #444; }
.quote-replace[open] summary { margin-bottom: 12px; }

.quote-upload form { display: grid; gap: 12px; margin-top: 16px; }
.quote-dropzone { position: relative; display: grid; gap: 4px; justify-items: center; padding: 40px 16px; border: 2px dashed #c7c7c7; border-radius: 8px; text-align: center; cursor: pointer; }
.quote-dropzone:hover, .quote-dropzone.is-dragging, .quote-dropzone:focus-within { border-color: var(--brand); background: #fafafa; }
.quote-dropzone-title { font-weight: 600; }
.quote-dropzone-browse { color: var(--brand); text-decoration: underline; }
.quote-dropzone-hint, .quote-hint, .quote-muted { color: #555; font-size: 14px; }
.quote-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.quote-progress { width: 100%; accent-color: var(--brand); }
.quote-upload-status:empty { display: none; }
.quote-upload-status.is-error, .quote-error { color: #b42318; }

.quote-specs { display: grid; gap: 16px; }
.quote-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.quote-field[hidden] { display: none; }
.quote-field > label, .quote-field legend { font-weight: 600; padding: 0; }
.quote-field select, .quote-field input[type="text"], .quote-field input[type="number"], .quote-field textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: inherit; background: #fff; border: 1px solid #b8b8b8; border-radius: 6px; }
.quote-field select:focus-visible, .quote-field input:focus-visible, .quote-field textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.quote-choices { gap: 8px; }
.quote-choice { display: flex; gap: 10px; align-items: baseline; font-weight: 400; }
.quote-choice input { flex: none; accent-color: var(--brand); }
.quote-choice-body { display: grid; flex: 1; gap: 2px; }
.quote-choice-line { display: flex; justify-content: space-between; gap: 12px; }
.quote-errors { padding: 12px 16px; border-left: 4px solid #b42318; background: #fef3f2; color: #7a271a; }
.quote-update[hidden] { display: none; }

.quote-price { display: grid; gap: 12px; padding: 20px; border: 1px solid #e5e5e5; border-radius: 8px; background: #fff; }
.quote-total { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.1; }
.quote-total-label { color: #555; font-size: 14px; }
.quote-facts { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.quote-saving { color: #067647; font-weight: 600; }
.quote-note { padding: 8px 12px; background: #f3f4f6; border-radius: 6px; font-size: 14px; }
.quote-breakdown table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 15px; }
.quote-breakdown th { text-align: left; font-weight: 400; padding: 4px 0; }
.quote-breakdown td { text-align: right; padding: 4px 0 4px 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-breakdown tfoot th, .quote-breakdown tfoot td { font-weight: 700; border-top: 1px solid #e5e5e5; }
.quote-calculating { display: flex; gap: 10px; align-items: center; }
.quote-spinner { width: 18px; height: 18px; border: 3px solid #e5e5e5; border-top-color: var(--brand); border-radius: 50%; animation: quote-spin .8s linear infinite; }
@keyframes quote-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .quote-spinner { animation: none; } }

/* Saving, login, and the customer's quotes. */
.quote-narrow { max-width: 480px; }
.quote-save { display: grid; gap: 12px; justify-items: start; padding: 20px; border: 1px solid #e5e5e5; border-radius: 8px; }
.quote-save .quote-specs { width: 100%; }
.quote-save form.button_to { margin: 0; }
.storefront-button-secondary { background: #fff; color: #1a1a1a; border: 1px solid #b8b8b8; }
.storefront-button:disabled { opacity: .6; cursor: not-allowed; }
button.storefront-button { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
button.storefront-button-secondary { border: 1px solid #b8b8b8; }
.quote-total-expired { color: #767676; text-decoration: line-through; }
.quote-list { display: grid; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.quote-card { display: grid; gap: 6px; padding: 16px; border: 1px solid #e5e5e5; border-radius: 8px; text-decoration: none; overflow-wrap: anywhere; }
.quote-card:hover { border-color: var(--brand); }
.quote-card-top, .quote-card-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.quote-badge { padding: 2px 8px; font-size: 13px; font-weight: 600; border-radius: 999px; background: #e7f6ec; color: #067647; }
.quote-badge-expired { background: #f3f4f6; color: #555; }
.quote-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.quote-details dt { font-weight: 600; }
.quote-details dd { margin: 0; overflow-wrap: anywhere; }
.quote-pre { white-space: pre-line; }
.storefront-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 14px; }
.storefront-nav form { margin: 0; }
.storefront-nav button { padding: 0; font: inherit; color: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; }
.storefront-flash { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--brand); background: #f7f7f8; }
.storefront-flash-alert { border-left-color: #b42318; background: #fef3f2; }

/* Manual requests. */
.quote-form-wide { max-width: 640px; margin-top: 24px; }
.quote-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.quote-service-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; }
.quote-service-row input { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; border: 1px solid #b8b8b8; border-radius: 6px; }
.quote-field input[type="date"], .quote-field input[type="email"], .quote-field input[type="tel"], .quote-field input[type="file"] {
  width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: inherit; background: #fff; border: 1px solid #b8b8b8; border-radius: 6px; }
.quote-request { display: grid; gap: 16px; margin-top: 24px; max-width: 720px; }
.quote-request h1 .quote-badge, h1 .quote-badge { vertical-align: middle; font-size: 14px; }
.quote-request h3 { margin: 8px 0 0; font-size: 16px; }
.quote-files { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.quote-thread { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.quote-message { padding: 12px 16px; border-radius: 8px; background: #f7f7f8; overflow-wrap: anywhere; }
.quote-message-shop { border-left: 4px solid var(--brand); }
.quote-event { font-size: 14px; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.quote-earlier { margin-top: 12px; }
.quote-earlier h3 { font-size: 15px; }
.quote-breakdown thead th, .quote-breakdown thead td { font-size: 14px; color: #555; font-weight: 600; text-align: left; }
.quote-breakdown thead td { text-align: right; }

/* Manual requests. */
.quote-form-wide { max-width: 640px; margin-top: 24px; }
.quote-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.quote-service-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; }
.quote-service-row input { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; border: 1px solid #b8b8b8; border-radius: 6px; }
.quote-field input[type="date"], .quote-field input[type="email"], .quote-field input[type="tel"], .quote-field input[type="file"] {
  width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: inherit; background: #fff; border: 1px solid #b8b8b8; border-radius: 6px; }
.quote-request { display: grid; gap: 16px; margin-top: 24px; max-width: 720px; }
h1 .quote-badge { vertical-align: middle; font-size: 14px; }
.quote-request h3 { margin: 8px 0 0; font-size: 16px; }
.quote-files { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.quote-thread { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.quote-message { padding: 12px 16px; border-radius: 8px; background: #f7f7f8; overflow-wrap: anywhere; }
.quote-message-shop { border-left: 4px solid var(--brand); }
.quote-event { font-size: 14px; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.quote-earlier { margin-top: 12px; }
.quote-earlier h3 { font-size: 15px; }
.quote-breakdown thead th, .quote-breakdown thead td { font-size: 14px; color: #555; font-weight: 600; text-align: left; }
.quote-breakdown thead td { text-align: right; }

/* Orders (M2) */
.quote-tabs { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin: 0 0 16px; }
.quote-tabs a[aria-current] { font-weight: 700; text-decoration: none; }
.order-progress { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 12px; }
.order-progress li { flex: 1 1 90px; padding: 8px 6px 0; border-top: 4px solid #e5e5e5; font-size: 14px; color: #555555; }
.order-progress li.is-done { border-top-color: var(--brand); color: inherit; }
.order-progress li[aria-current] { font-weight: 700; }
.order-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.order-timeline li { display: grid; gap: 2px; }
.quote-amounts { grid-template-columns: 1fr max-content; }
.quote-amounts dd { white-space: nowrap; text-align: right; overflow-wrap: normal; }

/* An order's conversation: shows a hint until the first message arrives. */
.order-thread:empty::before { content: "No messages yet."; color: #6b7280; font-size: 0.9rem; }

/* Unread: a small pill beside a count, a row, or a message. */
.unread-badge { display: inline-block; padding: 0 0.45em; border-radius: 999px; background: #2563eb; color: #fff; font-size: 0.75rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }

/* Progress photos: a gallery of thumbnails and a lightbox. */
.photo-gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; width: 100%; }
.photo-gallery li { display: grid; gap: 4px; align-content: start; }
.photo-thumb { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #f0f0f0; }
.photo-lightbox { max-width: min(96vw, 900px); width: 100%; border: 0; border-radius: 8px; padding: 16px; }
.photo-lightbox img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; }
.photo-lightbox-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-lightbox-actions form { margin: 0; }
.photo-inline { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 4px 0 0; }
.photo-inline img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.order-thread .photo-thumb { max-width: 240px; }
.photo-link { display: block; min-width: 0; }
