/* ============================================================================
   RARA · components.css — cross-page reusable components:
   buttons, badges (incl. the gold Colección tier badge), product card,
   skeletons, filter chips, the ONE ficha bar, PDP accord rows.
   Loaded globally after base.css. Motion/keyframes live in motion.css.
   ============================================================================ */

/* ---------- buttons ---------- */
/* Micro-physics (hover lift / active press) is layered in motion.css on .btn. */
.btn{display:inline-flex;align-items:center;gap:12px;background:var(--burgundy);color:var(--cream);font-size:14px;letter-spacing:.04em;padding:16px 30px;border:0;cursor:pointer;min-height:48px;transition:background var(--dur-fast,.2s) var(--ease-out,ease)}
.btn:hover{background:var(--burgundy-deep)}
.btn-ghost{background:var(--cream-2);color:var(--ink)}
.btn-ghost:hover{background:var(--line)}
.btn-sm{padding:8px 12px;font-size:12px;min-height:38px;border:0;cursor:pointer}

/* ---------- badges ---------- */
.badge{display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;padding:6px 11px;border:1px solid var(--line-2)}
/* Colección tier chip — gold RETIRED (owner warmth escalation, 4th): the semantic
   tier chip is now ink text + a var(--line) hairline, no decorative gold on the
   light card/PDP ground. Gold survives only in the acta guilloché + header seal
   + footer gold-light on burgundy (dark, blessed). */
.badge-tier{border-color:var(--line);color:var(--ink)}
/* Provenance / trust badges demoted off gold onto the single accent + success. */
.badge-prov{border-color:var(--burgundy);color:var(--burgundy)}
.badge-preorder{border-color:var(--burgundy);background:var(--burgundy);color:var(--cream)}

/* ---------- product grid (shared: home featured, catalog results, PDP related) ---------- */
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:28px 24px}
@media(max-width:1000px){.grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:600px){.grid{grid-template-columns:repeat(2,1fr)}}
/* Wide-screen tiers (Slice · widescreen pass): the grid GAINS columns as --wrap
   grows in tokens.css, rather than the 4 base cards stretching to fill the extra
   width. Card width is held ~310-320px at every tier (same math as the 4-col
   desktop card: (wrap - (cols-1)*gap)/cols), so density feels consistent, not
   cramped or bloated. Guarded to min-width:1920px so the <=1600px grid is untouched. */
@media(min-width:1920px){.grid{grid-template-columns:repeat(5,1fr)}}
@media(min-width:2560px){.grid{grid-template-columns:repeat(6,1fr)}}
@media(min-width:3200px){.grid{grid-template-columns:repeat(7,1fr)}}

/* ---------- product card ---------- */
.card{display:block;background:transparent}
.card .ph{position:relative;aspect-ratio:3/4;background:linear-gradient(150deg,var(--cream-2),var(--ph-1));overflow:hidden}
.card .ph img{width:100%;height:100%;object-fit:contain;background:#FFFFFF}
/* Designed no-image plate (NO-IMAGELESS LAW, owner 2026-07-13): the fallback SVG
   paints its own #F5F5F5 (--cream) ground, so the img background must match it —
   contain-fit letterbox bars then read as one seamless plate in every box ratio
   (3/4 cards, 4/5 mats/thumbs, 16/10 mobile soon rows). Lives here because the
   fallback renders on home/catalog/PDP/cart alike (same rule as .note-chip).
   Doubled class beats the page-sheet `.x img` (0,1,1) rules regardless of sheet
   order; `.card .ph img` above ties at (0,2,1) and loses by source order. */
img.is-fallback.is-fallback{object-fit:contain;background:var(--cream,#F5F5F5)}
.card .sku{font-family:var(--mono);font-size:10px;letter-spacing:.12em;color:var(--cream);background:rgba(89,28,42,.92);padding:4px 8px}

/* ---------- card top chips: stacking layout (sku left, badges right) ----------
   sku + badges share ONE absolutely-positioned top row (justify-between) so they
   never overlap, even on narrow PDP cross-sell cards, which previously collided
   because .card-badge's positioning lived in catalog.css (not loaded on the PDP).
   This lives in components.css so it holds on home, catalog and PDP alike. Extra
   badges (Próximamente + Colección) stack downward on the right. */
.card .ph .card-tags{position:absolute;top:12px;left:12px;right:12px;z-index:1;
  display:flex;justify-content:space-between;align-items:flex-start;gap:8px;pointer-events:none}
.card .ph .card-tags .sku{align-self:flex-start}
.card .card-badges{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.card .card-badge{background:var(--surface)}
/* Próximamente chip: the single accent (burgundy), cream text (AA ~10:1). */
.chip-soon{display:inline-flex;align-items:center;font-family:var(--mono);font-size:10px;
  letter-spacing:.12em;text-transform:uppercase;padding:4px 9px;color:var(--cream);background:var(--burgundy)}
.card-soon-date{font-family:var(--mono);font-size:12px;letter-spacing:.02em;color:var(--burgundy);font-weight:500}

.card .house{font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--warm-grey);margin:12px 0 6px}
.card .name{font-family:var(--serif);font-size:21px;line-height:1.1;margin-bottom:8px}
/* card note chips + family fallback — shared: home featured, catalog, casas, origen, search (base.html loads components.css everywhere; catalog.css is page-scoped, which hid the dots on home). Dot = accord-family hue data-mark; text stays muted ink. Cap is 2 chips on cards at all widths: narrow facet-rail cards wrap 3 -> ragged; PDP keeps the full accord meter set. nth-of-type is intentional because the catalog Alpine grid's first child is a <template>. */
.card-notes{font-family:var(--sans);font-size:12px;line-height:1.3;color:var(--muted);
  margin:0 0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-accords{font-family:var(--sans);font-size:12px;line-height:1.3;color:var(--muted);
  margin:0 0 10px;display:flex;flex-wrap:wrap;gap:4px 12px}
.card-accords .note-chip:nth-of-type(n+3){display:none}
.note-chip{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.note-dot{width:9px;height:9px;border-radius:50%;flex:none;display:inline-block}
.card .price{display:flex;align-items:center;justify-content:space-between;font-family:var(--mono);font-size:13px;border-top:1px solid var(--line);padding-top:10px;margin-top:8px}
/* compare-at strike on the card (owner directive 2026-07-07): muted, smaller, after
   the from-price. Renders only when the cheapest active size carries an anchor above
   it (Product.from_compare_at). Achromatic: existing tokens only, no new color. */
.card .card-was{margin-left:8px;color:var(--warm-grey);font-size:11px;text-decoration:line-through;text-decoration-thickness:1px}
.card .arrow{color:var(--burgundy);transition:transform var(--dur-fast,.2s) var(--ease-out,ease)}
.card:hover .arrow{transform:translateX(3px)}
/* Community rating line (Home V1) — render-when-present, rating_count ≥ 10. Serif
   value + mono count; the substance a fashion-house grid can't print. Global
   (components.css) so it styles on both the home grids and the catalog grid. */
.card-rating{display:flex;align-items:baseline;gap:5px;margin:-2px 0 8px}
.card-rating-v{font-family:var(--serif);font-size:15px;line-height:1;color:var(--ink)}
.card-rating-n{font-size:11px;letter-spacing:.03em;color:var(--warm-grey)}
/* "· N tallas" size-ladder hint appended to the price row (multi-size only). */
.card-sizes{color:var(--warm-grey);white-space:nowrap}

/* ---------- skeletons (shimmer keyframes in motion.css) ---------- */
.skeleton .ph{background:linear-gradient(100deg,var(--cream-2) 30%,var(--sk-1) 50%,var(--cream-2) 70%);background-size:200% 100%;animation:sh 1.2s infinite}
.skeleton .name{height:18px;width:70%;background:var(--cream-2);border-radius:2px}

/* ---------- filter chips (catalog applied-summary) ---------- */
.chips{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:20px}
.chips-label{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--warm-grey)}
.chip{display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:11px;letter-spacing:.04em;background:var(--cream-2);color:var(--ink);border:1px solid var(--line-2);padding:6px 11px;cursor:pointer;min-height:32px;transition:color var(--dur-fast,.2s),border-color var(--dur-fast,.2s)}
.chip:hover{border-color:var(--burgundy);color:var(--burgundy)}
.chip-clear{background:none;color:var(--burgundy);border-color:var(--burgundy)}

/* ---------- the ONE ficha bar (accords · seasons · day/night · Duración · Estela) ----------
   Label sits in a fixed dark-ink column OUTSIDE the fill, legible at any width. */
.fbars{display:flex;flex-direction:column;gap:13px}
.fbar{display:grid;grid-template-columns:104px 1fr 92px;gap:14px;align-items:center}
.fbar-label{font-family:var(--mono);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink)}
.fbar-track{position:relative;height:8px;background:var(--cream-2)}
.fbar-fill{position:absolute;top:0;bottom:0;left:0;min-width:3px;background:var(--burgundy)}
.fbar-trail{font-family:var(--serif);font-size:15px;color:var(--burgundy);text-align:right}
.fbar-sub{margin-top:18px;padding-top:18px;border-top:1px solid var(--line)}
@media(max-width:600px){.fbar{grid-template-columns:84px 1fr 70px}}

/* ---------- order/price summary (shared: cart aside, checkout aside, confirmation, order detail) ---------- */
.sum-row{display:flex;justify-content:space-between;align-items:baseline;font-size:14px;padding:9px 0}
.sum-muted{color:var(--muted);font-size:13px}
.sum-total{border-top:1px solid var(--line);margin-top:6px;padding-top:14px;font-family:var(--serif);font-size:22px}
.sum-ship{font-size:11px;letter-spacing:.04em;color:var(--good);margin-top:10px}
.sum-nudge{color:var(--gold-ink)}   /* free-ship nudge: a gentle upsell, not the "you qualify" confirmation */
/* the _summary.html line block, reused by checkout/confirmation/order detail */
.osum-lines{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}
.osum-line{display:flex;justify-content:space-between;gap:14px;align-items:start;padding-bottom:12px;border-bottom:1px solid var(--line)}
.osum-house{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--warm-grey)}
.osum-name{font-size:16px;line-height:1.15}
.osum-sub{font-size:11px;color:var(--muted)}
.osum-total{font-size:15px;white-space:nowrap}
.osum-rows .sum-row{padding:7px 0}

/* ---------- PDP accord intensity rows (label in a fixed dark-ink column) ---------- */
.accords{display:flex;flex-direction:column;gap:11px;margin-top:6px}
.acc{display:grid;grid-template-columns:128px 1fr 32px;align-items:center;gap:12px}
.acc-label{font-family:var(--mono);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink)}
.acc-track{position:relative;height:8px;background:var(--cream-2)}
.acc-fill{position:absolute;top:0;left:0;height:100%;min-width:3px;background:linear-gradient(90deg,var(--burgundy),var(--burgundy-deep))}
.acc-int{font-family:var(--mono);font-size:10px;color:var(--warm-grey);text-align:right}
@media(max-width:600px){.acc{grid-template-columns:92px 1fr 26px}}

/* ---------- Pager (shared: Próximamente board + Casas/Orígenes detail pages) ---------- */
.pager{display:flex;align-items:center;justify-content:center;gap:16px;margin:46px 0 6px}
.pager-btn{display:inline-flex;align-items:center;min-height:44px;padding:10px 16px;
  font-family:var(--mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--burgundy);
  border:1px solid var(--line-2);
  transition:border-color var(--dur-fast,.2s) var(--ease-out,ease),background var(--dur-fast,.2s) var(--ease-out,ease)}
.pager-btn:hover{border-color:var(--burgundy);background:var(--cream)}
.pager-btn.is-off{color:var(--warm-grey);border-color:var(--line);opacity:.55;pointer-events:none}
.pager-now{font-family:var(--mono);font-size:12px;letter-spacing:.06em;color:var(--warm-grey)}
@media(prefers-reduced-motion:reduce){.pager-btn{transition:none}}

/* ============================================================================
   Justified long-form prose (owner typography ruling 2026-07-13). ONE utility
   for running paragraph copy: the home burgundy-band paragraph, PDP historia/
   descripción/notas prose, nosotros + autenticidad section paragraphs, the
   footer blurb. NEVER on nav, buttons, cards, labels, mono chips, headings/
   eyebrows, short lists, prices or form help. hyphens:auto keys off each
   page's lang="es|en", so justification never opens gaps it can't hyphenate
   shut. Consolidates the former per-page justify sprinkle (pdp.css, home.css,
   about.css, trust.css) into this single class.

   NARROW-VIEWPORT RIVER GUARD (empirical, 375px es PDP description on the
   verification pass): justified inter-word spaces averaged 7.9px vs 3.9px
   natural (worst 14.9px, 3.8x) — visible rivers. Below 600px prose stays
   left-aligned (the default); justify applies from 600px up, where the
   measure is wide enough to absorb the slack. hyphens stay on at ALL widths
   so the narrow left rag still breaks long es/en words cleanly.
   ============================================================================ */
.prose-just{-webkit-hyphens:auto;hyphens:auto}
@media(min-width:600px){
  .prose-just{text-align:justify}
}
