/* ==========================================================================
   ZDIBU GLOBAL STYLE
   BASE GLOBAL + UTILIDADES REUTILIZABLES
   ========================================================================== */


/* ==========================================================================
   1. VARIABLES GLOBALES
   ========================================================================== */

:root{

    /* Colores principales */

    --accent-color:#38bdf8;
    --accent-hover:#7dd3fc;
    --accent-strong:#0284c7;

    --accent-glow:rgba(56,189,248,.25);
    --accent-subtle:rgba(56,189,248,.10);
    --accent-border:rgba(56,189,248,.30);

    /* Estados */

    --success:#22c55e;
    --success-subtle:rgba(34,197,94,.12);

    --warning:#f59e0b;
    --warning-subtle:rgba(245,158,11,.12);

    --danger:#ef4444;
    --danger-subtle:rgba(239,68,68,.12);

    /* Fondos */

    --bg-main:#0b0f19;
    --bg-card:#111827;
    --bg-hover:#1e293b;
    --bg-soft:#172033;
    --bg-elevated:#202b3d;

    /* Bordes */

    --border-color:#1f2937;
    --border-light:#374151;
    --border-focus:var(--accent-color);

    /* Texto */

    --text-main:#e2e8f0;
    --text-muted:#9ca3af;
    --text-dim:#6b7280;
    --text-inverse:#081018;

    /* Sombras */

    --shadow-xs:
        0 2px 8px rgba(0,0,0,.20);

    --shadow:
        0 10px 30px rgba(0,0,0,.35);

    --shadow-hover:
        0 16px 40px rgba(0,0,0,.50);

    --shadow-glow:
        0 0 22px var(--accent-glow);

    /* Radios */

    --radius-xs:4px;
    --radius-sm:6px;
    --radius-md:8px;
    --radius-lg:12px;
    --radius-xl:18px;
    --radius-2xl:24px;
    --radius-pill:999px;

    /* Transiciones */

    --transition-fast:.14s ease;
    --transition:.22s ease;
    --transition-slow:.38s ease;

    /* Layout */

    --container:1100px;
    --container-wide:1400px;

    /* Capas */

    --z-base:1;
    --z-dropdown:100;
    --z-sticky:200;
    --z-overlay:500;
    --z-modal:1000;

}


/* ==========================================================================
   2. RESET
   ========================================================================== */

*,
*::before,
*::after{

    margin:0;
    padding:0;
    box-sizing:border-box;

}

html{

    scroll-behavior:smooth;

    color-scheme:dark;

    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;

}

body{

    background:var(--bg-main);
    color:var(--text-main);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    line-height:1.6;

    min-height:100vh;

    display:flex;
    flex-direction:column;

    overflow-x:hidden;

    text-rendering:optimizeLegibility;

    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;

}

main{

    min-width:0;

}

img,
picture,
video,
canvas,
svg{

    display:block;

    max-width:100%;

}

img,
video{

    height:auto;

}

button,
input,
select,
textarea{

    font:inherit;
    color:inherit;

}

button{

    cursor:pointer;

}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled{

    cursor:not-allowed;
    opacity:.6;

}

a{

    color:inherit;
    text-decoration:none;

}

ul,
ol{

    list-style:none;

}

table{

    border-collapse:collapse;
    border-spacing:0;

}

iframe{

    max-width:100%;

}

hr{

    border:0;
    border-top:1px solid var(--border-color);

}


/* ==========================================================================
   3. SELECCIÓN DE TEXTO
   ========================================================================== */

::selection{

    background:var(--accent-color);
    color:#fff;

}

::-moz-selection{

    background:var(--accent-color);
    color:#fff;

}


/* ==========================================================================
   4. SCROLLBAR GLOBAL
   ========================================================================== */

html{

    scrollbar-color:var(--border-light) var(--bg-main);
    scrollbar-width:thin;

}

::-webkit-scrollbar{

    width:10px;
    height:10px;

}

::-webkit-scrollbar-track{

    background:var(--bg-main);

}

::-webkit-scrollbar-thumb{

    background:var(--border-light);

    border:2px solid var(--bg-main);
    border-radius:var(--radius-pill);

}

::-webkit-scrollbar-thumb:hover{

    background:var(--accent-color);

}


/* ==========================================================================
   5. CONTENEDORES GLOBALES
   ========================================================================== */

.container{

    width:min(100%,var(--container));

    margin-inline:auto;

    padding-inline:20px;

}

.container-wide{

    width:min(100%,var(--container-wide));

    margin-inline:auto;

    padding-inline:20px;

}

.container-fluid{

    width:100%;

    padding-inline:20px;

}


/* ==========================================================================
   6. HEADER GLOBAL
   ========================================================================== */

.site-header{

    display:flex;

    justify-content:space-between;
    align-items:center;

    gap:16px;

    background:var(--bg-card);

    border-bottom:1px solid var(--border-color);

    padding:14px 22px;

    flex-shrink:0;

    position:relative;

    z-index:var(--z-sticky);

}

.site-logo{

    color:var(--accent-color);

    font-weight:700;

    font-size:.92rem;

    line-height:1.2;

    white-space:nowrap;

    transition:
        color var(--transition),
        opacity var(--transition),
        transform var(--transition);

}

.site-logo:hover{

    color:var(--accent-hover);

    transform:translateY(-1px);

}

.site-logo:active{

    transform:translateY(0);

}


/* ==========================================================================
   7. FOOTER GLOBAL
   ========================================================================== */

.site-footer{

    margin-top:auto;

    flex-shrink:0;

    background:var(--bg-card);

    border-top:1px solid var(--border-color);

    color:var(--text-muted);

    padding:24px 20px;

}


/* ==========================================================================
   8. SELECTOR DE IDIOMA
   ========================================================================== */

.lang-selector{

    display:flex;

    align-items:center;

    gap:6px;

    min-width:0;

    overflow-x:auto;

    white-space:nowrap;

    scrollbar-width:none;

    -webkit-overflow-scrolling:touch;

}

.lang-selector::-webkit-scrollbar{

    display:none;

}

.btn-lang{

    appearance:none;

    flex:0 0 auto;

    background:var(--bg-main);

    border:1px solid var(--border-color);

    color:var(--text-muted);

    border-radius:7px;

    padding:5px 10px;

    font-size:.74rem;

    font-weight:600;

    line-height:1.2;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition);

}

.btn-lang:hover{

    background:var(--bg-hover);

    border-color:var(--border-light);

    color:#fff;

    transform:translateY(-1px);

}

.btn-lang.active{

    background:var(--bg-hover);

    border-color:var(--accent-color);

    color:var(--accent-color);

    box-shadow:0 0 12px var(--accent-glow);

}


/* ==========================================================================
   9. ENLACES GLOBALES OPCIONALES
   ========================================================================== */

.link-accent{

    color:var(--accent-color);

    transition:color var(--transition);

}

.link-accent:hover{

    color:var(--accent-hover);

}

.link-muted{

    color:var(--text-muted);

    transition:color var(--transition);

}

.link-muted:hover{

    color:var(--text-main);

}

.link-underline{

    text-decoration:underline;

    text-decoration-color:var(--accent-border);
    text-decoration-thickness:1px;
    text-underline-offset:3px;

    transition:
        color var(--transition),
        text-decoration-color var(--transition);

}

.link-underline:hover{

    color:var(--accent-color);

    text-decoration-color:var(--accent-color);

}


/* ==========================================================================
   10. BOTONES GLOBALES OPCIONALES
   ========================================================================== */

.btn{

    appearance:none;

    display:inline-flex;

    align-items:center;
    justify-content:center;

    gap:8px;

    min-height:40px;

    padding:9px 15px;

    border:1px solid transparent;

    border-radius:var(--radius-md);

    font-size:.86rem;
    font-weight:700;

    line-height:1.2;

    text-align:center;

    cursor:pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition),
        box-shadow var(--transition),
        filter var(--transition);

}

.btn:hover{

    transform:translateY(-2px);

}

.btn:active{

    transform:translateY(0);

}

.btn-primary{

    background:var(--accent-color);

    border-color:var(--accent-color);

    color:#fff;

    box-shadow:0 8px 20px rgba(56,189,248,.16);

}

.btn-primary:hover{

    background:var(--accent-hover);

    border-color:var(--accent-hover);

    box-shadow:var(--shadow-glow);

}

.btn-secondary{

    background:var(--bg-card);

    border-color:var(--border-color);

    color:var(--text-main);

}

.btn-secondary:hover{

    background:var(--bg-hover);

    border-color:var(--accent-color);

}

.btn-ghost{

    background:transparent;

    border-color:transparent;

    color:var(--text-muted);

}

.btn-ghost:hover{

    background:var(--accent-subtle);

    color:var(--accent-color);

}

.btn-danger{

    background:var(--danger-subtle);

    border-color:rgba(239,68,68,.35);

    color:var(--danger);

}

.btn-danger:hover{

    border-color:var(--danger);

    box-shadow:0 0 18px rgba(239,68,68,.18);

}

.btn-icon{

    width:40px;
    height:40px;

    padding:0;

    border-radius:50%;

}


/* ==========================================================================
   11. FORMULARIOS GLOBALES OPCIONALES
   ========================================================================== */

.form-control{

    width:100%;

    min-height:42px;

    padding:9px 12px;

    background:var(--bg-main);

    border:1px solid var(--border-color);

    border-radius:var(--radius-md);

    color:var(--text-main);

    outline:none;

    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);

}

.form-control::placeholder{

    color:var(--text-dim);

}

.form-control:hover{

    border-color:var(--border-light);

}

.form-control:focus{

    background:var(--bg-soft);

    border-color:var(--accent-color);

    box-shadow:0 0 0 3px var(--accent-subtle);

}

textarea.form-control{

    min-height:120px;

    resize:vertical;

}

select.form-control{

    cursor:pointer;

}


/* ==========================================================================
   12. SUPERFICIES GLOBALES OPCIONALES
   ========================================================================== */

.surface{

    background:var(--bg-card);

    border:1px solid var(--border-color);

    border-radius:var(--radius-lg);

}

.surface-soft{

    background:var(--bg-soft);

    border:1px solid var(--border-color);

    border-radius:var(--radius-lg);

}

.surface-elevated{

    background:var(--bg-elevated);

    border:1px solid var(--border-light);

    border-radius:var(--radius-xl);

    box-shadow:var(--shadow);

}

.surface-hover{

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);

}

.surface-hover:hover{

    background:var(--bg-hover);

    border-color:var(--accent-border);

    transform:translateY(-3px);

    box-shadow:var(--shadow-hover);

}


/* ==========================================================================
   13. EFECTO GLASS OPCIONAL
   ========================================================================== */

.glass{

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.08),
            rgba(255,255,255,.025)
        );

    border:1px solid rgba(255,255,255,.12);

    box-shadow:var(--shadow);

    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);

}

.glow-accent{

    border-color:var(--accent-border);

    box-shadow:
        0 0 0 1px var(--accent-subtle),
        0 0 24px var(--accent-glow);

}


/* ==========================================================================
   14. DIVISORES
   ========================================================================== */

.divider{

    width:100%;

    height:1px;

    background:var(--border-color);

}

.divider-gradient{

    width:100%;

    height:1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--accent-color),
            transparent
        );

    opacity:.55;

}


/* ==========================================================================
   15. ESTADOS DE TEXTO
   ========================================================================== */

.text-main{

    color:var(--text-main);

}

.text-muted{

    color:var(--text-muted);

}

.text-dim{

    color:var(--text-dim);

}

.text-accent{

    color:var(--accent-color);

}

.text-success{

    color:var(--success);

}

.text-warning{

    color:var(--warning);

}

.text-danger{

    color:var(--danger);

}


/* ==========================================================================
   16. UTILIDADES DE ALINEACIÓN
   ========================================================================== */

.text-left{

    text-align:left;

}

.text-center{

    text-align:center;

}

.text-right{

    text-align:right;

}

.flex{

    display:flex;

}

.inline-flex{

    display:inline-flex;

}

.flex-column{

    flex-direction:column;

}

.flex-wrap{

    flex-wrap:wrap;

}

.items-start{

    align-items:flex-start;

}

.items-center{

    align-items:center;

}

.items-end{

    align-items:flex-end;

}

.justify-start{

    justify-content:flex-start;

}

.justify-center{

    justify-content:center;

}

.justify-between{

    justify-content:space-between;

}

.justify-end{

    justify-content:flex-end;

}

.gap-xs{

    gap:4px;

}

.gap-sm{

    gap:8px;

}

.gap-md{

    gap:12px;

}

.gap-lg{

    gap:20px;

}

.gap-xl{

    gap:30px;

}


/* ==========================================================================
   17. UTILIDADES DE TAMAÑO
   ========================================================================== */

.w-100{

    width:100%;

}

.h-100{

    height:100%;

}

.max-w-100{

    max-width:100%;

}

.min-w-0{

    min-width:0;

}

.flex-1{

    flex:1;

}


/* ==========================================================================
   18. UTILIDADES DE ESPACIADO
   ========================================================================== */

.mt-auto{

    margin-top:auto;

}

.mb-0{

    margin-bottom:0;

}

.mx-auto{

    margin-inline:auto;

}

.p-0{

    padding:0;

}


/* ==========================================================================
   19. VISIBILIDAD
   ========================================================================== */

.hidden{

    display:none !important;

}

.invisible{

    visibility:hidden !important;

}

.visible{

    visibility:visible !important;

}


/* ==========================================================================
   20. TEXTO ACCESIBLE SOLO PARA LECTORES DE PANTALLA
   ========================================================================== */

.sr-only{

    position:absolute !important;

    width:1px !important;
    height:1px !important;

    padding:0 !important;
    margin:-1px !important;

    overflow:hidden !important;

    clip:rect(0,0,0,0) !important;
    clip-path:inset(50%) !important;

    white-space:nowrap !important;

    border:0 !important;

}


/* ==========================================================================
   21. TRUNCADO DE TEXTO
   ========================================================================== */

.truncate{

    overflow:hidden;

    text-overflow:ellipsis;

    white-space:nowrap;

}

.line-clamp-2{

    display:-webkit-box;

    overflow:hidden;

    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;

}

.line-clamp-3{

    display:-webkit-box;

    overflow:hidden;

    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;

}


/* ==========================================================================
   22. FOCUS ACCESIBLE
   ========================================================================== */

:where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]
):focus-visible{

    outline:2px solid var(--accent-color);

    outline-offset:3px;

}

:where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]
):focus:not(:focus-visible){

    outline:none;

}


/* ==========================================================================
   23. ESTADO DE CARGA GLOBAL OPCIONAL
   ========================================================================== */

.loading-spinner{

    width:24px;
    height:24px;

    border:3px solid var(--border-color);
    border-top-color:var(--accent-color);

    border-radius:50%;

    animation:global-spin .8s linear infinite;

}

@keyframes global-spin{

    to{

        transform:rotate(360deg);

    }

}

.skeleton{

    position:relative;

    overflow:hidden;

    background:var(--bg-hover);

    border-radius:var(--radius-md);

}

.skeleton::after{

    content:"";

    position:absolute;

    inset:0;

    transform:translateX(-100%);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.07),
            transparent
        );

    animation:skeleton-slide 1.25s infinite;

}

@keyframes skeleton-slide{

    100%{

        transform:translateX(100%);

    }

}


/* ==========================================================================
   24. RTL
   ========================================================================== */

html[dir="rtl"]{

    text-align:right;

}

html[dir="rtl"] .site-header{

    flex-direction:row-reverse;

}


/* ==========================================================================
   25. RESPONSIVE GLOBAL
   ========================================================================== */

@media(max-width:768px){

    .container,
    .container-wide,
    .container-fluid{

        padding-inline:16px;

    }

    .site-header{

        padding:12px 16px;

    }

}

@media(max-width:480px){

    .container,
    .container-wide,
    .container-fluid{

        padding-inline:12px;

    }

    .site-header{

        align-items:flex-start;

        gap:10px;

        padding:12px;

    }

}


/* ==========================================================================
   26. MOVIMIENTO REDUCIDO
   ========================================================================== */

@media(prefers-reduced-motion:reduce){

    html{

        scroll-behavior:auto;

    }

    *,
    *::before,
    *::after{

        animation-duration:.01ms !important;

        animation-iteration-count:1 !important;

        transition-duration:.01ms !important;

        scroll-behavior:auto !important;

    }

}