/* UI pass (loaded last). Overrides only; store.css, polish.css and layouts.css are untouched. */

/* 1. One "coming soon" signal: the top bar. Per-product badges hidden. */
.availability-label { display: none; }

/* 2. Phone grid: shorter, squarer product photos so more fits on screen. */
@media (max-width: 650px) {
  .product-photo { aspect-ratio: 1 / 1; }
  .products { gap: 24px 12px; }
}

/* 3. Bundle tiles: larger and easier to read. */
.bundle-options { gap: 12px; margin: 24px 0 14px; }
.bundle-options button { padding: 18px 16px; gap: 8px; border-radius: 6px; }
.bundle-options button > span { font-size: 14px; }
.bundle-options strong { font-size: 30px; }
.bundle-options small { font-size: 13px; font-weight: 600; }
@media (max-width: 650px) {
  .bundle-options { gap: 10px; }
  .bundle-options button { padding: 16px 13px; }
  .bundle-options button > span { font-size: 13px; }
  .bundle-options strong { font-size: 28px; }
  .bundle-options small { font-size: 12px; }
}

/* 4. Nav: bigger tap targets on phones. */
@media (max-width: 650px) {
  .nav nav { padding: 6px 0 8px; }
  .nav nav a, .nav nav a:last-child { font-size: 13.5px; min-height: 40px; }
}

/* 5. Hat section: tighter copy. */
.hat-feature-copy .hat-facts { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 14px 0 22px; }

/* 6. Shipping: short scannable rows. */
.delivery-rows { margin: 0 0 18px; max-width: 760px; border-top: 1px solid var(--line); }
.delivery-rows > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.delivery-rows dt { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.delivery-rows dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.delivery-info .delivery-note { font-size: 12px; line-height: 1.6; color: var(--muted); max-width: 760px; }
@media (max-width: 650px) {
  .delivery-rows > div { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .delivery-rows dd { font-size: 14px; }
}

/* 7. Section heading: title and subtitle together on the left. */
.section-heading { display: block; }
.section-heading > p { max-width: none; margin-top: 12px; font-size: 14px; }
@media (max-width: 650px) { .section-heading > p { font-size: 13px; } }

/* 8. Footer: give the wordmark room. */
footer { padding-top: 48px; padding-bottom: 48px; }
@media(max-width:650px){.nav nav{gap:8px}.nav nav a,.nav nav a:last-child{font-size:11.5px;white-space:nowrap}}
.footer-brand img { width: 190px; }
@media (max-width: 650px) {
  footer { padding: 44px 20px 48px; gap: 18px; }
  .footer-brand img { width: 170px; }
  footer p, footer a:not(.footer-brand), footer > span { font-size: 12px; }
}

/* Four products fit on one screen, so the filter pills add noise. Hidden, not removed: delete this rule to bring them back. */
.filters { display: none; }
.section-heading { margin-bottom: 24px; }

/* Buy flow: "Buy now" on every card; colour and size are chosen last, in the popup. */
.product-card .swatches, .product-card .product-color { display: none; }
.card-buy { margin-top: 12px; width: 100%; min-height: 44px; border: 0; border-radius: 3px; background: var(--ink); color: var(--paper); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .01em; cursor: pointer; }
.card-buy:hover { opacity: .88; }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.button.ghost[disabled] { opacity: .45; }
.detail-copy > #buy-now { margin-top: 18px; }
.detail-copy > #add-to-bag { margin-top: 10px; }
.set-dialog-content .bundle-purchase > #add-set { margin-top: 10px; }
#buy-now[hidden] { display: none; }
.product-card .product-meta { display: flex; flex-direction: column; }
.product-card .product-fit { margin-bottom: 0; }
.card-buy { margin-top: 14px; }

/* Product popup on phones: smaller photo, size and Buy now visible without scrolling.
   Details (description, delivery, fit) move below the buttons. */
@media (max-width: 650px) {
  #product-dialog .detail-gallery .detail-visual { height: 27vh; max-height: none; min-height: 0; aspect-ratio: auto; overflow: hidden; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
  #product-dialog .detail-gallery .detail-visual > img { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
  #product-dialog .detail-gallery .detail-visual > img.logo-detail { padding: 8% 14%; }
  #product-dialog .photo-caption { display: none; }
  #product-dialog .detail-thumbs { gap: 10px; padding: 8px 20px 8px; }
  #product-dialog .gallery-thumb { width: 52px; }
  #product-dialog .gallery-thumb img { height: 52px; }
  #product-dialog .gallery-thumb span, #product-dialog .gallery-thumb small { display: none; }
  #product-dialog .detail-copy { display: flex; flex-direction: column; padding-top: 14px; padding-bottom: 28px; }
  #product-dialog .detail-copy > :nth-child(1) { display: none; }          /* collection eyebrow */
  #product-dialog .detail-copy > :nth-child(2) { order: 1; margin: 0; font-size: 28px; }   /* name */
  #product-dialog .detail-copy > :nth-child(3) { order: 2; margin: 4px 0 14px; }           /* price */
  #product-dialog .detail-copy > #design-switch { order: 3; margin: 0 0 16px; }           /* Essentials | Fibonacci */
  #product-dialog .detail-copy > :nth-child(8) { order: 3; margin-top: 0; }                /* Color label */
  #product-dialog .detail-copy > :nth-child(9) { order: 4; }                               /* swatches */
  #product-dialog .detail-copy > :nth-child(10) { order: 5; }                              /* Size label */
  #product-dialog .detail-copy > :nth-child(11) { order: 6; }                              /* sizes */
  #product-dialog .detail-copy > #buy-now { order: 7; margin-top: 14px; }
  #product-dialog .detail-copy > #add-to-bag { order: 8; margin-top: 8px; min-height: 44px; }
  #product-dialog .detail-copy > :nth-child(4) { order: 9; margin-top: 20px; }             /* description */
  #product-dialog .detail-copy > :nth-child(5) { order: 10; }                              /* delivery */
  #product-dialog .detail-copy > :nth-child(6) { order: 11; }                              /* fit */
  #product-dialog .detail-copy > details { order: 12; }
}

/* Fit advice under the size buttons and a size guide table. */
.fit-tip { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.fit-tip:empty { display: none; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.size-table-wrap { overflow-x: auto; margin: 12px 0 8px; }
.size-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.size-table th, .size-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.size-table th[scope="row"], .size-table thead th:first-child { text-align: left; font-weight: 600; padding-left: 0; }
.size-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.size-help { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 650px) {
  #product-dialog .detail-copy > .fit-tip { order: 6; }
}

/* "Opening secure checkout" feedback so the wait never looks frozen. */
#checkout-overlay { border: 0; padding: 0; margin: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; background: rgba(250, 250, 247, .94); color: var(--ink); }
#checkout-overlay[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
#checkout-overlay::backdrop { background: transparent; }
#checkout-overlay p { margin: 0; font-size: 15px; font-weight: 600; }
.checkout-spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: checkout-spin .8s linear infinite; }
@keyframes checkout-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .checkout-spinner { animation-duration: 2s; } }
