/* Sistema visual de la tienda (3d-print-studio · docs/BRAND-AND-DESIGN-SYSTEM.md), en CSS plano.
   Mismos tokens, tipografías, radios, sombras y gradientes. No agregar colores nuevos acá:
   cualquier token nuevo se define primero en la tienda. */

:root {
  --radius: 1.25rem;
  --background: oklch(0.985 0.014 88);
  --foreground: oklch(0.23 0.03 40);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.23 0.03 40);
  --popover: oklch(1 0 0);
  --primary: oklch(0.67 0.19 35);
  --primary-foreground: oklch(0.99 0.01 90);
  --secondary: oklch(0.95 0.03 80);
  --secondary-foreground: oklch(0.3 0.05 45);
  --muted: oklch(0.955 0.015 85);
  --muted-foreground: oklch(0.52 0.03 55);
  --accent: oklch(0.73 0.13 195);
  --accent-foreground: oklch(0.2 0.04 210);
  --sun: oklch(0.86 0.15 88);
  --sun-foreground: oklch(0.28 0.06 60);
  --destructive: oklch(0.58 0.22 27);
  --destructive-foreground: oklch(0.99 0.01 90);
  --border: oklch(0.9 0.02 75);
  --input: oklch(0.9 0.02 75);
  --ring: oklch(0.67 0.19 35);
  --chart-5: oklch(0.7 0.16 145);

  --gradient-sunny: linear-gradient(135deg, oklch(0.86 0.15 88), oklch(0.67 0.19 35) 55%, oklch(0.62 0.16 350));
  --gradient-mint: linear-gradient(120deg, oklch(0.93 0.06 195), oklch(0.97 0.03 88));
  --shadow-pop: 0 18px 40px -18px oklch(0.67 0.19 35 / 0.45);
  --shadow-soft: 0 10px 30px -20px oklch(0.35 0.05 50 / 0.55);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;

  --r-sm: calc(var(--radius) - 8px);   /* 12px */
  --r-md: calc(var(--radius) - 4px);   /* 16px  inputs */
  --r-lg: var(--radius);               /* 20px */
  --r-2xl: calc(var(--radius) + 12px); /* 32px  cajas internas */
  --r-3xl: calc(var(--radius) + 20px); /* 40px  cards */
  color-scheme: light;
}

* { box-sizing: border-box; border-color: var(--border); }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--background); color: var(--foreground); font: 400 1rem/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-underline-offset: 4px; }
:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--ring); }
img { max-width: 100%; }

/* contenedor y secciones */
.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.font-display { font-family: var(--font-display); }
.muted { color: var(--muted-foreground); }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-xs { font-size: .75rem; line-height: 1rem; }
.num { font-variant-numeric: tabular-nums; }
.bg-gradient-mint { background-image: var(--gradient-mint); }
.bg-gradient-sunny { background-image: var(--gradient-sunny); }
.text-gradient-sunny { background-image: var(--gradient-sunny); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-pop { box-shadow: var(--shadow-pop); }

/* iconos (lucide, 16px; 14px en controles compactos) */
.ico { width: 1rem; height: 1rem; flex: none; }
.ico.sm { width: .875rem; height: .875rem; }

/* botones (buttonVariants) — en la app siempre píldora */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; white-space: nowrap; border-radius: 9999px; font-size: .875rem; font-weight: 500;
  height: 2.25rem; padding: .5rem 1rem; border: 0; cursor: pointer; transition: background-color .15s, color .15s, opacity .15s; background: var(--primary); color: var(--primary-foreground); text-decoration: none; }
.btn:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn:disabled { opacity: .5; pointer-events: none; cursor: not-allowed; }
.btn.secondary { background: var(--secondary); color: var(--secondary-foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.btn.secondary:hover { background: color-mix(in oklch, var(--secondary) 80%, transparent); }
.btn.outline { background: var(--background); color: var(--foreground); border: 1px solid var(--input); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.btn.outline:hover, .btn.ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn.ghost { background: transparent; color: inherit; }
.btn.destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn.destructive:hover { background: color-mix(in oklch, var(--destructive) 90%, transparent); }
.btn.ghost.danger { color: var(--destructive); }
.btn.sm { height: 2rem; padding: 0 .75rem; font-size: .75rem; }
.btn.lg { height: 2.5rem; padding: 0 2rem; }
.btn.block { width: 100%; }
.btn.icon { width: 2.25rem; padding: 0; }
.btn.icon.sm { width: 2rem; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 500; cursor: pointer; text-underline-offset: 4px; }
.link:hover { text-decoration: underline; }

/* badges */
.badge { display: inline-flex; align-items: center; border-radius: 9999px; padding: .125rem .625rem; font-size: .75rem; font-weight: 600; line-height: 1rem; background: var(--primary); color: var(--primary-foreground); white-space: nowrap; }
.badge.secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge.outline { background: transparent; color: var(--foreground); border: 1px solid var(--border); }
.badge.accent { background: var(--accent); color: var(--accent-foreground); }
.badge.sun { background: var(--sun); color: var(--sun-foreground); }
.badge.destructive { background: var(--destructive); color: var(--destructive-foreground); }

/* superficies */
.card { background: var(--card); color: var(--card-foreground); border-radius: var(--r-3xl); box-shadow: var(--shadow-soft); }
.box { background: var(--muted); border-radius: var(--r-2xl); }
.empty { background: var(--card); border-radius: var(--r-3xl); box-shadow: var(--shadow-soft); padding: 2rem; text-align: center; color: var(--muted-foreground); }

/* formularios */
.field { display: grid; gap: .5rem; }
.fields { display: grid; gap: 1rem; }
.label { font-size: .875rem; font-weight: 500; line-height: 1; }
.hint { color: var(--muted-foreground); font-size: .75rem; font-weight: 400; line-height: 1rem; }
.input, .textarea, .select { width: 100%; height: 2.25rem; border-radius: var(--r-md); border: 1px solid var(--input); background: transparent; padding: .25rem .75rem; font-size: 1rem; box-shadow: 0 1px 2px rgb(0 0 0 / .05); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 60px; height: auto; padding: .5rem .75rem; }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--ring); }
.input:disabled { opacity: .5; cursor: not-allowed; }
@media (min-width: 768px) { .input, .textarea, .select { font-size: .875rem; } }
.check { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; cursor: pointer; }
.check input:not(.switch) { width: 1rem; height: 1rem; accent-color: var(--primary); }
/* switch */
.switch { appearance: none; width: 2.25rem; height: 1.25rem; border-radius: 9999px; background: var(--input); position: relative; cursor: pointer; transition: background-color .15s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 50%; background: var(--background); box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .15s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(1rem); }

/* chips de opción y swatches */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; border-radius: 9999px; border: 1px solid var(--border); background: transparent; padding: .375rem .75rem; font-size: .875rem; cursor: pointer; transition: border-color .15s, background-color .15s; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 10%, transparent); }
.swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 9999px; border: 1px solid var(--border); vertical-align: -2px; }
.swatch.lg { width: 1.75rem; height: 1.75rem; }

/* pestañas píldora (TabsList / TabsTrigger) */
.tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border-radius: 9999px; background: var(--muted); color: var(--muted-foreground); }
.tabs button { border: 0; background: transparent; border-radius: 9999px; padding: .25rem .75rem; font-size: .875rem; font-weight: 500; cursor: pointer; color: inherit; display: inline-flex; gap: .375rem; align-items: center; transition: background-color .15s, color .15s; }
.tabs button[aria-selected="true"] { background: var(--background); color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }

/* diálogo */
dialog { border: 0; padding: 0; background: var(--popover); color: var(--foreground); border-radius: var(--r-3xl); width: min(28rem, calc(100vw - 2rem)); max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25); }
dialog.lg { width: min(32rem, calc(100vw - 2rem)); }
dialog.xl { width: min(64rem, calc(100vw - 2rem)); }
dialog::backdrop { background: rgb(0 0 0 / .8); }
dialog[open] { animation: zoom .2s ease-out; }
@keyframes zoom { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.dlg-x { position: absolute; top: .75rem; right: .75rem; z-index: 1; }
.dlg { padding: 1.5rem; display: grid; gap: 1rem; }
.dlg-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.dlg-acts { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }

/* toasts (sonner richColors, arriba al centro) */
.toaster { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: .5rem; width: min(22rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; border-radius: .5rem; padding: 1rem; font-size: .8125rem; font-weight: 500; background: var(--popover); color: var(--foreground); border: 1px solid var(--border); box-shadow: 0 4px 12px rgb(0 0 0 / .1); display: flex; gap: .5rem; align-items: center; animation: toastIn .3s ease; }
.toast.ok { background: oklch(0.97 0.05 150); color: oklch(0.45 0.13 150); border-color: oklch(0.9 0.08 150); }
.toast.err { background: oklch(0.97 0.03 25); color: oklch(0.5 0.2 27); border-color: oklch(0.9 0.06 25); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* tablas */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted-foreground); padding: .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
