/* ==========================================================================
   3D Space · Sistema de diseño (Apple × Nothing · naranja anodizado)
   Tipografía: Space Grotesk (títulos) · JetBrains Mono (datos técnicos) · system-ui (texto)
   Superficies: body[data-surface="store"] = tienda · body[data-surface="admin"] = panel
   Orden: 1 Tokens · 2 Base · 3 Tipografía · 4 Botones · 5 Formularios · 6 Superficies y tablas · 7 Navegación y pie
          8 Tienda (hero, catálogo, producto, cotizador, carrito, checkout, seguimiento) · 9 Admin · 10 Movimiento
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
    color-scheme: dark;

    /* Superficies */
    --bg-canvas: #09090b;
    --surface-1: #111113;
    --surface-2: #17171a;
    --surface-3: #1f1f23;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-control: #6b6b74;        /* bordes de campos y casillas: 3.4–3.8:1 (WCAG 1.4.11) */
    --border-control-hover: #8a8a93;

    /* Texto (contrastes sobre surface-2: 17:1 · 7:1 · 5.2:1) */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #8a8a93;

    /* Acento: solo acciones comerciales, foco y estados */
    --accent: #ff5500;
    --accent-hover: #ff6a22;
    --accent-pressed: #e64d00;
    --accent-soft: rgba(255, 85, 0, 0.12);
    --on-accent: #0b0b0d;

    --resin: #e2e8f0;
    --success: #6fbf8e;
    --warning: #d9a35b;
    --danger: #e5675a;
    --whatsapp: #8fd3a9;

    /* Espaciado (base 4 px) */
    --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem; --sp-5: 1.5rem;
    --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem; --sp-10: 8rem;
    --section-y: clamp(4rem, 8vw, 7.5rem);

    /* Radios */
    --r-tag: 6px; --r-ctrl: 12px; --r-card: 16px; --r-panel: 24px; --r-pill: 999px;

    /* Elevación: solo dos niveles */
    --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-2: 0 24px 64px -16px rgba(0, 0, 0, 0.85);

    /* Movimiento */
    --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 400ms; --dur-reveal: 560ms;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

    --nav-height: 4rem;

    /* Tipografía */
    --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    /* Alias heredados (otras hojas, plantillas y JS antiguos) */
    --bg-surface: var(--surface-1);
    --bg-elevated: var(--surface-2);
    --bg-glass: rgba(9, 9, 11, 0.72);
    --accent-primary: var(--accent);
    --accent-resin: var(--resin);
    --state-success: var(--success);
    --state-warning: var(--warning);
    --state-danger: var(--danger);
    --border-highlight: var(--border-strong);
    --radius-lg: var(--r-card); --radius-md: var(--r-ctrl); --radius-sm: 8px;
    --shadow-rest: var(--shadow-1); --shadow-lift: var(--shadow-2);
    --surface-sheen: none;
}

/* ---------- Bootstrap: paleta propia sobre el tema oscuro ---------- */
[data-bs-theme=dark] {
    --bs-body-bg: #09090b;
    --bs-body-bg-rgb: 9, 9, 11;
    --bs-body-color: #f5f5f7;
    --bs-body-color-rgb: 245, 245, 247;
    --bs-body-font-family: var(--font-ui);
    --bs-emphasis-color: #f5f5f7;
    --bs-secondary-color: #a1a1aa;
    --bs-secondary-color-rgb: 161, 161, 170;
    --bs-tertiary-color: #8a8a93;
    --bs-secondary-bg: #111113;
    --bs-tertiary-bg: #17171a;
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
    --bs-heading-color: #f5f5f7;
    --bs-link-color: #f5f5f7;
    --bs-link-color-rgb: 245, 245, 247;
    --bs-link-hover-color: #ffffff;
    --bs-link-hover-color-rgb: 255, 255, 255;
    --bs-primary: #ff5500;
    --bs-primary-rgb: 255, 85, 0;
    --bs-info: #e2e8f0;
    --bs-info-rgb: 226, 232, 240;
    --bs-success: #6fbf8e;
    --bs-success-rgb: 111, 191, 142;
    --bs-warning: #d9a35b;
    --bs-warning-rgb: 217, 163, 91;
    --bs-danger: #e5675a;
    --bs-danger-rgb: 229, 103, 90;
    --bs-dark: #111113;
    --bs-dark-rgb: 17, 17, 19;
    --bs-secondary: #3f3f46;
    --bs-secondary-rgb: 63, 63, 70;
    --bs-info-text-emphasis: #e2e8f0;
    --bs-success-text-emphasis: #8fd3a9;
    --bs-warning-text-emphasis: #e8bd82;
    --bs-danger-text-emphasis: #f0948a;
    --bs-focus-ring-color: rgba(255, 85, 0, 0.35);
}

/* ---------- 2. Base ---------- */
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #27272a var(--bg-canvas); }
body {
    min-height: 100vh;
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(255, 85, 0, 0.32); color: var(--text-primary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-canvas); }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 10px; border: 2px solid var(--bg-canvas); }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }
main:focus { outline: none; }
img { max-width: 100%; }

@media (min-width: 1200px) { .container { max-width: 1200px; } }
@media (min-width: 1400px) { .container { max-width: 1200px; } }
[data-surface="admin"] .container { max-width: 1320px; }
[data-surface="store"] main.container { padding-block: clamp(2rem, 5vw, 4rem); }

.skip-link {
    position: fixed; top: .5rem; left: .5rem; z-index: 2000;
    padding: .6rem 1rem; border-radius: var(--r-pill);
    background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
    transform: translateY(-200%); transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); color: var(--on-accent); }

/* ---------- 3. Tipografía ---------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.navbar-brand, .offcanvas-title, .modal-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}
h1, .h1 { font-size: clamp(2rem, 1rem + 4vw, 3.5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
h2, .h2 { font-size: clamp(1.6rem, 1rem + 2.5vw, 2.5rem); }
h3, .h3 { font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); letter-spacing: -0.02em; line-height: 1.2; }
h4, .h4 { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.25; }
h5, .h5 { font-size: 1.0625rem; letter-spacing: -0.015em; line-height: 1.3; }
h6, .h6 { font-size: 1rem; letter-spacing: -0.01em; line-height: 1.35; }
.display-6 { font-size: clamp(1.9rem, 1rem + 3.2vw, 3rem); font-weight: 700; letter-spacing: -0.04em; }
.display-3 { font-weight: 700; }
.fs-3 { font-size: 1.75rem !important; }
.lead { font-weight: 400; font-size: 1.125rem; color: var(--text-secondary); line-height: 1.55; }
.text-body-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.small, small { letter-spacing: 0; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color var(--dur-base) ease; }

/* Datos técnicos: precios, medidas, folios */
.mono, .price-tag, #product-price, #mobile-product-price, #cartTotalAmount, .slicer-value,
#stlDimensions, #stlVolume, #stlEstimatedGrams, #stlQuotedPrice, #checkoutSubtotal, #checkoutShipping, #checkoutTotal,
.tech-metric-head span:last-child, .catalog-count, .cart-count-badge, .tracker-progress .progress-bar, #slicer-title + span {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.text-gradient { color: var(--text-primary); }
.accent-dot { color: var(--accent); }

/* Etiqueta mono con marca neutra (el naranja queda para acciones) */
.section-eyebrow,
[data-surface] p.text-uppercase.small.text-info {
    display: inline-flex; align-items: center; gap: .6rem;
    font-family: var(--font-mono); font-size: .75rem; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary);
}
.section-eyebrow::before,
[data-surface] p.text-uppercase.small.text-info::before { content: ''; width: .5rem; height: .5rem; border-radius: 1px; background: var(--border-strong); box-shadow: 0 0 0 1px var(--text-muted) inset; }

/* Utilidades de Bootstrap redirigidas a la paleta */
.text-info { color: var(--text-primary) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.bg-primary { background-color: var(--accent) !important; }
.border-secondary, .border-secondary-subtle { border-color: var(--border-subtle) !important; }
hr { border-color: var(--border-strong); opacity: 1; }

/* Estados como etiquetas tintadas (mejor contraste que los bloques sólidos) */
.badge { font-family: var(--font-ui); font-weight: 600; letter-spacing: .01em; border-radius: var(--r-tag); padding: .38em .65em; border: 1px solid transparent; }
.badge.rounded-pill { border-radius: var(--r-pill); }
.text-bg-success { color: #8fd3a9 !important; background-color: rgba(111, 191, 142, .14) !important; border-color: rgba(111, 191, 142, .32); }
.text-bg-warning { color: #e8bd82 !important; background-color: rgba(217, 163, 91, .14) !important; border-color: rgba(217, 163, 91, .32); }
.text-bg-danger { color: #f0948a !important; background-color: rgba(229, 103, 90, .14) !important; border-color: rgba(229, 103, 90, .32); }
.text-bg-info { color: var(--resin) !important; background-color: rgba(226, 232, 240, .1) !important; border-color: rgba(226, 232, 240, .22); }
.text-bg-secondary { color: var(--text-secondary) !important; background-color: var(--surface-3) !important; border-color: var(--border-subtle); }
.text-bg-dark { color: var(--text-primary) !important; background-color: var(--surface-1) !important; }
.bg-info { background-color: var(--resin) !important; }
.cart-count-badge { color: var(--on-accent) !important; background-color: var(--accent) !important; border: 0; min-width: 1.25rem; padding: .22em .45em; border-radius: var(--r-pill); font-size: .72rem; line-height: 1.1; }

/* Disponibilidad: punto + texto */
.avail { display: inline-flex; align-items: center; gap: .45rem; font-size: .8125rem; font-weight: 500; line-height: 1.3; color: var(--text-secondary); }
.avail::before { content: ''; flex: 0 0 auto; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.avail-in_stock { color: var(--success); } .avail-low { color: var(--warning); } .avail-soldout { color: var(--danger); }
.avail-paused { color: var(--text-muted); } .avail-made_to_order { color: var(--text-secondary); }

/* Etiquetas técnicas: rectángulo pequeño en mono (FDM sólido · resina hueco) */
.technology-badge, .category-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .26rem .55rem; border-radius: var(--r-tag);
    font-family: var(--font-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
    color: var(--text-secondary); border: 1px solid var(--border-subtle); background: rgba(255, 255, 255, .03);
}
.technology-badge::before { content: ''; width: .4rem; height: .4rem; border-radius: 1px; background: currentColor; }
.technology-badge-fdm { color: #d4d4d8; border-color: var(--border-strong); }
.technology-badge-resin { color: var(--resin); border-color: rgba(226, 232, 240, .28); }
.technology-badge-resin::before { background: transparent; box-shadow: 0 0 0 1px currentColor inset; }

/* ---------- 4. Botones ---------- */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: .95rem;
    --bs-btn-focus-box-shadow: none;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font-family: var(--font-ui); letter-spacing: -0.005em; white-space: normal; text-align: center;
    transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-base) ease, border-color var(--dur-base) ease, color var(--dur-base) ease;
}
.btn:active:not(:disabled):not(.disabled) { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.btn:disabled, .btn.disabled, fieldset:disabled .btn { opacity: .4; cursor: not-allowed; }
.d-grid > .btn, .btn.w-100 { display: flex; }

/* Primario: naranja sólido (compra, cotización, acciones comerciales) */
.btn-primary, .btn-accent {
    --bs-btn-color: #0b0b0d; --bs-btn-bg: #ff5500; --bs-btn-border-color: #ff5500;
    --bs-btn-hover-color: #0b0b0d; --bs-btn-hover-bg: #ff6a22; --bs-btn-hover-border-color: #ff6a22;
    --bs-btn-active-color: #0b0b0d; --bs-btn-active-bg: #e64d00; --bs-btn-active-border-color: #e64d00;
    --bs-btn-disabled-color: #0b0b0d; --bs-btn-disabled-bg: #ff5500; --bs-btn-disabled-border-color: #ff5500;
    box-shadow: none;
}
/* Secundario: contorno neutro (incluye WhatsApp) */
.btn-outline-info, .btn-outline-light, .btn-outline-secondary, .btn-whatsapp, .btn-success {
    --bs-btn-color: #f5f5f7; --bs-btn-bg: transparent; --bs-btn-border-color: rgba(255, 255, 255, 0.2);
    --bs-btn-hover-color: #ffffff; --bs-btn-hover-bg: #1f1f23; --bs-btn-hover-border-color: rgba(255, 255, 255, 0.34);
    --bs-btn-active-color: #ffffff; --bs-btn-active-bg: #26262b; --bs-btn-active-border-color: rgba(255, 255, 255, 0.4);
    --bs-btn-disabled-color: #a1a1aa; --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: rgba(255, 255, 255, 0.14);
}
.btn-whatsapp .bi-whatsapp, [data-surface="store"] .btn-success .bi-whatsapp { color: var(--whatsapp); }
.btn-outline-success {
    --bs-btn-color: #8fd3a9; --bs-btn-border-color: rgba(111, 191, 142, 0.4); --bs-btn-bg: transparent;
    --bs-btn-hover-color: #0b1a11; --bs-btn-hover-bg: #6fbf8e; --bs-btn-hover-border-color: #6fbf8e;
    --bs-btn-active-color: #0b1a11; --bs-btn-active-bg: #5aa878; --bs-btn-active-border-color: #5aa878;
    --bs-btn-disabled-color: #8fd3a9; --bs-btn-disabled-border-color: rgba(111, 191, 142, 0.3);
}
.btn-warning {
    --bs-btn-color: #f5f5f7; --bs-btn-bg: transparent; --bs-btn-border-color: rgba(255, 85, 0, 0.5);
    --bs-btn-hover-color: #ffffff; --bs-btn-hover-bg: rgba(255, 85, 0, 0.14); --bs-btn-hover-border-color: #ff5500;
    --bs-btn-active-color: #ffffff; --bs-btn-active-bg: rgba(255, 85, 0, 0.22); --bs-btn-active-border-color: #ff5500;
}
.btn-outline-warning { --bs-btn-color: #e8bd82; --bs-btn-border-color: rgba(217, 163, 91, 0.45); --bs-btn-hover-color: #1c1408; --bs-btn-hover-bg: #d9a35b; --bs-btn-hover-border-color: #d9a35b; --bs-btn-disabled-color: #e8bd82; }
.btn-outline-danger { --bs-btn-color: #f0948a; --bs-btn-border-color: rgba(229, 103, 90, 0.45); --bs-btn-hover-color: #1f0b09; --bs-btn-hover-bg: #e5675a; --bs-btn-hover-border-color: #e5675a; --bs-btn-disabled-color: #f0948a; }
.btn-danger { --bs-btn-color: #1f0b09; --bs-btn-bg: #e5675a; --bs-btn-border-color: #e5675a; --bs-btn-hover-color: #1f0b09; --bs-btn-hover-bg: #ec7c70; --bs-btn-hover-border-color: #ec7c70; --bs-btn-active-bg: #d4584b; --bs-btn-active-border-color: #d4584b; --bs-btn-active-color: #1f0b09; }
.btn-link { --bs-btn-color: var(--text-secondary); --bs-btn-hover-color: var(--text-primary); --bs-btn-focus-shadow-rgb: 255, 85, 0; }
.btn-link.text-danger { color: var(--danger) !important; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(160%); }

/* Tienda: botones píldora y objetivo táctil de 44 px */
[data-surface="store"] .btn { --bs-btn-border-radius: 999px; --bs-btn-padding-x: 1.35rem; --bs-btn-padding-y: .6rem; min-height: 2.75rem; }
[data-surface="store"] .btn-sm { --bs-btn-padding-x: .95rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: .875rem; min-height: 2.25rem; }
[data-surface="store"] .btn-lg { --bs-btn-padding-x: 1.75rem; --bs-btn-padding-y: .75rem; --bs-btn-font-size: 1rem; min-height: 3.25rem; }
[data-surface="store"] .btn-link { min-height: 0; --bs-btn-padding-x: .25rem; }
@media (pointer: coarse) { [data-surface="store"] .btn-sm { min-height: 2.75rem; } }

/* Admin: botones compactos de esquina suave (esquema propio, sin píldora) */
[data-surface="admin"] .btn { --bs-btn-border-radius: 8px; --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .95rem; --bs-btn-font-size: .9rem; min-height: 2.5rem; }
[data-surface="admin"] .btn-sm { --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .82rem; min-height: 2rem; }
[data-surface="admin"] .btn-lg { min-height: 3rem; }
[data-surface="admin"] .btn.rounded-pill { border-radius: 8px !important; }
[data-surface="admin"] .btn-success {
    --bs-btn-color: #0b1a11; --bs-btn-bg: #6fbf8e; --bs-btn-border-color: #6fbf8e;
    --bs-btn-hover-color: #0b1a11; --bs-btn-hover-bg: #82cc9e; --bs-btn-hover-border-color: #82cc9e;
    --bs-btn-active-color: #0b1a11; --bs-btn-active-bg: #5aa878; --bs-btn-active-border-color: #5aa878;
    --bs-btn-disabled-color: #0b1a11; --bs-btn-disabled-bg: #6fbf8e; --bs-btn-disabled-border-color: #6fbf8e;
}

/* ---------- 5. Formularios ---------- */
.form-label { font-size: .8125rem; font-weight: 500; color: var(--text-secondary); margin-bottom: .4rem; }
.form-control, .form-select {
    color: var(--text-primary);
    background-color: var(--surface-2);
    border: 1px solid var(--border-control);
    border-radius: var(--r-ctrl);
    font-size: 1rem;
    transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease, background-color var(--dur-base) ease;
}
[data-surface="store"] .form-control:not(.form-control-sm), [data-surface="store"] .form-select:not(.form-select-sm) { min-height: 3rem; padding-inline: 1rem; }
[data-surface="store"] textarea.form-control { min-height: 6rem; padding-block: .75rem; }
[data-surface="admin"] .form-control, [data-surface="admin"] .form-select { border-radius: 8px; font-size: .9375rem; }
.form-control-sm, .form-select-sm { min-height: 2.25rem; font-size: .875rem; }
.form-control::placeholder { color: var(--text-muted); }
.form-control:hover:not(:focus):not(:disabled), .form-select:hover:not(:focus):not(:disabled) { border-color: var(--border-control-hover); }
.form-control:focus, .form-select:focus { color: var(--text-primary); background-color: var(--surface-1); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.25); outline: none; }
.form-control:disabled, .form-select:disabled { opacity: .5; }
.form-control.is-invalid, .form-select.is-invalid, .was-validated .form-control:invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(229, 103, 90, 0.28); }
.invalid-feedback { color: #f0948a; }
.form-control::file-selector-button { color: var(--text-primary); background: var(--surface-3); border: 0; border-inline-end: 1px solid var(--border-subtle); }
.form-control[type="file"]:hover::file-selector-button { background: #26262b; }
.form-check-input { background-color: var(--surface-2); border-color: var(--border-control); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.25); }
.form-check-input:checked[type="radio"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%230b0b0d'/%3e%3c/svg%3e"); }
.form-check-input:checked[type="checkbox"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230b0b0d' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-text { color: var(--text-muted); font-size: .8125rem; }
.input-group-text { background: var(--surface-3); border-color: var(--border-control); color: var(--text-secondary); }
[data-surface="store"] .input-group > .input-group-text:first-child { border-radius: var(--r-ctrl) 0 0 var(--r-ctrl); }
[data-surface="store"] .input-group > .form-control:last-child { border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0; }

/* Opciones de entrega y pago como tarjetas seleccionables */
[data-surface="store"] label.form-check.border {
    border-radius: var(--r-ctrl) !important; border-color: var(--border-control) !important; background: var(--surface-2);
    cursor: pointer; transition: border-color var(--dur-base) ease, background-color var(--dur-base) ease;
}
[data-surface="store"] label.form-check.border:hover { border-color: var(--border-control-hover) !important; }
[data-surface="store"] label.form-check.border:has(.form-check-input:checked) { border-color: var(--accent) !important; background: var(--accent-soft); }
[data-surface="store"] label.form-check.border:has(.form-check-input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Zona de subida del STL: el mismo input, con estilo de zona de arrastre */
#stlFileInput { border-style: dashed; border-width: 1.5px; background: var(--surface-1); padding: .9rem 1rem; min-height: 3.5rem; }

/* Alertas */
.alert { --bs-alert-bg: var(--surface-2); --bs-alert-border-color: var(--border-subtle); --bs-alert-color: var(--text-primary); --bs-alert-link-color: var(--text-primary); border-radius: var(--r-ctrl); border-left-width: 3px; }
.alert-success { border-left-color: var(--success); } .alert-info { border-left-color: var(--resin); }
.alert-warning { border-left-color: var(--warning); } .alert-danger { border-left-color: var(--danger); }
.alert-secondary { border-left-color: var(--text-muted); }
.alert .alert-link { text-decoration: underline; }

/* ---------- 6. Superficies, tablas, tabs ---------- */
.card, .surface-panel, .glass-card, .product-detail-panel {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-1);
    color: var(--text-primary);
}
[data-surface="store"] .glass-card { border-radius: var(--r-card); }
[data-surface="admin"] .glass-card, [data-surface="admin"] .card { border-radius: 12px; box-shadow: none; background: var(--surface-1); }
.nav-tabs { --bs-nav-tabs-border-color: var(--border-subtle); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-color: var(--text-primary); --bs-nav-tabs-link-active-border-color: transparent; --bs-nav-link-color: var(--text-secondary); --bs-nav-link-hover-color: var(--text-primary); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .7rem 1rem; font-weight: 500; white-space: nowrap; }
.nav-tabs .nav-link:hover { border-bottom-color: var(--border-strong); }
.nav-tabs .nav-link.active { border-bottom-color: var(--accent); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text-primary); --bs-table-border-color: var(--border-subtle); --bs-table-hover-bg: rgba(255, 255, 255, 0.03); --bs-table-hover-color: var(--text-primary); --bs-table-striped-bg: rgba(255, 255, 255, 0.02); }
.table-dark { --bs-table-bg: transparent; --bs-table-border-color: var(--border-subtle); --bs-table-hover-bg: rgba(255, 255, 255, 0.03); }
.table > thead > tr > th { font-family: var(--font-mono); font-size: .6875rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); border-bottom-color: var(--border-strong); white-space: nowrap; }
.table > :not(caption) > * > * { padding: .85rem .9rem; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--text-muted); --bs-breadcrumb-item-active-color: var(--text-secondary); font-size: .875rem; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }
.accordion { --bs-accordion-bg: transparent; --bs-accordion-border-color: var(--border-subtle); --bs-accordion-btn-focus-box-shadow: none; --bs-accordion-active-bg: transparent; --bs-accordion-active-color: var(--text-primary); }
.progress { background: rgba(255, 255, 255, 0.06); }
.modal-content, .offcanvas { background: var(--surface-1); border-color: var(--border-strong); color: var(--text-primary); }
.modal-content { border-radius: var(--r-card); box-shadow: var(--shadow-2); }
.modal-header, .modal-footer, .offcanvas-header { border-color: var(--border-subtle); }
.dropdown-menu { --bs-dropdown-bg: var(--surface-2); --bs-dropdown-border-color: var(--border-strong); --bs-dropdown-link-hover-bg: var(--surface-3); }
.carousel-control-prev-icon, .carousel-control-next-icon { width: 1.4rem; height: 1.4rem; }

/* ---------- 7. Navegación y pie ---------- */
header.sticky-top { z-index: 1030; }
header .navbar {
    min-height: var(--nav-height);
    padding-block: .5rem;
    background: var(--bg-glass);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border-subtle) !important;
}
.navbar-brand { font-weight: 700; font-size: 1.1rem; display: inline-flex; align-items: center; gap: .55rem; margin-right: 1.25rem; }
.brand-mark {
    display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 6px;
    font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: -0.02em;
    color: var(--on-accent); background: var(--accent);
}
.navbar .nav-link { font-size: .9rem; font-weight: 500; color: var(--text-secondary); border-radius: 8px; padding: .5rem .75rem; position: relative; transition: color var(--dur-base) ease, background-color var(--dur-base) ease; }
.navbar .nav-link:hover, .navbar .nav-link:focus-visible { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.navbar .nav-link.active { color: var(--text-primary); }
.navbar .nav-link.active::after { content: ''; position: absolute; left: .75rem; right: .75rem; bottom: .15rem; height: 2px; border-radius: 2px; background: var(--accent); }
.navbar-toggler { border: 1px solid var(--border-strong); border-radius: var(--r-pill); padding: .45rem .7rem; min-height: 2.5rem; }
.navbar-toggler:focus { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.nav-cart { position: relative; min-height: 2.5rem; padding: .4rem .95rem; gap: .5rem; }
[data-surface="store"] .nav-cart { min-height: 2.5rem; }
.nav-cart .cart-count-badge { position: relative; }
.nav-auth { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 991.98px) {
    .navbar-collapse { flex-basis: 100%; padding: .75rem 0 .5rem; }
    .navbar .nav-link { padding: .85rem .75rem; min-height: 3rem; display: flex; align-items: center; font-size: 1rem; }
    .navbar .nav-link.active::after { left: .75rem; right: auto; width: 1.5rem; bottom: .55rem; }
    .nav-auth { padding-top: .75rem; margin-top: .5rem; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
    .nav-auth .btn { flex: 1 1 8rem; }
}
@media (min-width: 992px) { .nav-actions { margin-left: .75rem; } .nav-auth { margin-left: auto; } }
.sticky-lg-top.glass-card { top: calc(var(--nav-height) + 1rem) !important; }

.site-footer { border-top: 1px solid var(--border-subtle); font-size: .9rem; margin-top: var(--sp-9) !important; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { color: var(--text-primary); }
.site-footer .mono { font-size: .75rem; color: var(--text-muted); }
.footer-heading { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }
.footer-social a { font-size: 1.25rem; }
.footer-bottom { border-top: 1px solid var(--border-subtle); font-size: .82rem; }

/* Botón flotante de WhatsApp: sobrio, sin animación continua */
.whatsapp-float {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1030;
    display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
    color: var(--whatsapp); font-size: 1.4rem; text-decoration: none;
    background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
    transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) ease, color var(--dur-base) ease;
}
.whatsapp-float:hover, .whatsapp-float:focus-visible { color: #b4e5c6; transform: translateY(-2px); border-color: rgba(143, 211, 169, .5); }
@media (max-width: 767.98px) {
    .whatsapp-float { right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; font-size: 1.3rem; }
    body:has(.product-mobile-buy-bar) .whatsapp-float, body:has(#checkoutForm) .whatsapp-float, body:has(#stlQuoteForm) .whatsapp-float { display: none; }
    body:has(.product-mobile-buy-bar) { padding-bottom: 4.5rem; }
}

/* ---------- 8. Tienda ---------- */
/* Hero híbrido: el SVG se pinta de inmediato; el canvas 3D lo cubre solo si el equipo lo permite */
.hero { position: relative; }
.hero-v2 { display: grid; gap: var(--sp-6); align-items: center; padding-block: clamp(1.5rem, 4vw, 3rem) var(--sp-7); }
.hero-v2::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 70% 40%, #000 0%, transparent 72%);
    mask-image: radial-gradient(ellipse 60% 70% at 70% 40%, #000 0%, transparent 72%);
    opacity: .5;
}
.hero-v2 > * { position: relative; z-index: 1; }
.hero-v2 h1 { font-size: clamp(2.75rem, 1rem + 7vw, 5.5rem); line-height: 1.02; letter-spacing: -0.045em; margin: 1.25rem 0 1.25rem; }
.hero-lead { max-width: 34rem; font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--text-secondary); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-visual { position: relative; width: min(100%, 22rem); aspect-ratio: 320 / 380; margin-inline: auto; }
.hero-svg, .hero-canvas-wrap { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-svg { transition: opacity var(--dur-reveal) var(--ease-out); }
.hero-canvas-wrap { opacity: 0; transition: opacity var(--dur-reveal) var(--ease-out); pointer-events: none; }
.hero-canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.hero-visual.is-3d-ready .hero-canvas-wrap { opacity: 1; }
.hero-visual.is-3d-ready .hero-svg { opacity: 0; }
.hero-caption { position: absolute; left: 0; right: 0; bottom: -1.75rem; text-align: center; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.hero-data { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--border-subtle); margin-top: var(--sp-4); }
.hero-data > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-subtle); }
.hero-data strong { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text-primary); }
.hero-data span { font-size: .875rem; color: var(--text-secondary); text-align: right; }
@media (min-width: 992px) {
    .hero-v2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--sp-8); min-height: min(78svh, 700px); }
    .hero-visual { width: min(100%, 30rem); }
    .hero-data { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); margin-top: 0; }
    .hero-data > div { flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.5rem 1.5rem 1.5rem 0; border-bottom: 0; border-right: 1px solid var(--border-subtle); }
    .hero-data > div + div { padding-left: 1.5rem; }
    .hero-data > div:last-child { border-right: 0; }
    .hero-data strong { font-size: 1.75rem; }
    .hero-data span { text-align: left; }
}

/* Secciones del inicio */
.home-section { padding-block: var(--section-y) 0; }
.home-section > .section-head { margin-bottom: var(--sp-6); }
.step-card { height: 100%; padding: 1.5rem; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin-bottom: 1rem; border-radius: var(--r-tag); border: 1px solid var(--border-strong); color: var(--text-secondary); font-family: var(--font-mono); font-size: .8125rem; }
.trust-item { display: flex; gap: .85rem; align-items: flex-start; height: 100%; padding: 1.15rem 0; border-top: 1px solid var(--border-subtle); }
.trust-item .bi { font-size: 1.35rem; color: var(--text-secondary); flex: 0 0 auto; }
.trust-item strong { display: block; font-weight: 600; }
.trust-item span { font-size: .875rem; color: var(--text-secondary); }
.tech-compare-card { height: 100%; padding: 1.75rem; }
.tech-metric + .tech-metric { margin-top: 1rem; }
.tech-metric-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; color: var(--text-primary); margin-bottom: .5rem; }
.tech-metric-head span:last-child { color: var(--text-secondary); font-size: .75rem; }
.tech-meter { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.tech-meter-fill { display: block; height: 100%; width: var(--meter-value, 50%); border-radius: inherit; transform-origin: left center; animation: studio-meter .9s var(--ease-out) both; }
.is-fdm .tech-meter-fill { background: #f5f5f7; }
.is-resin .tech-meter-fill { background: #7f93ad; }
.tech-ideal { font-size: .9rem; color: var(--text-secondary); padding-top: 1rem; border-top: 1px solid var(--border-subtle); }
.testimonial-card { height: 100%; padding: 1.5rem; }
.testimonial-card blockquote { margin: 0 0 1rem; color: var(--text-primary); }
.faq-list .accordion-item { background: transparent; border-color: var(--border-subtle); }
.faq-list .accordion-button { background: transparent; color: var(--text-primary); box-shadow: none; padding: 1.15rem 0; font-weight: 500; }
.faq-list .accordion-button:not(.collapsed) { color: var(--text-primary); background: transparent; }
.faq-list .accordion-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-list .accordion-body { color: var(--text-secondary); line-height: 1.7; padding-inline: 0; }
.cta-band { padding: clamp(2rem, 5vw, 4rem) 1.5rem; text-align: center; border-radius: var(--r-panel) !important; background: var(--surface-1); }
.prose { max-width: 48rem; }
.prose h2 { font-size: 1.3rem; margin-top: 2.25rem; margin-bottom: .75rem; }
.prose h3 { font-size: 1.05rem; margin-top: 1.5rem; }
.prose p, .prose li { color: var(--text-secondary); line-height: 1.7; }
.prose a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-strong); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose .updated { font-size: .82rem; color: var(--text-muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; }
.gallery-grid a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--r-ctrl); border: 1px solid var(--border-subtle); background: var(--surface-2); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.gallery-grid a:hover img, .gallery-grid a:focus-visible img { transform: scale(1.04); }

/* Catálogo: filtros y tarjetas */
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.filter-chip {
    display: inline-flex; align-items: center; min-height: 2.5rem; padding: .35rem 1rem;
    border-radius: var(--r-pill); border: 1px solid var(--border-strong);
    font-size: .875rem; font-weight: 500; color: var(--text-secondary); text-decoration: none;
    transition: color var(--dur-base) ease, background-color var(--dur-base) ease, border-color var(--dur-base) ease;
}
.filter-chip:hover, .filter-chip:focus-visible { color: var(--text-primary); border-color: rgba(255, 255, 255, .34); }
.filter-chip.is-active { color: var(--on-accent); background: var(--text-primary); border-color: var(--text-primary); }
.filter-chip-count { margin-left: .45rem; font-family: var(--font-mono); font-size: .72rem; opacity: .7; }
.filter-clear { margin-left: auto; font-size: .85rem; color: var(--text-secondary); text-decoration: none; }
.filter-clear:hover { color: var(--text-primary); }
/* Catálogo: barra de búsqueda y filtros. Mismo marcado en todos los anchos:
   móvil (<768 px) = una fila con buscador + "Filtros" y hoja inferior; tablet/escritorio = barra horizontal siempre visible. */
.catalog-toolbar { padding: 1rem; margin-bottom: 1.25rem; }
.catalog-toolbar .input-group-text { background: var(--surface-3); }
.catalog-search .input-group { flex-wrap: nowrap; }
.search-clear {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.75rem; padding: 0; cursor: pointer;
    color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--border-control); border-left: 0;
    border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0; transition: color var(--dur-base) ease, background-color var(--dur-base) ease;
}
.search-clear:hover { color: var(--text-primary); background: var(--surface-3); }
.search-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
#search:placeholder-shown + .search-clear { display: none; }
.catalog-toolbar #search:placeholder-shown { border-top-right-radius: var(--r-ctrl); border-bottom-right-radius: var(--r-ctrl); }
.catalog-toolbar #search:not(:placeholder-shown) { border-right: 0; border-radius: 0; }
.filters-toggle { position: relative; gap: .5rem; white-space: nowrap; display: none; }
.filters-toggle .filters-count { font-family: var(--font-mono); font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.filters-toggle.has-active { border-color: var(--accent); }
.filters-toggle.has-active::after { content: ''; position: absolute; top: -3px; right: -3px; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-canvas); }
.filters-backdrop, .filters-sheet-head, .filters-sheet-foot { display: none; }
.filters-clear { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; }
.filters-clear:hover { color: var(--text-primary); }
.filters-close { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; color: var(--text-secondary); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.filters-close:hover { color: var(--text-primary); background: var(--surface-3); }
.filters-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters-field .form-label { margin-bottom: .5rem; }

@media (min-width: 768px) {
    .catalog-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 15rem auto; gap: .75rem 1rem; align-items: end; margin-bottom: 1rem; }
    .catalog-toolbar-main, .filters-panel { display: contents; }
    .catalog-search { grid-row: 1; grid-column: 1; }
    .filters-field-sort { grid-row: 1; grid-column: 2; }
    .catalog-submit { grid-row: 1; grid-column: 3; }
    .filters-field-cats { grid-row: 2; grid-column: 1 / -1; padding-top: .75rem; border-top: 1px solid var(--border-subtle); }
    .filters-field-cats > .form-label { display: none; }
    .filters-toggle { display: none !important; }
}
@media (max-width: 767.98px) {
    [data-surface="store"] main.catalog-page { padding-top: .5rem !important; padding-bottom: 2rem !important; }
    .catalog-head { flex-wrap: nowrap !important; align-items: baseline !important; gap: .25rem .75rem !important; margin-bottom: .25rem !important; }
    .catalog-head .section-eyebrow { display: none; }
    .catalog-head h1 { font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1.15; }
    .catalog-head .catalog-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .catalog-toolbar { background: none; border: 0; box-shadow: none; border-radius: 0; padding: 0; margin: 0 0 .5rem; }
    .catalog-toolbar-main { display: flex; align-items: stretch; gap: .5rem; }
    .catalog-search { flex: 1 1 auto; min-width: 0; }
    .catalog-search > .form-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .catalog-search .form-control, .catalog-search .input-group-text, .search-clear { min-height: 3rem; }
    .catalog-submit { display: none; }
    .filter-clear { display: none; }
    .js .filters-toggle { display: inline-flex; flex: 0 0 auto; min-height: 3rem; padding-inline: 1rem; }
    /* Hoja inferior (solo con JS; sin JS los controles quedan en línea). */
    .js .filters-panel {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1060; max-height: 80vh; max-height: min(82dvh, 36rem); overflow-y: auto; overscroll-behavior: contain;
        padding: 1.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
        background: var(--surface-1); border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: var(--shadow-2);
        transform: translateY(100%); visibility: hidden; transition: transform .3s var(--ease-out), visibility 0s linear .3s;
    }
    .js .filters-panel::before { content: ''; position: absolute; top: .5rem; left: 50%; width: 2.5rem; height: 4px; margin-left: -1.25rem; border-radius: 4px; background: var(--border-strong); }
    .js .catalog-toolbar[data-filters-open="true"] .filters-panel { transform: none; visibility: visible; transition: transform .3s var(--ease-out), visibility 0s; }
    .js .filters-backdrop { display: block; position: fixed; inset: 0; z-index: 1055; background: rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
    .js .catalog-toolbar[data-filters-open="true"] .filters-backdrop { opacity: 1; visibility: visible; transition: opacity .25s ease; }
    html.filters-lock { overflow: hidden; }
    .js .filters-sheet-head { display: flex; align-items: center; justify-content: space-between; margin: -.25rem 0 .75rem; }
    .js .filters-sheet-head h2 { font-size: 1.125rem; }
    .filters-field { margin-bottom: 1.25rem; }
    .filters-field-cats .filter-chips { flex-wrap: wrap; }
    .js .filters-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }
    .js .filters-sheet-foot .filters-clear { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .9375rem; }
    .js .filters-sheet-foot .btn { flex: 1 1 auto; max-width: 15rem; margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .js .filters-panel, .js .filters-backdrop { transition: none !important; } }

.product-card {
    display: flex; flex-direction: column;
    background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--r-card);
    box-shadow: var(--shadow-1); overflow: hidden; min-width: 0;
    transition: border-color var(--dur-base) ease;
}
.product-card:hover, .product-card:focus-within { border-color: var(--border-strong); }
.product-card-image-placeholder {
    position: relative; display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1; min-height: 0; overflow: hidden;
    color: var(--text-muted); font-size: 2.5rem; background: var(--surface-2);
}
.product-card-image { width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: .8rem; transition: transform .5s var(--ease-out); }
.product-card:hover .product-card-image { transform: scale(1.03); }
.product-card > .p-3 { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1rem !important; gap: .15rem; }
.product-card > .p-3 > .d-grid, .product-card > .p-3 > .d-flex:last-child { margin-top: auto; }
.product-card h2, .product-card h3 { font-size: 1.0625rem; letter-spacing: -0.015em; line-height: 1.3; margin: .5rem 0 .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .small.text-body-secondary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-tag { font-size: 1.0625rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.price-tag small { font-size: .7rem; color: var(--text-muted); letter-spacing: .04em; }
.product-card-link { font-size: .875rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.product-card-link i { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.product-card:hover .product-card-link { color: var(--text-primary); }
.product-card:hover .product-card-link i { transform: translateX(3px); }
.product-card .card-actions { display: grid; gap: .5rem; margin-top: .85rem; }
@media (min-width: 768px) { .product-card > .p-3 { padding: 1.25rem !important; } }
@media (max-width: 575.98px) {
    .product-card > .p-3 { padding: .85rem !important; }
    .product-card h2, .product-card h3 { font-size: .95rem; }
    .product-card .small.product-card-desc, .product-card .small.product-card-lead { display: none; }
    .product-card .d-flex.justify-content-between { flex-direction: column; align-items: flex-start !important; gap: .15rem !important; margin-top: .5rem !important; }
    .product-card .product-card-link { margin-left: 0 !important; }
    .product-card .price-tag { font-size: 1rem; }
    .product-card-link { font-size: .8125rem; }
    .product-card .avail { font-size: .75rem; }
}

/* Ficha de producto */
.product-detail-panel { background: transparent; border: 0; box-shadow: none; padding: 0; }
@media (min-width: 992px) { .product-detail-panel { padding: .5rem 0 0 1rem; } .product-gallery-col { position: sticky; top: calc(var(--nav-height) + 1.5rem); align-self: flex-start; } }
.product-gallery .carousel-inner { overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--border-subtle); background: var(--surface-2); }
.product-gallery-media { width: 100%; height: min(100vw - 2rem, 560px); object-fit: contain; background: var(--surface-2); }
.product-gallery-empty { min-height: 360px; gap: .75rem; color: var(--text-secondary); font-size: 1rem; }
.product-gallery-empty .bi { font-size: 2.5rem; color: var(--text-muted); }
.carousel-control-prev, .carousel-control-next { width: 3rem; opacity: .85; }
.color-option { display: inline-flex; flex-direction: column; align-items: center; gap: .45rem; cursor: pointer; font-size: .82rem; color: var(--text-secondary); }
.color-swatch {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.28), transparent 42%), var(--swatch-color);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.4);
    transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-base) ease;
}
.color-option:hover .color-swatch { transform: scale(1.06); }
.color-swatch.active, .color-swatch-input:checked + .color-swatch { box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--bg-canvas), 0 0 0 3.5px var(--text-primary); }
.color-swatch-input:focus-visible + .color-swatch { outline: 2px solid var(--accent); outline-offset: 5px; }
.color-swatch-input:checked ~ .small { color: var(--text-primary); font-weight: 600; }
.slicer-panel { border-radius: var(--r-card); border: 1px solid var(--border-subtle); background: var(--surface-1); padding: 1rem; }
.slicer-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.slicer-panel-header h2 { margin: 0; font-family: var(--font-mono); font-size: inherit; font-weight: 500; letter-spacing: inherit; line-height: inherit; color: var(--text-secondary); }
.slicer-panel-header .slicer-dot { width: .45rem; height: .45rem; border-radius: 1px; background: var(--success); display: inline-block; margin-right: .45rem; }
.slicer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border-radius: var(--r-ctrl); overflow: hidden; border: 1px solid var(--border-subtle); }
@media (min-width: 576px) { .slicer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.slicer-cell { padding: .85rem .9rem; background: var(--surface-1); min-width: 0; }
.slicer-cell .bi { font-size: 1rem; color: var(--text-muted); }
.slicer-label { display: block; margin-top: .45rem; font-size: .6875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.slicer-value { display: block; margin-top: .15rem; font-size: .875rem; font-weight: 500; color: var(--text-primary); overflow-wrap: anywhere; }
#product-price { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.25rem); font-weight: 500; letter-spacing: -0.03em; }
.product-mobile-buy-bar { z-index: 1020; background: rgba(9, 9, 11, .88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--border-strong); padding-bottom: env(safe-area-inset-bottom); }

/* Cotizador STL y visor */
.stl-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); border-radius: var(--r-card); overflow: hidden; }
.stl-step { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; background: var(--surface-1); font-size: .875rem; color: var(--text-secondary); min-width: 0; }
.stl-step-number { flex: 0 0 auto; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: var(--r-tag); font-family: var(--font-mono); font-size: .75rem; color: var(--text-secondary); border: 1px solid var(--border-strong); }
@media (max-width: 575.98px) { .stl-steps { grid-template-columns: 1fr; } }
#stl-viewer, .stl-canvas-container { position: relative; height: clamp(320px, 55vw, 520px); overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #1a1a1e 0%, #0c0c0e 75%); }
@media (max-height: 500px) and (orientation: landscape) { #stl-viewer, .stl-canvas-container { height: 70svh; } }
#stl-viewer canvas, .stl-canvas-container canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#stlViewerStatus { position: absolute; z-index: 1; top: .75rem; left: .75rem; right: .75rem; width: fit-content; max-width: calc(100% - 1.5rem); padding: .5rem .75rem !important; margin: 0; border-radius: 8px; font-size: .85rem; color: var(--text-secondary); background: rgba(9, 9, 11, .82); border: 1px solid var(--border-subtle); }
#stlQuotedPrice { font-size: 1.35rem !important; font-weight: 500; letter-spacing: -0.03em; }

/* Carrito (cajón) */
.cart-item-thumbnail { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: var(--r-ctrl) !important; background: var(--surface-2); flex: 0 0 auto; }
#cartItemsContainer article:last-child { border-bottom: 0 !important; }
#cartItemsContainer .btn-sm.btn-outline-light { min-width: 2.25rem; padding-inline: 0; }
#cartItemsContainer .badge { font-weight: 500; }
.offcanvas.text-bg-dark { background: var(--surface-1) !important; border-left: 1px solid var(--border-strong) !important; box-shadow: var(--shadow-2); }
.offcanvas-end { width: min(420px, 100vw); }
.modal-content.text-bg-dark { background: var(--surface-1) !important; border: 1px solid var(--border-strong) !important; }

/* Seguimiento de fabricación */
.tracker-progress { height: .5rem; background: rgba(255, 255, 255, 0.07); border-radius: var(--r-pill); }
.tracker-progress .progress-bar { background: var(--accent); color: transparent; font-size: 0; border-radius: var(--r-pill); }
.progress-bar-striped, .progress-bar-animated { background-image: none; animation: none; }
.manufacturing-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem .5rem; }
@media (min-width: 768px) { .manufacturing-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.manufacturing-step { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; color: var(--text-muted); }
.manufacturing-step-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid currentColor; border-radius: 50%; font-size: 1.05rem; }
.manufacturing-step-label { font-size: .75rem; line-height: 1.25; }
.manufacturing-step.is-complete { color: var(--text-secondary); }
.manufacturing-step.is-complete .manufacturing-step-icon { background: var(--surface-3); }
.manufacturing-step.is-active { color: var(--text-primary); }
.manufacturing-step.is-active .manufacturing-step-icon { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tracker-color-dot { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; background: var(--tracker-color); border: 1px solid rgba(255,255,255,.4); flex: 0 0 auto; }
.otp-input { font-family: var(--font-mono); font-size: 1.75rem; font-weight: 500; letter-spacing: .5em; text-align: center; padding: .7rem .5rem .7rem 1rem; font-variant-numeric: tabular-nums; }
.otp-input::placeholder { color: #52525b; letter-spacing: .5em; }
.cart-count-badge.is-bumping { animation: cart-bump .45s var(--ease-out); }

/* ---------- 9. Administración (esquema propio, más denso) ---------- */
[data-surface="admin"] body, body[data-surface="admin"] { font-size: .9375rem; }
body[data-surface="admin"] main.container { padding-block: 1.75rem 3rem; }
body[data-surface="admin"] h1 { font-size: clamp(1.6rem, 1rem + 2vw, 2.25rem); letter-spacing: -0.035em; }
body[data-surface="admin"] h2.h4, body[data-surface="admin"] h2 { font-size: 1.25rem; }
body[data-surface="admin"] .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: 0; }
body[data-surface="admin"] .nav-tabs::-webkit-scrollbar { display: none; }
body[data-surface="admin"] .glass-card.p-4 { padding: 1.25rem !important; }
body[data-surface="admin"] section[aria-label="Métricas de la tienda"] .glass-card strong { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.03em; }
body[data-surface="admin"] .text-info { color: var(--text-primary) !important; }
body[data-surface="admin"] .table > :not(caption) > * > * { padding: .7rem .8rem; }
body[data-surface="admin"] .form-label { font-size: .78rem; }
body[data-surface="admin"] .navbar .nav-link.active::after { background: var(--text-primary); }
.admin-color-dot { display: inline-block; width: .8rem; height: .8rem; margin-right: .35rem; border-radius: 50%; background: var(--admin-color); border: 1px solid rgba(255,255,255,.4); vertical-align: -.05rem; }

/* Modal "Crear / Editar producto": el <form> entre .modal-content y .modal-body rompe la cadena flex de Bootstrap;
   se restablece la columna: encabezado y pie fijos, solo el cuerpo se desplaza. */
#productModal .modal-dialog-scrollable { height: calc(100dvh - 1rem); max-height: calc(100dvh - 1rem); }
#productModal .modal-dialog-scrollable .modal-content { max-height: 100%; }
#productModal .modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; overflow: hidden; }
#productModal .modal-header, #productModal .modal-footer { flex: 0 0 auto; }
#productModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#productModal .modal-footer { flex-wrap: wrap; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
@media (min-width: 576px) { #productModal .modal-dialog-scrollable { height: calc(100dvh - 3.5rem); max-height: calc(100dvh - 3.5rem); } }
@media (max-width: 575.98px) { #productModal .modal-footer .btn { flex: 1 1 8rem; } }
#productModal .product-form-section { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
#productModal .product-form-section > legend { float: none; width: auto; display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; padding: 0 0 .55rem; border-bottom: 1px solid var(--border-subtle); font-size: 1rem; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; color: var(--text-primary); }
#productModal .product-form-step { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--text-primary); }
#productModal .product-form-section:last-child { margin-bottom: 0; }
#productModal .modal-footer #productSaveButton { min-width: 11rem; white-space: nowrap; }
@media (max-width: 575.98px) { #productModal .modal-footer #productSaveButton { flex: 2 1 12rem; font-size: 1.05rem; } }
#productModal .modal-footer #productSaveButton:disabled { opacity: .8; cursor: progress; }

/* ---------- 10. Movimiento ---------- */
@keyframes studio-meter { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cart-bump { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
    .product-card:hover .product-card-image, .gallery-grid a:hover img { transform: none; }
}
