/* ============================================================
   PALETA CORPORATIVA ZPRICE
============================================================ */
:root {
    --zp-bg: #F5F5F5;
    --zp-bg-alt: #FFFFFF;
    --zp-card-bg: #FFFFFF;
    --zp-text: #1A1A1A;
    --zp-text-muted: #666;
    --zp-border: #DDDDDD;

    --zp-primary: #FF5A2A;
    --zp-primary-dark: #E83E16;
}

/* ===========================
   DARK MODE (NUEVO)
=========================== */
[data-theme="dark"] {
    --zp-bg: #1F242A;        /* fondo base */
    --zp-bg-alt: #262C34;    /* elementos secundarios */
    --zp-card-bg: #2D333C;   /* cards */
    --zp-text: #ECECEC;      /* texto claro y suave */
    --zp-text-muted: #AEB5BF;
    --zp-border: #3A414C;
}

/* ============================================================
   APLICAR VARIABLES A LOS ELEMENTOS
============================================================ */

body {
    background-color: var(--zp-bg);
    color: var(--zp-text);
}

.card, .card-zp {
    background-color: var(--zp-card-bg) !important;
    border-color: var(--zp-border) !important;
}

.card-header {
    background-color: var(--zp-bg-alt) !important;
}

/* Sidebar */
.sidebar-zp {
    background-color: var(--zp-bg-alt) !important;
    border-right: 1px solid var(--zp-border);
}

.sidebar-zp .nav-link {
    color: var(--zp-text) !important;
}

.sidebar-zp .nav-link:hover {
    background-color: rgba(0,0,0,0.1);
}

/* Navbar */
.navbar-zp {
    background-color: var(--zp-card-bg) !important;
    border-bottom: 1px solid var(--zp-border);
}

/* Textos */
.text-muted {
    color: var(--zp-text-muted) !important;
}

/* Botones corporativos */
.btn-zp {
    background-color: var(--zp-primary);
    color: white;
}

.btn-zp:hover {
    background-color: var(--zp-primary-dark);
}

.btn-outline-zp {
    border-color: var(--zp-primary);
    color: var(--zp-primary);
}

.btn-outline-zp:hover {
    background-color: var(--zp-primary);
    color: white;
}

[data-theme="dark"] #themeToggleAuth {
    background-color: #222 !important;
    color: #fff !important;
    border: 1px solid #444 !important;
}

/* ======================================================
   ZPRICE TOAST NOTIFICATIONS
====================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-item {
    padding: 12px 16px;
    border-radius: 10px;
    min-width: 250px;
    max-width: 360px;
    position: relative;
    color: var(--zp-text);
    background: var(--zp-bg-card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastIn .25s ease-out;
}

.toast-item.toast-error { border-left: 5px solid #e74c3c; }
.toast-item.toast-success { border-left: 5px solid #2ecc71; }
.toast-item.toast-info { border-left: 5px solid #3498db; }
.toast-item.toast-warning { border-left: 5px solid #f1c40f; }

.toast-msg { font-size: 14px; }

.toast-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    color: var(--zp-text);
    font-size: 20px;
    cursor: pointer;
}

.toast-hide {
    opacity: 0;
    transform: translateY(-10px);
    transition: .3s ease-in-out;
}
.toast-item {
    pointer-events: auto !important;
}

.toast-item * {
    pointer-events: auto !important;
}

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



@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}
/* Barra inferior de progreso */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    opacity: 0.9;
    transform-origin: left;
    transform: scaleX(1);
}

/* Colores según tipo */
.toast-progress-success { background: #2ecc71; }
.toast-progress-error { background: #e74c3c; }
.toast-progress-warning { background: #f1c40f; }
.toast-progress-info { background: #3498db; }

/* Animación de reducción */
.toast-progress.animate {
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Responsivo */
@media (max-width: 600px) {
    .toast-container {
        left: 50%;
        transform: translateX(-50%);
        right: unset;
        top: 10px;
    }

    .toast {
        min-width: 260px;
        max-width: 90vw;
    }
}


/* =======================================
   LOADER OVERLAY GLOBAL
======================================= */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.55); /* opacidad */
    backdrop-filter: blur(3px); /* profesional */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity .25s ease-in-out;
}

.loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Caja del loader */
.loader-box {
    padding: 20px;
    border-radius: 16px;
    background: var(--zp-card-bg);
    box-shadow: 0 0 25px rgba(0,0,0,0.25);
    display: flex;
    gap: 10px;
}

/* Puntos animados */
.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--zp-primary);
    opacity: 0.6;
    animation: dot-anim 1s infinite ease-in-out;
}

.dot1 { animation-delay: 0s; }
.dot2 { animation-delay: 0.2s; }
.dot3 { animation-delay: 0.4s; }

/* Animación pulsante */
@keyframes dot-anim {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
}


.captcha-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;

    padding: 8px;
    border-radius: 10px;
}

/* Asegurar que NO se afecte el contenido interno del iframe */
.captcha-wrapper iframe {
    filter: none !important;
    background: transparent !important;
}


#captcha-error small {
    display: block;
    margin-top: 6px;
}
.captcha-wrapper {
    width: 100%;
}

.g-recaptcha {
    display: block !important;
    margin: 0 auto !important;
}

.text-danger {
    display: block;
}
