/* =========================================================
   Components: Section head, Product card, Grid, Rail, Crumbs, Listing,
   Qty, Cart line, Summary, Empty, Wordmark, Rich content, FAQ
   ========================================================= */

/* Section head */
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.shead h2 { font-size: var(--fs-2xl); font-weight: 600; }
.shead p { color: var(--ink-3); margin-top: 6px; font-size: var(--fs-base); }
.shead p b { color: var(--sale); font-weight: 600; }
.shead-aside { display: flex; align-items: center; gap: 16px; flex: none; }
@media (max-width: 640px) { .shead { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 20px; } .shead-aside { width: 100%; justify-content: space-between; } }

/* Product card */
.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pcard-media { display: block; aspect-ratio: 1 / 1; border-radius: var(--r-md); }
.pcard-media > img, .pcard-alt img { position: absolute; inset: 0; }
.pcard-alt { position: absolute; inset: 0; opacity: 0; transition: opacity .45s var(--ease); }
@media (hover: hover) {
  .pcard:hover .pcard-alt { opacity: 1; }
  .pcard:hover .pcard-media > img { transform: scale(1.03); }
}
.pcard-badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; z-index: 2; }
.pcard-out { position: absolute; inset-inline: 10px; bottom: 10px; z-index: 2; text-align: center; background: rgba(255, 255, 255, .92); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; padding: 6px; border-radius: var(--r-sm); }
.pcard.is-out .pcard-media img { filter: grayscale(.6); opacity: .75; }
.pcard-add {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding-inline: 12px;
  border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-2); transition: opacity .25s var(--ease), transform .25s var(--ease), background .2s, color .2s; z-index: 3;
}
.pcard-add .pcard-ok { display: none; }
.pcard-add.is-added { background: var(--olive-600); color: #fff; }
.pcard-add.is-added .i:first-child { display: none; }
.pcard-add.is-added .pcard-ok { display: block; }
.pcard-add:hover { background: var(--ink); color: #fff; }
.pcard-body { padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.pcard-brand { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; text-transform: uppercase; align-self: flex-start; }
.pcard-brand:hover { color: var(--olive-700); }
.pcard-name { font-size: var(--fs-base); font-weight: 500; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.55em * 2); }
.pcard-name a:hover { color: var(--olive-700); }
.pcard-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.pcard-price .price { font-size: var(--fs-md); }
.pcard-stock { font-size: var(--fs-xs); color: var(--warn); }

.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }
@media (max-width: 1100px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; } .pcard-name { font-size: 14px; } .pcard-price .price { font-size: var(--fs-base); } }

.pcard { display: grid; grid-template-rows: auto 1fr; }
.pcard > .pcard-media { grid-row: 1; grid-column: 1; }
.pcard > .pcard-add { grid-row: 1; grid-column: 1; position: relative; align-self: end; justify-self: end; margin: 0 10px 10px; inset: auto; transform: none; }
.pcard > .pcard-body { grid-row: 2; grid-column: 1; }
@media (hover: hover) and (min-width: 768px) {
  .pcard > .pcard-add { opacity: 0; transform: translateY(6px); }
  .pcard:hover > .pcard-add, .pcard > .pcard-add:focus-visible, .pcard > .pcard-add.is-added { opacity: 1; transform: none; }
}
@media (max-width: 767px) {
  .pcard > .pcard-add { width: 36px; height: 36px; padding: 0; justify-content: center; margin: 0 8px 8px; }
  .pcard > .pcard-add span { display: none; }
}

/* Rail */
.rail { margin-inline: calc(var(--gutter) * -1); }
.rail-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 24px - 2 * var(--gutter)) / 4); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 4px var(--gutter) 8px; scrollbar-width: none; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-item { scroll-snap-align: start; min-width: 0; }
.rail-nav { display: flex; gap: 6px; }
.rail-nav .icon-btn { border: 1px solid var(--line-strong); width: 40px; height: 40px; }
.rail-nav .icon-btn:disabled { opacity: .35; pointer-events: none; }
@media (max-width: 1100px) { .rail-track { grid-auto-columns: calc((100% - 2 * 24px - 2 * var(--gutter)) / 3.2); } }
@media (max-width: 767px) { .rail-track { grid-auto-columns: 44%; gap: 14px; } }

/* Crumbs */
.crumbs { padding-block: 18px 0; font-size: var(--fs-sm); color: var(--ink-3); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.crumbs li > span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.crumbs a:hover { color: var(--ink); }
.crumbs .i { color: var(--ink-4); width: 14px; height: 14px; }

/* Page head */
.phead { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.phead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 22px; flex-wrap: wrap; }
.phead h1 { font-size: var(--fs-3xl); font-weight: 600; }
.phead p { color: var(--ink-3); margin-top: 8px; max-width: 640px; }
.phead-count { color: var(--ink-3); font-size: var(--fs-sm); }
.section-tight { padding-top: 28px; }

/* Listing */
.listing { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 40px; align-items: start; }
.listing-side { position: sticky; top: calc(var(--header-h) + 64px); max-height: calc(100vh - var(--header-h) - 80px); display: flex; flex-direction: column; }
.listing-filters { overflow-y: auto; padding-inline-end: 6px; scrollbar-width: thin; }
.fgroup { padding-block: 18px; border-bottom: 1px solid var(--line); }
.fgroup:first-child { padding-top: 0; }
.fgroup-title { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 8px; }
.fopts-scroll { max-height: 260px; overflow-y: auto; }
.checkbox.is-dim { opacity: .45; }
.checkbox input[type="radio"] { border-radius: 50%; }
.checkbox input[type="radio"]:checked::after { width: 6px; height: 6px; border: 0; background: #fff; border-radius: 50%; transform: none; }
.ltools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lsearch { flex: 1; min-width: 200px; position: relative; display: flex; align-items: center; }
.lsearch .i { position: absolute; inset-inline-start: 12px; color: var(--ink-3); pointer-events: none; }
.lsearch input { width: 100%; height: 42px; padding-inline: 36px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); font-size: var(--fs-sm); }
.lsearch input:focus { outline: none; border-color: var(--olive-600); box-shadow: 0 0 0 3px var(--olive-100); }
.lsearch-lg { max-width: 360px; }
.lsearch-lg input { height: 46px; font-size: var(--fs-base); }
.lsort { position: relative; display: flex; align-items: center; }
.lsort .i { position: absolute; inset-inline-start: 12px; color: var(--ink-3); pointer-events: none; }
.lsort select { appearance: none; height: 42px; padding-inline: 36px 34px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%237C766B' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 12px center; font-size: var(--fs-sm); cursor: pointer; }
.lsort select:focus { outline: none; border-color: var(--olive-600); }
.lmeta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 24px; min-height: 32px; }
.lcount { font-size: var(--fs-sm); color: var(--ink-3); }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 12px 8px; border-radius: var(--r-pill); background: var(--olive-50); border: 1px solid var(--olive-100); color: var(--olive-800); font-size: var(--fs-xs); font-weight: 500; }
.fchip:hover { border-color: var(--olive-300); }
.fchip .i { width: 14px; height: 14px; }
.fchip-clear { font-size: var(--fs-xs); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.lmore { display: grid; justify-items: center; gap: 12px; margin-top: 48px; }
.lmore p { font-size: var(--fs-sm); }
.lmore-bar { width: 200px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.lmore-bar span { display: block; height: 100%; background: var(--ink); }
.pgrid-listing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1280px) { .all-products .pgrid-listing { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.listing-side-head, .listing-side-foot { display: none; }

@media (max-width: 1023px) {
  .listing { grid-template-columns: minmax(0, 1fr); }
  .listing-side { position: fixed; inset: 0; z-index: 110; max-height: none; top: 0; background: var(--cream); transform: translateY(100%); transition: transform .32s var(--ease); visibility: hidden; }
  .listing-side.is-open { transform: none; visibility: visible; }
  .listing-side-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 12px 20px; padding-inline: 20px 12px; border-bottom: 1px solid var(--line); }
  .listing-side-head h3 { font-size: var(--fs-lg); }
  .listing-filters { flex: 1; padding: 16px 20px; }
  .listing-side-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
  .pgrid-listing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .pgrid-listing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ltools { display: grid; grid-template-columns: 1fr 1fr; }
  .lsearch { grid-column: 1 / -1; min-width: 0; }
  .lsort select { width: 100%; }
  .lfilter-btn { height: 42px; }
}

/* Qty */
.qty { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); }
.qty button { width: 36px; height: 100%; display: grid; place-items: center; color: var(--ink-2); }
.qty button:hover:not(:disabled) { color: var(--ink); background: var(--sand-50); }
.qty button:disabled { opacity: .3; cursor: not-allowed; }
.qty span { min-width: 28px; text-align: center; font-weight: 600; font-size: var(--fs-sm); }
.qty-lg { height: 54px; }
.qty-lg button { width: 44px; }
.qty-lg span { min-width: 36px; font-size: var(--fs-md); }

/* Cart line */
.cline { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line); align-items: start; }
.cline-media { width: 84px; height: 84px; border-radius: var(--r-sm); }
.cline-media img { position: absolute; inset: 0; }
.cline-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cline-brand { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; }
.cline-name { font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cline-name:hover { color: var(--olive-700); }
.cline-meta { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-sm); }
.cline-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cline-remove { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); padding: 8px; margin-inline-end: -8px; border-radius: var(--r-sm); }
.cline-remove:hover { color: var(--danger); background: var(--sale-bg); }
.cline-total { text-align: end; }

/* Summary list */
.sumlist { display: grid; gap: 10px; margin: 0; }
.sumlist > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--fs-sm); }
.sumlist dt { color: var(--ink-2); }
.sumlist dd { margin: 0; }
.sumlist .price { font-weight: 500; }
.sum-save dd, .sum-save .price, .sum-save .price .cur { color: var(--success); }
.sum-total { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.sum-total dt { font-weight: 600; color: var(--ink); font-size: var(--fs-base); }
.sum-total .price { font-size: var(--fs-xl); font-weight: 700; }

/* Empty states */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 72px 20px; color: var(--ink-2); }
.empty > .i { width: 40px; height: 40px; color: var(--ink-4); margin-bottom: 8px; }
.empty h3, .empty h1 { font-size: var(--fs-xl); color: var(--ink); }
.empty p { color: var(--ink-3); max-width: 420px; }
.empty .btn { margin-top: 12px; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.empty-inline { padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.empty-404 .nf-code { font-size: 96px; font-weight: 300; color: var(--olive-300); line-height: 1; }

/* Wordmarks (brand logos as typography) */
.wordmark { font-family: var(--font-latin); font-size: 22px; color: var(--ink); line-height: 1; white-space: nowrap; direction: ltr; }
.wm-sans { font-weight: 600; letter-spacing: -.01em; }
.wm-sans-bold { font-weight: 700; letter-spacing: -.03em; }
.wm-sans-caps { font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 17px; }
.wm-serif { font-family: 'IBM Plex Serif', Georgia, serif; font-weight: 600; font-style: italic; }
.wm-serif-caps { font-family: 'IBM Plex Serif', Georgia, serif; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; font-size: 17px; }

/* Rich content */
.rich { max-width: 760px; }
.rich > * + * { margin-top: 20px; }
.rc-h { color: var(--ink); }
.rc-h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; margin-top: 8px; }
.rc-h3 { font-size: var(--fs-lg); font-weight: 600; }
.rc-h4 { font-size: var(--fs-md); font-weight: 600; }
.rich > .rc-h + * { margin-top: 12px; }
.rich > * + .rc-h3 { margin-top: 36px; }
.rc-p { color: var(--ink-2); font-size: var(--fs-md); line-height: 1.9; }
.rc-list { list-style: none; display: grid; gap: 10px; }
.rc-list li { position: relative; padding-inline-start: 22px; color: var(--ink-2); line-height: 1.8; }
.rc-list li::before { content: ''; position: absolute; inset-inline-start: 4px; top: .78em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500); }
.rc-ol { counter-reset: rc; }
.rc-ol li { counter-increment: rc; padding-inline-start: 34px; }
.rc-ol li::before { content: counter(rc); width: 22px; height: 22px; top: .3em; inset-inline-start: 0; background: var(--sand-100); color: var(--ink-2); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.rc-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.rc-spec { display: grid; gap: 2px; padding: 18px 18px 16px; border-inline-start: 1px solid var(--line); }
.rc-spec:first-child { border-inline-start: 0; }
.rc-spec .i { color: var(--olive-600); margin-bottom: 8px; width: 22px; height: 22px; }
.rc-spec-label { font-size: var(--fs-xs); color: var(--ink-3); }
.rc-spec-value { font-size: var(--fs-md); font-weight: 600; }
@media (max-width: 640px) {
  .rc-specs { grid-template-columns: 1fr 1fr; }
  .rc-spec { border-inline-start: 0; border-bottom: 1px solid var(--line); }
  .rc-spec:nth-child(odd) { border-inline-end: 1px solid var(--line); }
  .rc-spec:nth-last-child(-n+2):nth-child(odd), .rc-spec:last-child { border-bottom: 0; }
}
.rc-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.rc-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rc-table caption { caption-side: bottom; text-align: start; padding: 10px 16px; font-size: var(--fs-xs); color: var(--ink-3); border-top: 1px solid var(--line); }
.rc-table th, .rc-table td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.rc-table thead th { background: var(--sand-50); font-weight: 600; color: var(--ink-2); font-size: var(--fs-xs); }
.rc-table tbody th { font-weight: 500; color: var(--ink-2); width: 40%; }
.rc-table tbody tr:last-child th, .rc-table tbody tr:last-child td { border-bottom: 0; }
.rc-figure { margin: 28px 0 0; }
.rc-figure .media img { position: absolute; inset: 0; }
.rc-figure figcaption { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 10px; }
.rc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; padding-block: 12px; }
.rc-split.is-reverse .rc-split-media { order: 2; }
.rc-split-media { aspect-ratio: 5 / 4; }
.rc-split-media img { position: absolute; inset: 0; }
.rc-split-text .rc-p { margin-top: 10px; font-size: var(--fs-base); }
@media (max-width: 640px) { .rc-split { grid-template-columns: 1fr; gap: 16px; } .rc-split.is-reverse .rc-split-media { order: 0; } }
.rc-callout { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--r-md); border-inline-start: 3px solid; }
.rc-callout .i { margin-top: 3px; }
.rc-callout p { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.8; }
.rc-callout-title { font-weight: 600; color: var(--ink) !important; font-size: var(--fs-base) !important; margin-bottom: 2px; }
.rc-info { background: var(--olive-50); border-color: var(--olive-500); }
.rc-info .i { color: var(--olive-600); }
.rc-tip { background: var(--caramel-100); border-color: var(--caramel-500); }
.rc-tip .i { color: var(--caramel-600); }
.rc-warn { background: var(--warn-bg); border-color: #D9A441; }
.rc-warn .i { color: var(--warn); }
.rc-steps { list-style: none; display: grid; gap: 0; }
.rc-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; position: relative; padding-bottom: 20px; }
.rc-steps li:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 17px; top: 38px; bottom: 4px; width: 1px; background: var(--line-strong); }
.rc-step-n { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--olive-300); color: var(--olive-700); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-sm); background: var(--paper); }
.rc-step-title { font-weight: 600; margin-top: 5px; }
.rc-steps p:not(.rc-step-title) { color: var(--ink-2); font-size: var(--fs-sm); }
.rc-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rc-section + .rc-section { margin-top: 0; border-top: 0; }
.rc-section summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; font-size: var(--fs-md); font-weight: 600; cursor: pointer; }
.rc-section summary::-webkit-details-marker { display: none; }
.rc-section summary .i { transition: transform var(--t); color: var(--ink-3); }
.rc-section[open] summary .i { transform: rotate(180deg); }
.rc-section-body { padding-bottom: 24px; }
.rc-section-body > * + * { margin-top: 16px; }
.rc-hr { border: 0; border-top: 1px solid var(--line); margin-block: 32px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; font-size: var(--fs-md); font-weight: 500; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; transition: transform var(--t), background var(--t); }
.faq-item[open] .faq-icon { transform: rotate(45deg); background: var(--ink); color: #fff; border-color: var(--ink); }
.faq-a { padding-bottom: 22px; color: var(--ink-2); max-width: 640px; line-height: 1.9; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
