/* ============================================================
   public/css/base.css
   Estilos base compartidos por index.html y asistente.html
   ============================================================ */

/* ===== RESET GLOBAL ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-canvas);
    color: var(--text-1);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

img, svg, video, canvas {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

/* ============================================================
   VARIABLES GLOBALES (TEMA OSCURO POR DEFECTO)
   ============================================================ */
:root {
    /* Espaciado */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;

    /* Fondos */
    --bg-canvas: #0B0B0F;
    --bg-surface: #141419;
    --bg-elevated: #1c1c24;

    /* Glass / superficies translúcidas */
    --glass: rgba(255, 255, 255, 0.04);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(20, 20, 25, 0.85);

    /* Bordes */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Colores primarios */
    --primary: #A78BFA;
    --primary-bright: #c4b5fd;
    --primary-deep: #7C3AED;
    --primary-glow: rgba(124, 58, 237, 0.25);

    /* Dorado */
    --gold: #FBBF24;
    --gold-light: #fcd34d;
    --gold-bright: #FDE68A;
    --gold-glow: rgba(251, 191, 36, 0.25);

    /* Acentos */
    --rose: #fb7185;
    --emerald: #34d399;

    /* Textos */
    --text-1: #F8F9FA;
    --text-2: rgba(248, 249, 250, 0.70);
    --text-3: rgba(248, 249, 250, 0.45);
    --text-4: rgba(248, 249, 250, 0.25);

    /* Sombras */
    --sh-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
    --sh-md: 0 12px 32px rgba(0, 0, 0, 0.25);
    --sh-lg: 0 24px 60px rgba(0, 0, 0, 0.35);

    /* Radios */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-2xl: 36px;
    --r-pill: 999px;

    /* Curvas de animación */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Tipografías */
    --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   TEMA CLARO
   ============================================================ */
[data-theme="light"] {
    --bg-canvas: #F8F9FA;
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF;

    --glass: rgba(255, 255, 255, 0.75);
    --glass-hover: rgba(255, 255, 255, 0.95);
    --glass-strong: rgba(255, 255, 255, 0.98);

    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-hover: rgba(0, 0, 0, 0.08);

    --primary: #7C3AED;
    --primary-bright: #6D28D9;
    --primary-deep: #5B21B6;
    --primary-glow: rgba(124, 58, 237, 0.18);

    --gold: #d97706;
    --gold-light: #f59e0b;
    --gold-bright: #b45309;
    --gold-glow: rgba(217, 119, 6, 0.18);

    --rose: #e11d48;
    --emerald: #059669;

    --text-1: #1a0f2e;
    --text-2: rgba(26, 15, 46, 0.70);
    --text-3: rgba(26, 15, 46, 0.45);
    --text-4: rgba(26, 15, 46, 0.25);

    --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --sh-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --sh-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   ICONOS SVG - REGLA CRÍTICA
   ============================================================ */
.icon-svg {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
    fill: currentColor;
    stroke: none;
    pointer-events: none;
    overflow: visible;
    color: inherit;
}

svg[aria-hidden="true"][width="0"][height="0"],
svg[width="0"][height="0"][style*="position:absolute"] {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

button .icon-svg,
a .icon-svg {
    font-size: inherit;
}

/* ============================================================
   SCROLLBARS PERSONALIZADOS (WebKit)
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox — solo aplicar scrollbar-color a contenedores con scroll real */
html, body, .panel-inner, .testimonials-wrapper, .resenas-mini-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) transparent;
}

/* ============================================================
   SELECTS / INPUTS NATIVOS
   ============================================================ */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

select {
    cursor: pointer;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   ANIMACIONES COMPARTIDAS
   ============================================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================================
   SELECCIÓN DE TEXTO
   ============================================================ */
::selection {
    background: var(--primary-glow);
    color: var(--text-1);
}

::-moz-selection {
    background: var(--primary-glow);
    color: var(--text-1);
}

/* ============================================================
   FOCUS VISIBLE (Accesibilidad)
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

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

/* ============================================================
   IMPRESIÓN
   ============================================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    .theme-btn, .floating-controls, .fab-resena {
        display: none !important;
    }
}



/* ═══════════════════════════════════════════════════════════
   PAGESPEED — Compositing y contraste
   ═══════════════════════════════════════════════════════════ */

/* Forzar composición GPU en elementos que se animan con opacity/transform */
.icon-svg,
button,
a,
input,
select,
textarea {
    backface-visibility: hidden;
}

/* Mejorar contraste en placeholders */
::placeholder {
    opacity: 0.85;
}

/* Focus más visible (accesibilidad AA) */
:focus-visible {
    outline-width: 3px;
    outline-offset: 3px;
}
