/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio.
   Put this @layer first; product CSS outside the layer always wins. */
@layer od-layout {
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  /* containers */
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  /* stacked information: each piece is its own line — never sibling inline spans */
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  /* media keeps its intrinsic ratio by default; never a distorted or cropped
     cover by accident. height:auto lets the ratio win over an <img height="…">
     attribute. Cropping to a uniform box is an explicit opt-in: set --od-ratio
     AND add .od-media-cover together (per the core rule, only where a crop is
     deliberate — tile thumbs, decorative fills — never on full-frame content). */
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  /* data text only — authored copy is rewritten to its budget instead */
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }   /* block-level reservation for a shared baseline */
  .od-nowrap  { white-space: nowrap; }           /* 数字+单位 · 价格+起 · 日期+星期 */
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; } /* CJK labels break at spaces / <wbr> first */

  /* screen skeleton (optional): bars take their own space, the middle scrolls — no padding guessed for chrome */
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  /* horizontal rail: the next item peeks at the edge; trailing room survives overflow */
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
/* /OD-LAYOUT-PRIMITIVES v1 */

/* =========================================================
   RIKEIZE SELECT — DESIGN TOKENS (fonte única de valores)
   ========================================================= */
:root {
  /* cor */
  --rs-black: #0B0A08;
  --rs-ink: #16130F;
  --rs-ink-2: #221D17;
  --rs-gold: #C49A4A;          /* detalhes e botões sobre preto / fundo de botão */
  --rs-gold-hover: #D4AC5C;
  --rs-gold-soft: #EADBBE;
  --rs-gold-text: #8A6420;     /* dourado para texto sobre fundos claros (≥4,5:1) */
  --rs-bg: #F8F5F0;
  --rs-bg-2: #F1EBE2;
  --rs-surface: #FFFFFF;
  --rs-text: #1A1714;
  --rs-muted: #5E5A54;
  --rs-on-dark: #F4EFE7;
  --rs-on-dark-muted: #B9B1A5;
  --rs-line: #E6E0D6;
  --rs-line-strong: #CFC6B8;
  --rs-danger: #B3261E;
  --rs-danger-bg: #FBEDEC;
  --rs-success: #2E7D4F;
  --rs-success-bg: #EAF5EE;
  --rs-warn: #8A5A00;
  --rs-warn-bg: #FFF5E0;
  --rs-info-bg: #F3EEE5;

  /* tipografia */
  --rs-serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --rs-sans: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: clamp(26px, 2.6vw, 32px);
  --fs-3xl: clamp(30px, 3.4vw, 42px);
  --fs-4xl: clamp(36px, 5vw, 60px);
  --fs-hero: clamp(64px, 9vw, 120px);
  --lh: 1.6;
  --track-caps: 0.14em;

  /* espaço (múltiplos de 4/8) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* forma */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-pill: 999px;
  --border: 1px solid var(--rs-line);
  --shadow-pop: 0 12px 40px rgba(11, 10, 8, 0.16);
  --shadow-card: 0 1px 2px rgba(11, 10, 8, 0.05);

  /* movimento */
  --t-fast: 160ms;
  --t-base: 240ms;
  --t-slow: 360ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);

  --container: 1280px;
  --gutter: clamp(16px, 3vw, 32px);
  --header-z: 50;
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--rs-sans); font-size: var(--fs-md); line-height: var(--lh);
  color: var(--rs-text); background: var(--rs-bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.15; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--rs-gold-text); outline-offset: 2px; }
.on-dark :focus-visible, .rs-header :focus-visible, .rs-footer :focus-visible { outline-color: var(--rs-gold); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--rs-gold); color: var(--rs-black); padding: 8px 16px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.serif { font-family: var(--rs-serif); }
.eyebrow { display: block; font-size: var(--fs-xs); letter-spacing: 0.32em; text-transform: uppercase; color: var(--rs-gold-text); font-weight: 500; }
.on-dark .eyebrow { color: var(--rs-gold); }
.muted { color: var(--rs-muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.gold { color: var(--rs-gold-text); }
.on-dark .gold { color: var(--rs-gold); }
.caps { text-transform: uppercase; letter-spacing: var(--track-caps); }
.title-serif { font-family: var(--rs-serif); font-weight: 500; letter-spacing: 0.01em; }
.section { padding-block: var(--s-8); }
.section-tight { padding-block: var(--s-6); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.section-head h2 { font-family: var(--rs-serif); font-size: var(--fs-3xl); text-transform: uppercase; letter-spacing: 0.04em; }
.section-head .rule { flex: 1 1 120px; height: 1px; background: var(--rs-gold); opacity: .5; max-width: 220px; align-self: center; }
.prose h2, .prose h3 { font-family: var(--rs-serif); margin: var(--s-5) 0 var(--s-2); }
.prose h2 { font-size: var(--fs-2xl); color: var(--rs-gold-text); }
.prose h3 { font-size: var(--fs-xl); }
.prose p, .prose li { color: var(--rs-text); margin-bottom: var(--s-3); max-width: 72ch; }
.prose ul { list-style: disc; padding-left: 20px; }
.prose a { color: var(--rs-gold-text); }

/* =========================================================
   BOTÕES
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5); border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--rs-sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-caps);
  text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--rs-gold); color: var(--rs-black); }
.btn-dark { background: var(--rs-black); color: var(--rs-on-dark); }
.btn-outline { background: transparent; border-color: var(--rs-text); color: var(--rs-text); }
.btn-outline-gold { background: transparent; border-color: var(--rs-gold); color: var(--rs-gold); }
.btn-line { background: var(--rs-surface); border-color: var(--rs-line-strong); color: var(--rs-text); }
.btn-ghost { background: transparent; color: var(--rs-text); padding: 0 var(--s-3); }
.btn-danger { background: var(--rs-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--s-3); }
.btn-lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-sm); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-pill); border: 1px solid var(--rs-line-strong); background: var(--rs-surface); color: var(--rs-text); cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast); }
.icon-btn[aria-pressed="true"] { color: var(--rs-gold-text); border-color: var(--rs-gold); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.icon-btn[disabled] { opacity: .4; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--rs-gold-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
@media (hover: hover) {
  .btn-gold:hover { background: var(--rs-gold-hover); }
  .btn-dark:hover { background: var(--rs-ink-2); }
  .btn-outline:hover { background: var(--rs-text); color: var(--rs-surface); }
  .btn-outline-gold:hover { background: var(--rs-gold); color: var(--rs-black); }
  .btn-line:hover { border-color: var(--rs-gold); color: var(--rs-gold-text); }
  .btn-ghost:hover { color: var(--rs-gold-text); }
  .icon-btn:hover:not([disabled]) { border-color: var(--rs-gold); color: var(--rs-gold-text); }
}

/* =========================================================
   FORMULÁRIOS
   ========================================================= */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--rs-text); }
.field .req { color: var(--rs-danger); }
.field .hint { display: block; font-size: var(--fs-xs); color: var(--rs-muted); line-height: 1.5; }
.field .error { display: block; font-size: var(--fs-xs); color: var(--rs-danger); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--rs-line-strong); border-radius: var(--radius-sm);
  background: var(--rs-surface); color: var(--rs-text); font-size: var(--fs-md); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A1714' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--rs-gold-text); box-shadow: 0 0 0 3px rgba(196, 154, 74, 0.25); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--rs-danger); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--rs-bg-2); color: var(--rs-muted); cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; cursor: pointer; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; accent-color: var(--rs-gold-text); margin: 0; flex: none; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.form-grid > * { grid-column: span 12; }
@media (min-width: 768px) {
  .form-grid .c-6 { grid-column: span 6; } .form-grid .c-4 { grid-column: span 4; } .form-grid .c-3 { grid-column: span 3; }
  .form-grid .c-8 { grid-column: span 8; } .form-grid .c-9 { grid-column: span 9; }
}
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--rs-line-strong); border-radius: var(--radius-sm); background: var(--rs-surface); height: 48px; }
.qty button { width: 44px; border: 0; background: none; font-size: 18px; }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty input { width: 48px; border: 0; text-align: center; font-weight: 600; background: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* =========================================================
   ALERTAS / SELOS / ESTADOS
   ========================================================= */
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.5; border: 1px solid transparent; }
.alert > .icon { margin-top: 1px; }
.alert-info { background: var(--rs-info-bg); border-color: var(--rs-line); color: var(--rs-text); }
.alert-warn { background: var(--rs-warn-bg); border-color: #F0D9A8; color: #5A3B00; }
.alert-error { background: var(--rs-danger-bg); border-color: #F2C4C0; color: #7F1A14; }
.alert-success { background: var(--rs-success-bg); border-color: #BFE0CB; color: #1D5535; }
.alert strong { display: block; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4; white-space: nowrap; }
.badge-gold { background: var(--rs-gold); color: var(--rs-black); }
.badge-dark { background: var(--rs-black); color: var(--rs-on-dark); }
.badge-line { border: 1px solid var(--rs-line-strong); color: var(--rs-muted); background: var(--rs-surface); }
.badge-success { background: var(--rs-success-bg); color: var(--rs-success); }
.badge-warn { background: var(--rs-warn-bg); color: var(--rs-warn); }
.badge-danger { background: var(--rs-danger-bg); color: var(--rs-danger); }
.badge-demo { background: #EDE7F6; color: #4A3A73; }
.stars { display: inline-flex; gap: 2px; color: var(--rs-gold); vertical-align: middle; }
.stars .icon { width: 14px; height: 14px; }
.stars .on { fill: currentColor; }
.empty { display: grid; justify-items: center; gap: var(--s-3); text-align: center; padding: var(--s-8) var(--s-4); }
.empty .icon { width: 40px; height: 40px; color: var(--rs-gold-text); stroke-width: 1.2; }
.empty h2, .empty h3 { font-family: var(--rs-serif); font-size: var(--fs-2xl); }
.empty p { color: var(--rs-muted); max-width: 46ch; }
.skeleton { background: linear-gradient(90deg, var(--rs-bg-2) 0%, #faf7f2 50%, var(--rs-bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   TOAST / MODAL / DRAWER
   ========================================================= */
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--rs-black); color: var(--rs-on-dark); border-left: 3px solid var(--rs-gold); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); animation: toast-in var(--t-base) var(--ease-out); }
.toast.error { border-left-color: #E57373; }
.toast .od-fill a, .toast .od-fill button { color: var(--rs-gold); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(11, 10, 8, .55); display: grid; place-items: center; padding: 16px; animation: fade-in var(--t-base) var(--ease-out); }
.modal { width: min(720px, 100%); max-height: calc(100dvh - 32px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--rs-surface); border-radius: var(--radius); box-shadow: var(--shadow-pop); animation: pop-in var(--t-base) var(--ease-out); }
.modal-sm { width: min(460px, 100%); }
.modal-lg { width: min(960px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 16px 24px; border-bottom: var(--border); }
.modal-head h2 { font-family: var(--rs-serif); font-size: var(--fs-2xl); }
.modal-body { overflow-y: auto; padding: 24px; overscroll-behavior: contain; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: var(--border); flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.drawer-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(11, 10, 8, .55); animation: fade-in var(--t-base) var(--ease-out); }
.drawer { position: fixed; z-index: 141; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); background: var(--rs-black); color: var(--rs-on-dark); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: slide-in var(--t-base) var(--ease-out); }
@keyframes slide-in { from { transform: translateX(-100%); } }

/* =========================================================
   TABELAS
   ========================================================= */
.table-wrap { position: relative; width: 100%; overflow-x: auto; border: var(--border); border-radius: var(--radius-sm); background: var(--rs-surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: var(--border); vertical-align: middle; }
.table th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rs-muted); font-weight: 600; background: #FBF9F6; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr.is-hl { background: #FFFBF2; }

/* =========================================================
   PREÇO
   ========================================================= */
.price { display: grid; gap: 2px; }
.price .was { font-size: var(--fs-xs); color: var(--rs-muted); text-decoration: line-through; }
.price .now { font-size: var(--fs-lg); font-weight: 700; color: var(--rs-text); white-space: nowrap; }
.price .inst { font-size: var(--fs-xs); color: var(--rs-muted); }
.price .pix { font-size: var(--fs-xs); color: var(--rs-text); }
.price .pix b { color: var(--rs-gold-text); font-size: var(--fs-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
