/* ==========================================================================
   CONFIGURACIÓN PREMIUM DE COOKIES (APARIENCIA EN POSITIVO Y COMPLETA)
   ========================================================================== */

/* 1. Botón Flotante de la Galleta */
.cookie-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 48px;
    height: 48px;
    background-color: var(--azul-petroleo); /* Fondo oscuro contrastado para el botón */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--beige-arena);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999999 !important;
}

/* Animación de entrada de la galleta en la Home (Segundo 4) */
.con-animacion .cookie-btn {
    opacity: 0;
    transform: scale(0.6);
    animation: cookieBtnFadeIn 2.5s 4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cookieBtnFadeIn {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

/* Estado del botón si las cookies ya fueron guardadas */
.cookie-btn.cookie-guardada {
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.con-animacion .cookie-btn.cookie-guardada {
    animation: cookieBtnFadeInGuardada 2.5s 4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cookieBtnFadeInGuardada {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 0.4; transform: scale(1); }
}

.cookie-btn:hover,
.con-animacion .cookie-btn:hover {
    transform: scale(1.1) !important;
    opacity: 1 !important;
}

.cookie-icon {
    width: 24px;
    height: 24px;
}

/* 2. El Panel de Configuración (Modo Positivo - Lienzo Claro) */
.cookie-panel {
    position: fixed;
    bottom: 85px; /* Se posiciona encima de la galleta */
    right: 25px;
    width: 320px;
    background-color: #ffffff;
    color: #1f2937;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 10000000 !important;
    font-family: 'Lato', sans-serif;
    
    /* Estado inicial por defecto en páginas internas */
    display: none; 
}

/* ==========================================================================
   DESPLIEGUE AUTOMÁTICO DEL PANEL COMPLETO (HOME CON ANIMACIÓN)
   ========================================================================== */
.con-animacion .cookie-panel.auto-open {
    display: block !important;
    opacity: 0;
    transform: translateY(15px);
    animation: panelCompletoFadeIn 1.5s 4.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes panelCompletoFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Títulos y textos internos */
.cookie-panel h3 {
    font-size: 1.15rem;
    color: #111827 !important;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.cookie-panel .cookie-desc {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.4;
    margin: 0 0 16px 0;
}

/* Opciones (Checkboxes estilizados) */
.cookie-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    user-select: none;
}

.cookie-option input[type="checkbox"] {
    accent-color: #111827;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.cookie-option input[disabled] + span {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Botones de acción */
.cookie-save-btn {
    width: 100%;
    background-color: #111827;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-save-btn:hover {
    background-color: #374151;
}

/* Estilización del botón secundario "Guardar config." */
#cookie-save {
    background-color: transparent;
    border: 1px solid #111827;
    color: #111827;
}
#cookie-save:hover {
    background-color: #f9fafb;
}

/* ==========================================================================
   ENTORNOS INTERNOS Y MULTIPANTALLA
   ========================================================================== */
html:not(.con-animacion) #cookie-btn {
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
}

html:not(.con-animacion) #cookie-btn.cookie-guardada {
    opacity: 0.4 !important;
}

@media (max-width: 400px) {
    .cookie-panel {
        right: 15px !important;
        left: 15px !important;
        width: auto !important;
        bottom: 80px !important;
    }
    .cookie-btn {
        right: 15px !important;
        bottom: 20px !important;
    }
}