/**
 * Estilos para el Banner de Cookies
 * Diseño completamente rediseñado basado en la imagen proporcionada
 */

/* Contenedor principal del banner */
#cookie-banner,
#cookie-banner.cookie-banner {
    position: fixed;
    bottom: 1%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 70%;
    max-width: 800px;
    min-width: 600px;
    background: #E8F0F8;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    visibility: visible;
    opacity: 1;
    padding: 0;
    margin: 0;
    border: none;
    animation: fadeInScale 0.4s ease-out;
}

/* Estado oculto del banner */
#cookie-banner.hidden,
#cookie-banner[style*="display: none"] {
    display: none;
}

/* Animación de entrada */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Contenido interno del banner */
#cookie-banner .cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 24px 32px;
    gap: 24px;
}

/* Sección izquierda (icono + texto) */
#cookie-banner .cookie-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

/* Icono de cookie */
#cookie-banner .cookie-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cookie-banner .cookie-icon svg {
    width: 100%;
    height: 100%;
}

/* Contenedor de texto */
#cookie-banner .cookie-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

/* Texto principal */
#cookie-banner .cookie-text-main {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #002266;
    line-height: 1.3;
    margin: 0;
}

/* Texto secundario */
#cookie-banner .cookie-text-sub {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #002266;
    line-height: 1.4;
    margin: 0;
}

/* Contenedor de botones */
#cookie-banner .cookie-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Estilos base para todos los botones */
#cookie-banner .cookie-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    white-space: nowrap;
}

/* Botón Rechazar */
#cookie-banner .cookie-btn-decline {
    background: #FFFFFF;
    color: #002266;
}

#cookie-banner .cookie-btn-decline:hover {
    background: #F8FAFC;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.15);
}

/* Botón Aceptar */
.cookie-btn-accept {
    background: #1E3A8A;
    color: #FFFFFF;
}

.cookie-btn-accept:hover {
    background: #1E40AF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

/* Botón Política de cookies */
.cookie-btn-policy {
    background: #1E3A8A;
    color: #FFFFFF;
}

.cookie-btn-policy:hover {
    background: #1E40AF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

/* Estados de focus para accesibilidad */
.cookie-btn:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.cookie-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Responsividad para tablets */
@media (max-width: 768px) {
    #cookie-banner,
    #cookie-banner.cookie-banner {
        width: 85%;
        min-width: 500px;
    }
    
    .cookie-content {
        padding: 20px 24px;
        gap: 20px;
    }
    
    .cookie-left {
        gap: 12px;
    }
    
    .cookie-icon {
        width: 20px;
        height: 20px;
    }
    
    .cookie-text-main {
        font-size: 15px;
    }
    
    .cookie-text-sub {
        font-size: 13px;
    }
    
    .cookie-buttons {
        gap: 10px;
    }
    
    .cookie-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 36px;
    }
}

/* Responsividad para móviles */
@media (max-width: 600px) {
    #cookie-banner,
    #cookie-banner.cookie-banner {
        width: 90%;
        min-width: 320px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .cookie-content {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        text-align: center;
    }
    
    .cookie-left {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .cookie-icon {
        width: 24px;
        height: 24px;
    }
    
    .cookie-text-main {
        font-size: 16px;
    }
    
    .cookie-text-sub {
        font-size: 14px;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 100px;
        max-width: 140px;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Responsividad para móviles muy pequeños */
@media (max-width: 480px) {
    #cookie-banner,
    #cookie-banner.cookie-banner {
        width: 95%;
        min-width: 280px;
    }
    
    .cookie-content {
        padding: 16px;
        gap: 14px;
    }
    
    .cookie-text-main {
        font-size: 15px;
    }
    
    .cookie-text-sub {
        font-size: 13px;
    }
    
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .cookie-btn {
        width: 100%;
        max-width: none;
        padding: 12px;
        font-size: 14px;
    }
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    #cookie-banner,
    #cookie-banner.cookie-banner {
        background: #FFFFFF;
        border: 2px solid #000000;
    }
    
    .cookie-text-main,
    .cookie-text-sub {
        color: #000000;
    }
    
    .cookie-btn-decline {
        background: #FFFFFF;
        color: #000000;
        border: 2px solid #000000;
    }
    
    .cookie-btn-accept,
    .cookie-btn-policy {
        background: #000000;
        color: #FFFFFF;
    }
}

/* Reducción de movimiento para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {
    #cookie-banner,
    #cookie-banner.cookie-banner {
        animation: none;
    }
    
    .cookie-btn {
        transition: none;
    }
    
    .cookie-btn:hover {
        transform: none;
    }
}

/* Animación de salida */
.cookie-banner.hiding {
    animation: fadeOutScale 0.3s ease-in forwards;
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}
