/* Layout choices. Each rule only applies when its class is on <body>; the default look adds none. */

/* Header */
.lay-header-center .header-inner { flex-direction: column; gap: 10px; padding-top: 14px; padding-bottom: 12px; height: auto; }
.lay-header-center .main-nav { justify-content: center; flex-wrap: wrap; gap: 26px; }
.lay-header-center .header-actions { position: absolute; right: 24px; top: 14px; }
.lay-header-center .header-inner { position: relative; }
@media (max-width: 860px) {
  .lay-header-center .header-inner { flex-direction: row; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
  .lay-header-center .header-actions { position: static; }
}

/* Product grid */
.lay-grid-compact .product-grid:not(.list-view) { gap: 18px; }

/* Product cards */
.lay-cards-plain .product-card, .lay-cards-plain .rel-card { background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }
.lay-cards-plain .product-card:hover, .lay-cards-plain .rel-card:hover { border-color: transparent; }
.lay-cards-glass .product-card, .lay-cards-glass .rel-card {
  background: color-mix(in srgb, var(--ash) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--bone) 14%, transparent);
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.14);
}
.lay-cards-glass .product-thumb, .lay-cards-glass .rel-thumb { border-radius: 12px; }

/* Product page */
@media (min-width: 861px) {
  .lay-pdp-stacked .product-detail { grid-template-columns: 1fr; max-width: 760px; gap: 28px; }
}


/* ── Buttons and tags ── */
.lay-shape-round .add-to-cart-btn, .lay-shape-round .btn-primary, .lay-shape-round .btn-secondary, .lay-shape-round .filter-bar a, .lay-shape-round .filter-bar button { border-radius: 10px; }
.lay-shape-pill .add-to-cart-btn, .lay-shape-pill .btn-primary, .lay-shape-pill .btn-secondary, .lay-shape-pill .filter-bar a, .lay-shape-pill .filter-bar button { border-radius: 999px; }
.lay-shape-round .product-badge { border-radius: 8px; } .lay-shape-pill .product-badge { border-radius: 999px; }
.lay-shape-round .qty-stepper { border-radius: 10px; } .lay-shape-pill .qty-stepper { border-radius: 999px; }

/* ── Fonts (the chosen pair is defined in <head> as --f-display / --f-body) ── */
[class*="lay-font-"] { font-family: var(--f-body), sans-serif; }
[class*="lay-font-"] .logo-name, [class*="lay-font-"] .footer-wordmark, [class*="lay-font-"] .hub-wordmark, [class*="lay-font-"] .hub-title,
[class*="lay-font-"] .hub-card-title, [class*="lay-font-"] .page-title, [class*="lay-font-"] .product-name, [class*="lay-font-"] .pd-name,
[class*="lay-font-"] .cart-item-name, [class*="lay-font-"] .prose h2, [class*="lay-font-"] .fabric-name, [class*="lay-font-"] .fabric-batch-title,
[class*="lay-font-"] .acct-card-title, [class*="lay-font-"] .rel-title, [class*="lay-font-"] .shipping-option-label, [class*="lay-font-"] .payment-option-label {
  font-family: var(--f-display), serif;
}
[class*="lay-font-"] input, [class*="lay-font-"] select, [class*="lay-font-"] textarea { font-family: var(--f-body), sans-serif; }

/* ── Home page layouts ── */
/* Left-aligned */
.lay-hub-left .hub-wrap { align-items: flex-start; text-align: left; max-width: 1100px; margin: 0 auto; justify-content: flex-start; padding-top: 70px; }
.lay-hub-left .hub-wordmark { font-size: clamp(44px, calc(8vw * var(--fit, 1)), calc(100px * var(--fit, 1))); line-height: .95; }
.lay-hub-left .hub-intro, .lay-hub-left .hub-eyebrow { text-align: left; margin-left: 0; padding-left: 0; }
.lay-hub-left .hub-sections { width: 100%; max-width: none; padding: 0; }
.lay-hub-left .hub-section-title { text-align: left; }
.lay-hub-left .hub-row-single { max-width: none; margin-left: 0; }
.lay-hub-left .hub-card { aspect-ratio: 2.4/1; }

/* Split: title on the left, cards on the right */
@media (min-width: 900px) {
  .lay-hub-split .hub-wrap { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; align-content: center; max-width: 1150px; margin: 0 auto; text-align: left; justify-items: start; }
  .lay-hub-split .hub-wrap > * { grid-column: 1; }
  .lay-hub-split .hub-sections { grid-column: 2; grid-row: 1 / span 6; width: 100%; max-width: none; padding: 0; align-self: center; }
  .lay-hub-split .hub-wordmark { font-size: clamp(44px, calc(6vw * var(--fit, 1)), calc(84px * var(--fit, 1))); }
  .lay-hub-split .hub-intro, .lay-hub-split .hub-eyebrow { text-align: left; margin-left: 0; padding-left: 0; }
  .lay-hub-split .hub-section-title { text-align: left; }
  .lay-hub-split .hub-row-single { max-width: none; margin-left: 0; }
  .lay-hub-split .hub-section { margin-bottom: 28px; }
}

/* Card grid: all cards together, no section titles */
.lay-hub-grid .hub-sections { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1100px; width: 100%; padding: 0; }
.lay-hub-grid .hub-section, .lay-hub-grid .hub-row { display: contents; }
.lay-hub-grid .hub-section-title { display: none; }
.lay-hub-grid .hub-row-single { max-width: none; }
.lay-hub-grid .hub-card { aspect-ratio: 1/1; margin: 0; }
@media (max-width: 760px) { .lay-hub-grid .hub-sections { grid-template-columns: repeat(2, 1fr); } }

/* Minimal list: just clean rows */
.lay-hub-minimal .hub-wrap { max-width: 720px; margin: 0 auto; align-items: stretch; text-align: left; justify-content: flex-start; padding-top: 70px; }
.lay-hub-minimal .hub-intro { margin: 0 0 36px; padding: 0; text-align: left; }
.lay-hub-minimal .hub-eyebrow { text-align: left; }
.lay-hub-minimal .hub-sections { width: 100%; max-width: none; padding: 0; }
.lay-hub-minimal .hub-section { margin-bottom: 0; }
.lay-hub-minimal .hub-section-title { display: none; }
.lay-hub-minimal .hub-row, .lay-hub-minimal .hub-row-2, .lay-hub-minimal .hub-row-single { display: block; max-width: none; margin: 0; }
.lay-hub-minimal .hub-card { aspect-ratio: auto; flex-direction: row; justify-content: space-between; padding: 22px 4px; border: 0; border-bottom: 1px solid var(--slate); background: transparent !important; background-image: none !important; border-radius: 0; box-shadow: none; }
.lay-hub-minimal .hub-card::before, .lay-hub-minimal .hub-card::after { display: none; }
.lay-hub-minimal .hub-card-title { background: transparent; padding: 0; font-size: 26px; }
.lay-hub-minimal .hub-card-arrow { opacity: 1; transform: none; position: static; }


/* ── Safe sizing ──
   Text always wraps instead of being cut off, nothing may be wider than the screen, and big
   headings scale with the width of their own area. --fit evens out wide and narrow font pairs. */
:root { --fit: 1; }
html, body { max-width: 100%; }
body { overflow-wrap: break-word; }
.site-main > *, .hub-wrap, .page-header, .product-grid, .pd-info, .product-detail { min-width: 0; max-width: 100%; }
.hub-wrap { container-type: inline-size; }
.hub-wordmark, .page-title, .pd-name, .hub-card-title, .product-name, .rel-title, .logo-name {
  white-space: normal; overflow-wrap: anywhere; hyphens: manual; text-wrap: balance; max-width: 100%;
}
.hub-wordmark { line-height: 1.05; font-size: clamp(26px, calc(4vw * var(--fit)), calc(38px * var(--fit))); }
.hub-wordmark .hl { display: inline-block; max-width: 100%; }
.product-card, .rel-card, .hub-card { min-width: 0; }
.product-name { font-size: min(var(--pn, 1em), 1.15em); }
@media (max-width: 480px) { .page-title { font-size: min(1em, 11vw); } .pd-name { font-size: min(1em, 9vw); } }

/* Product grids stay centred and never stretch past a sensible card width.
   Applied only when a theme or arrangement is chosen, so the original shop is untouched. */
body[class*="theme-"] .product-grid:not(.list-view), body[class*="lay-"] .product-grid:not(.list-view) {
  --card-min: 230px; --card-max: 340px;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--card-min), 100%), var(--card-max)));
  justify-content: center;
}
.lay-grid-compact .product-grid:not(.list-view) { --card-min: 165px; --card-max: 250px; }
.lay-grid-large .product-grid:not(.list-view) { --card-min: 290px; --card-max: 440px; gap: 32px; }
@media (max-width: 520px) { .lay-grid-large .product-grid:not(.list-view) { --card-min: 100%; } }

/* Header never overflows: a long name wraps, the cart and menu button keep their place */
.header-inner { min-width: 0; }
.logo-lockup { min-width: 0; flex: 0 1 auto; }
.logo-name { line-height: 1.1; }
.header-actions { flex: 0 0 auto; }
@media (max-width: 480px) { .logo-name { font-size: min(1em, 5.2vw); } }

/* Preview bar (admin only, while previewing an unsaved look) */
.look-preview-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2000; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: #111; color: #fff; padding: 10px 18px; border-radius: 999px; font: 600 13px/1.3 system-ui, sans-serif; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: calc(100% - 24px); }
.look-preview-bar a { color: #ffd27a; text-decoration: underline; }
