/* ==========================================================================
   Kordero — hoja única (sitio, editor 3D y panel)

   Reglas:
   - Ninguna regla consulta el tema: el oscuro sólo redefine tokens.
   - --bg es el suelo (lo más lejano); --surface lo que flota encima.
   - Un solo color de acción: --accent (naranja señal). También marca la capa
     seleccionada en el 3D (garment3d.js usa #ff5a1f), así que no se usa
     como decoración.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/archivo-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo Fallback";
  src: local("Segoe UI"), local("Roboto"), local("Helvetica Neue"), local("Arial");
  size-adjust: 101%;
  ascent-override: 92%;
  descent-override: 24%;
}

:root {
  --bg: #f3f1ec;
  --bg-2: #ebe8e1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #17150f;
  --ink-2: #3d3a33;
  --muted: #6d685e;
  --line: rgba(23, 21, 15, 0.11);
  --line-2: rgba(23, 21, 15, 0.2);
  --accent: #ff5a1f;
  --accent-hover: #e84c14;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 90, 31, 0.12);
  --success: #1f8a4c;
  --success-soft: rgba(31, 138, 76, 0.12);
  --warning: #a86200;
  --warning-soft: rgba(214, 140, 0, 0.14);
  --danger: #c4312b;
  --danger-soft: rgba(196, 49, 43, 0.1);
  --whatsapp: #1f9e55;
  --stage: #efece6;
  --shadow-1: 0 1px 2px rgba(23, 21, 15, 0.06), 0 2px 8px rgba(23, 21, 15, 0.05);
  --shadow-2: 0 2px 6px rgba(23, 21, 15, 0.06), 0 12px 32px rgba(23, 21, 15, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --topbar: 64px;
  --font: "Archivo", "Archivo Fallback", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --bg-2: #1a1917;
    --surface: #1f1d1b;
    --surface-2: #252320;
    --ink: #f3f0ea;
    --ink-2: #d9d4ca;
    --muted: #a39d92;
    --line: rgba(243, 240, 234, 0.1);
    --line-2: rgba(243, 240, 234, 0.2);
    --accent: #ff6a33;
    --accent-hover: #ff7d4d;
    --accent-ink: #1a0c05;
    --accent-soft: rgba(255, 106, 51, 0.16);
    --success: #4cc27f;
    --success-soft: rgba(76, 194, 127, 0.14);
    --warning: #e8a53a;
    --warning-soft: rgba(232, 165, 58, 0.14);
    --danger: #f06a62;
    --danger-soft: rgba(240, 106, 98, 0.14);
    --stage: #1a1917;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
/* El atributo hidden gana siempre: si no, un display: grid de un componente lo anula. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 800; }
p { margin: 0; }
small { font-size: 0.85em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.icon--xl { width: 48px; height: 48px; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.center { text-align: center; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); margin-right: 6px; vertical-align: -1px; }
.fine { font-size: 13px; color: var(--muted); }
.stack > * + * { margin-top: 14px; }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--ink-2); font-size: 14px; }
.link--danger { color: var(--danger); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* --- Botones ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease), opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--surface); border-color: var(--ink-2); }
.btn--whatsapp { background: var(--whatsapp); color: #fff; }
.btn--danger-ghost { background: transparent; border-color: var(--danger-soft); color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }
.btn--lg { min-height: 52px; padding: 12px 26px; font-size: 16px; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn--block { display: flex; width: 100%; }

/* --- Pastillas y avisos --------------------------------------------------- */

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; text-decoration: none; letter-spacing: 0; vertical-align: middle; }
.pill--warning { background: var(--warning-soft); color: var(--warning); }
.pill--accent { background: var(--accent-soft); color: var(--accent); }
.pill--success { background: var(--success-soft); color: var(--success); }
.pill--neutral { background: var(--bg-2); color: var(--muted); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; margin: 0 0 14px; }
.notice .icon { margin-top: 2px; }
.notice--error { background: var(--danger-soft); color: var(--danger); }
.notice--success { background: var(--success-soft); color: var(--success); }
.notice--warning { background: var(--warning-soft); color: var(--warning); }
.flash-wrap { max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter) 0; }
.flash-wrap:empty { display: none; }

/* --- Formularios ---------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field__label small { font-weight: 400; color: var(--muted); }
.field__help { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="color"] { width: 46px; height: 46px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.grid-2 { display: grid; gap: 14px; }
.grid-3 { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check--switch { min-height: 46px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }

/* --- Barra superior ------------------------------------------------------- */

.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red, blue)) { .topbar { background: var(--bg); } }
.topbar__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: var(--topbar); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; font-size: 17px; }
.brand__mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); position: relative; }
.brand__mark::after { content: ""; position: absolute; inset: 6px 5px 5px; background: var(--accent); clip-path: polygon(20% 0, 80% 0, 100% 30%, 80% 45%, 80% 100%, 20% 100%, 20% 45%, 0 30%); }
.brand__tag { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 14px; }
.topbar__nav { display: none; gap: 22px; margin-left: 8px; }
.topbar__nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.topbar__nav a:hover { color: var(--ink); }
@media (min-width: 760px) { .topbar__nav { display: flex; } }
.cart-link { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.cart-link:hover { background: var(--surface); }
.cart-link__count { min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; display: grid; place-items: center; padding: 0 6px; }

/* --- Hero ------------------------------------------------------------------ */

.hero { padding: clamp(24px, 5vw, 56px) 0 clamp(40px, 7vw, 88px); overflow: hidden; }
.hero__inner { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; } }
.hero__title { font-size: clamp(40px, 7.4vw, 78px); font-weight: 900; letter-spacing: -0.04em; line-height: 0.98; margin: 14px 0 20px; }
.hero__accent { color: var(--accent); }
.hero__lede { font-size: clamp(17px, 2vw, 19px); color: var(--ink-2); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__facts { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14.5px; font-weight: 600; }
.hero__facts li { display: inline-flex; align-items: center; gap: 7px; }
.hero__stage { position: relative; }
.hero__controls { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4px; }
.hero__hint { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }

.stage { position: relative; background: var(--stage); border-radius: var(--radius-lg); overflow: hidden; touch-action: none; }
.stage canvas { width: 100% !important; height: 100% !important; cursor: grab; }
.stage canvas.is-grabbing { cursor: grabbing; }
.stage--hero { aspect-ratio: 1 / 1.02; max-height: 70vh; margin: 0 auto; width: 100%; }
.stage__loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-size: 14px; pointer-events: none; transition: opacity 0.35s var(--ease); z-index: 2; }
.stage__loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.stage__loading.is-hidden { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage__drop { position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); display: grid; place-content: center; justify-items: center; gap: 8px; font-weight: 700; color: var(--accent); z-index: 3; pointer-events: none; }
.stage__drop .icon { width: 36px; height: 36px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--bg-2); border-radius: 999px; max-width: 100%; overflow-x: auto; }
.seg__btn { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--muted); transition: background-color 0.2s, color 0.2s; }
.seg__btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.swatch-btn, .swatch span:not(.sr-only) { width: 30px; height: 30px; }
.swatch-btn { border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2); transition: transform 0.15s var(--ease), box-shadow 0.15s; }
.swatch-btn.is-active { box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.swatch-btn:hover { transform: scale(1.08); }

/* --- Secciones ------------------------------------------------------------ */

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding-top: 0; }
.section--ink { background: var(--ink); color: var(--bg); }
.section__head { margin-bottom: clamp(24px, 4vw, 44px); max-width: 40em; }
.section__title { font-size: clamp(30px, 4.6vw, 48px); font-weight: 900; letter-spacing: -0.035em; }
.section__lede { margin-top: 10px; color: var(--muted); font-size: 18px; }
.section--ink .section__lede { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.products { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.product { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); text-decoration: none; overflow: hidden; box-shadow: var(--shadow-1); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.product__media { background: var(--stage); aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 18px; }
.product__media img { width: 86%; height: auto; transition: transform 0.5s var(--ease); }
.product:hover .product__media img { transform: scale(1.035) rotate(-1deg); }
.product__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product__name { font-size: 21px; font-weight: 800; }
.product__desc { color: var(--ink-2); font-size: 15px; }
.product__fabric { color: var(--muted); font-size: 13.5px; }
.product__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.product__price { font-weight: 800; font-size: 20px; }
.product__price span { font-weight: 500; font-size: 13px; color: var(--muted); }
.product__dots { display: inline-flex; align-items: center; gap: 4px; }
.product__dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.product__dots em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 2px; }
.product__cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent); margin-top: 10px; }
.product__cta .icon { transition: transform 0.25s var(--ease); }
.product:hover .product__cta .icon { transform: translateX(4px); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: s; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.step { display: flex; gap: 18px; align-items: flex-start; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); }
.step__n { font-size: 44px; font-weight: 900; line-height: 1; color: var(--accent); letter-spacing: -0.04em; }
.step h3 { font-size: 21px; margin-bottom: 6px; }
.step p { color: color-mix(in srgb, var(--bg) 72%, transparent); font-size: 15.5px; }

.pricing > *, .faq > * { max-width: 820px; }
.price-table { margin: 0; border-top: 1px solid var(--line-2); }
.price-table > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.price-table dt { font-weight: 800; font-size: 19px; }
.price-table dt small { display: block; font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 2px; }
.price-table dd { margin: 0; font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.pricing__example { margin-top: 20px; color: var(--ink-2); }

.faq .section__title { margin-bottom: 18px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 36px 18px 0; font-weight: 700; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 24px; font-weight: 400; color: var(--muted); transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 44em; }

.footer { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.footer__brand { font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.footer__tag { color: var(--muted); font-size: 14px; max-width: 30em; }
.footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer__links a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }

/* --- Páginas genéricas ---------------------------------------------------- */

.page { padding-top: clamp(20px, 4vw, 40px); padding-bottom: 72px; }
.page--narrow { max-width: 780px; }
.page__head { margin-bottom: 24px; }
.page__title { font-size: clamp(30px, 5vw, 44px); font-weight: 900; letter-spacing: -0.035em; }
.page__sub { color: var(--muted); margin-top: 6px; }
.page__back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.page__back:hover { color: var(--ink); }
.card { background: var(--surface); border-radius: var(--radius); padding: clamp(18px, 3vw, 24px); box-shadow: var(--shadow-1); }
.card__title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.card + .card { margin-top: 14px; }
.empty-state { text-align: center; padding: 64px 0; display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 24px; }
.error-page { text-align: center; display: grid; gap: 12px; justify-items: center; padding-top: 80px; }
.error-page__code { font-size: 15px; font-weight: 800; color: var(--accent); letter-spacing: 0.1em; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 12px; max-width: 42em; }
.prose h1 { margin-bottom: 20px; }

/* --- Carrito ---------------------------------------------------------------- */

.cart { display: grid; gap: 22px; align-items: start; }
@media (min-width: 940px) { .cart { grid-template-columns: minmax(0, 1fr) 340px; } }
.cart__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.line { display: grid; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); }
@media (min-width: 640px) { .line { grid-template-columns: 220px 1fr; } }
.line__media { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.line__media img { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--stage); }
.line__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.line__top { display: flex; justify-content: space-between; gap: 12px; }
.line__name { font-size: 19px; font-weight: 800; }
.line__meta { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.line__total { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line__sizes { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.mini-size { display: grid; gap: 4px; justify-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mini-size input { width: 58px; min-height: 40px; padding: 6px; text-align: center; }
.line__unit { font-size: 14px; color: var(--muted); }
.line__actions { display: flex; gap: 18px; align-items: center; margin-top: auto; }
.totals { margin: 0 0 16px; display: grid; gap: 8px; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.totals__note dd { color: var(--muted); font-weight: 400; font-size: 14px; }
.totals__grand { padding-top: 10px; border-top: 1px solid var(--line); }
.totals__grand dt, .totals__grand dd { color: var(--ink); font-weight: 800; font-size: 19px; }
.cart__aside .btn + .btn { margin-top: 10px; }

/* --- Pedido ----------------------------------------------------------------- */

.checkout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 940px) { .checkout { grid-template-columns: minmax(0, 1fr) 380px; } }
.fieldset { border: 0; margin: 0; display: grid; gap: 14px; }
.fieldset legend { font-weight: 800; font-size: 18px; padding: 0; margin-bottom: 4px; float: left; width: 100%; }
.fieldset legend small { font-weight: 400; color: var(--muted); font-size: 14px; }
.fieldset + .fieldset { margin-top: 14px; }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.option__body { display: grid; gap: 2px; }
.option__body small { color: var(--muted); font-size: 13.5px; }
.sticky { position: sticky; top: calc(var(--topbar) + 16px); }
.mini-lines { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.mini-lines li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.mini-lines img { width: 48px; height: auto; border-radius: 8px; background: var(--stage); }
.mini-lines small { display: block; color: var(--muted); font-size: 12.5px; }
.mini-lines span { font-weight: 700; font-variant-numeric: tabular-nums; }
.checkout .fine { margin-top: 12px; }

.order-head { margin: 8px 0 22px; }
.order-head__folio { font-size: clamp(34px, 6vw, 52px); font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.order-head__status { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-top: 8px; font-size: 14px; }
.progress { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.progress li { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.progress li::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line-2); margin-bottom: 8px; }
.progress li.is-done::before { background: var(--success); }
.progress li.is-current::before { background: var(--accent); }
.progress li.is-current { color: var(--ink); }
.pay { margin-bottom: 18px; }
.pay__data { margin: 0 0 18px; display: grid; gap: 10px; }
.pay__data > div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.pay__data dt { color: var(--muted); font-size: 14px; }
.pay__data dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.proof { display: grid; gap: 10px; margin-bottom: 10px; }
.proof__drop { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-2); font-weight: 600; }
.proof__drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.proof__drop:hover { border-color: var(--accent); }
.order-items { display: grid; gap: 14px; margin: 18px 0; }
.order-item { display: grid; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-1); }
@media (min-width: 640px) { .order-item { grid-template-columns: 240px 1fr; } }
.order-item__media { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.order-item__media img { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--stage); }
.order-item__body { display: grid; gap: 6px; align-content: start; color: var(--ink-2); font-size: 15px; }
.order-item__body h2 { font-size: 19px; color: var(--ink); }
.order-item__price { margin-top: 6px; }

/* --- Editor 3D ------------------------------------------------------------- */

.is-editor { height: 100dvh; min-height: 0; overflow: hidden; }
.is-editor main { min-height: 0; display: flex; flex-direction: column; }
.editor { flex: 1; min-height: 0; }
.editor__form { height: 100%; display: flex; flex-direction: column; }
.editor__viewport { position: relative; flex: none; height: 52dvh; padding: 10px var(--gutter) 0; }
.stage--editor { height: 100%; border-radius: var(--radius-lg); }
.editor__panel { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px var(--gutter) 0; -webkit-overflow-scrolling: touch; }
.editor__hint { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2 * var(--gutter) - 24px); text-align: center; font-size: 12.5px; color: var(--muted); background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 6px 12px; border-radius: 999px; pointer-events: none; box-shadow: var(--shadow-1); }
.editor__hint strong { color: var(--ink); }

@media (min-width: 900px) {
  .editor__form { flex-direction: row; }
  .editor__viewport { flex: 1; height: auto; padding: 16px 0 16px 16px; }
  .editor__panel { flex: none; width: 400px; border-left: 1px solid var(--line); padding: 20px 24px 0; background: var(--surface-2); }
  .editor__hint { top: 30px; font-size: 13.5px; }
}

.viewbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-2); max-width: calc(100% - 2 * var(--gutter) - 16px); overflow-x: auto; }
@media (min-width: 900px) { .viewbar { bottom: 30px; left: calc(50% + 8px); } }
.viewbar__btn { border: 0; background: transparent; min-height: 36px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.viewbar__btn.is-active { background: var(--ink); color: var(--bg); }
.viewbar__btn--icon { padding: 6px 9px; }
.viewbar__btn:hover:not(.is-active) { color: var(--ink); }
.viewbar__sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; flex: none; }

.panel-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-head__back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); flex: none; }
.panel-head__title { font-size: 22px; font-weight: 900; letter-spacing: -0.025em; }
.panel-head__sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter) 2px; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips--scroll { margin: 0 -24px 16px; padding: 0 24px 2px; } }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 13.5px; text-decoration: none; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.panel-block { padding: 16px 0; border-top: 1px solid var(--line); }
.panel-block__title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.panel-block__value { font-weight: 600; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.panel-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.swatches--lg { justify-content: flex-start; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch::before { content: ""; display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.15s, transform 0.15s var(--ease); }
.swatch:has(input:checked)::before { box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 3px var(--surface-2), 0 0 0 5px var(--ink); }
.swatch:has(input:focus-visible)::before { outline: 2px solid var(--accent); outline-offset: 5px; }
.swatch:hover::before { transform: scale(1.06); }

.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px; border-radius: var(--radius-sm); border: 1.5px dashed var(--line-2); background: var(--surface); font-weight: 700; font-size: 14.5px; cursor: pointer; transition: border-color 0.15s, color 0.15s, background-color 0.15s; }
.add-btn:hover { border-color: var(--accent); color: var(--accent); }
.add-btn .icon { width: 20px; height: 20px; }

.layers { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.layers:empty { display: none; }
.layers__empty { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.layer { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); padding: 4px; transition: border-color 0.15s, box-shadow 0.15s; }
.layer.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.layer__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 2px; cursor: pointer; text-align: left; }
.layer__thumb { width: 44px; height: 44px; border-radius: 8px; background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; display: grid; place-items: center; flex: none; overflow: hidden; }
.layer__thumb img { width: 100%; height: 100%; object-fit: contain; }
.layer__text { min-width: 0; display: grid; }
.layer__name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer__zone { font-size: 12.5px; color: var(--muted); }
.layer__order { display: grid; }
.layer__order button, .layer__del { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 8px; font-size: 10px; line-height: 1.4; border-radius: 6px; }
.layer__del { padding: 8px; }
.layer__order button:hover, .layer__del:hover { color: var(--ink); background: var(--bg-2); }

.layer-edit { display: grid; gap: 14px; }
.layer-edit .panel-block__title { margin-bottom: 0; }
.text-edit { display: grid; gap: 10px; }
.text-edit__row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.range { display: grid; gap: 6px; }
.range__label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.range__label output { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.tool-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tool { display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; font-weight: 700; cursor: pointer; color: var(--ink-2); line-height: 1.15; text-align: center; }
.tool:hover { border-color: var(--ink-2); color: var(--ink); }
.tool .icon { width: 19px; height: 19px; }
.tool--danger:hover { border-color: var(--danger); color: var(--danger); }
.quality { font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; }
.quality--ok { background: var(--success-soft); color: var(--success); }
.quality--warn { background: var(--warning-soft); color: var(--warning); }
.quality--bad { background: var(--danger-soft); color: var(--danger); }
.presets summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.presets .chips { margin-top: 10px; }

.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.size { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.size__name { font-weight: 800; font-size: 14px; }
.stepper { display: flex; align-items: center; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg-2); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--line-2); }
.stepper .icon { width: 16px; height: 16px; }
.stepper input { width: 40px; min-height: 34px; padding: 0; border: 0; background: transparent; text-align: center; font-weight: 800; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }

.summary { position: sticky; bottom: 0; margin: 8px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: var(--surface-2); border-top: 1px solid var(--line); }
@media (min-width: 900px) { .summary { margin: 8px -24px 0; padding: 14px 24px 18px; } }
.summary__lines { margin: 0 0 10px; display: grid; gap: 3px; font-size: 13.5px; }
.summary__lines > div { display: flex; justify-content: space-between; gap: 12px; }
.summary__lines dt { color: var(--muted); }
.summary__lines dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.summary__error { font-size: 13.5px; color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.summary__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary__total { display: grid; }
.summary__total span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.summary__total strong { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.summary .btn { flex: 1; max-width: 240px; }

/* --- Entrar / instalar ------------------------------------------------------ */

.is-centered { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.centered-main { width: 100%; max-width: 400px; }
.login { background: var(--surface); border-radius: var(--radius-lg); padding: 32px 28px; box-shadow: var(--shadow-2); }
.login__brand { font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-size: 14px; }
.login__title { font-size: 28px; font-weight: 900; margin: 4px 0 22px; }
.login__back { text-align: center; margin-top: 18px; font-size: 14px; }
.login__back a { color: var(--muted); }

/* --- Panel ---------------------------------------------------------------- */

.is-admin { background: var(--bg); }
.adminbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.adminbar__inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); height: 60px; display: flex; align-items: center; gap: 18px; }
.adminbar__nav { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; }
.adminbar__nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.adminbar__nav a.is-active { background: var(--bg-2); color: var(--ink); }
.adminbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.adminbar__site { display: none; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
@media (min-width: 720px) { .adminbar__site { display: inline-flex; } }
@media (max-width: 560px) { .adminbar__nav a span, .adminbar .brand__tag, .adminbar .brand__name { display: none; } }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 22px var(--gutter) 64px; width: 100%; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.admin-head h1 { font-size: 28px; font-weight: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-head .page__back { width: 100%; margin: 0; }
.admin-head > .btn { margin-left: auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.tabs__tab { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.tabs__tab span { font-weight: 600; opacity: 0.7; margin-left: 2px; }
.tabs__tab.is-active { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); }
.order-list, .product-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-row, .product-admin__row { display: flex; align-items: center; gap: 14px; background: var(--surface); padding: 10px 14px 10px 10px; border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow-1); transition: box-shadow 0.2s; }
.order-row:hover, .product-admin__row:hover { box-shadow: var(--shadow-2); }
.order-row__img { width: 52px; height: 62px; border-radius: 8px; background: var(--stage); flex: none; overflow: hidden; }
.order-row__img img { width: 100%; height: 100%; object-fit: cover; }
.order-row__main { flex: 1; min-width: 0; }
.order-row__main small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row__side { display: grid; justify-items: end; gap: 3px; font-variant-numeric: tabular-nums; }
.order-row__side small { color: var(--muted); font-size: 12.5px; }
.product-admin__row img { width: 48px; height: auto; border-radius: 8px; background: var(--stage); }
.product-admin__row.is-off { opacity: 0.6; }
.product-admin__main { flex: 1; min-width: 0; }
.product-admin__main small { display: block; color: var(--muted); font-size: 13px; }
.product-admin__price { font-weight: 800; font-variant-numeric: tabular-nums; }

.admin-grid { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1000px) { .admin-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.admin-col { display: grid; gap: 14px; min-width: 0; }
.admin-col .card + .card { margin-top: 0; }
.design-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.design-card__head h2 { font-size: 19px; }
.design-card__head h2 small { font-weight: 500; color: var(--muted); font-size: 14px; }
.design-card__head p { color: var(--ink-2); font-size: 14px; }
.design-card__media { display: flex; gap: 8px; overflow-x: auto; }
.design-card__media img { width: 200px; height: auto; border-radius: var(--radius-sm); background: var(--stage); }
.design-card__sizes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.size-tag { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 8px; background: var(--bg-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.size-tag b { font-weight: 900; }
.design-card__price { margin-left: auto; font-size: 14px; color: var(--ink-2); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td small { color: var(--muted); }
.table--layers { display: block; overflow-x: auto; }
.layer-thumb { display: inline-block; vertical-align: middle; margin-right: 6px; width: 44px; height: 44px; border-radius: 6px; background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--surface) 0 50%) 0 0 / 10px 10px; overflow: hidden; }
.layer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.actions { display: grid; gap: 8px; }
.actions form .btn { width: 100%; }
.kv { margin: 0; display: grid; gap: 8px; font-size: 14.5px; }
.kv > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { margin-top: 18px; }
.admin-form { max-width: 760px; display: grid; gap: 14px; }
.admin-form .card + .card { margin-top: 0; }
.form-actions { display: flex; gap: 10px; }
.color-rows { display: grid; gap: 8px; }
.color-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; }

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