/* assets/css/cookies.css */

/* ==========================================
   1. EL BANNER PRINCIPAL
   ========================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 20px 0;
    transition: transform 0.3s ease-in-out;
}

.cookie-banner.hidden {
    display: none;
    transform: translateY(100%);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-family: Arial, sans-serif;
    /* En PC, evitamos flex-wrap en el contenedor principal para forzar una sola línea si es posible */
}

.cookie-content h3 {
    margin: 0;
    font-size: 1.2em;
    white-space: nowrap; /* Evita que el título se parta en dos líneas */
}

.cookie-content p {
    margin: 0;
    color: #555;
    font-size: 0.9em;
    flex: 1; /* Ocupa el espacio restante sin forzar saltos extraños */
}

/* Botones del Banner */
.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* Evita que los botones se encojan y se deformen */
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8em;
    transition: background-color 0.2s;
    text-align: center; /* Asegura texto centrado en móvil */
}

/* Colores de Botones */
.btn-primary { background-color: var(--secondary-color, #00796b); color: #fff; } /* #fca311 */
.btn-primary:hover { background-color: var(--primary-color, #004d40); } /* #e8920a */

.btn-secondary { background-color: #14213d; color: #fff; }
.btn-secondary:hover { background-color: #1f315a; }

.btn-outline { background-color: transparent; border: 2px solid #555; color: #555; }
.btn-outline:hover { background-color: #f5f5f5; }


/* ==========================================
   2. EL MODAL GRANULAR
   ========================================== */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.cookie-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.cookie-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
    animation: modalSlideIn 0.3s ease-out;
}

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

.cookie-modal-content h3 {
    margin-top: 0;
    color: #14213d;
    font-size: 1.4em;
}

.cookie-modal-content p {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 25px;
}

/* Opciones Granulares */
.cookie-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.cookie-option {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.cookie-option:hover { background-color: #f9f9f9; }

/* Custom Checkboxes */
.cookie-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 4px;
    margin-top: 2px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0; /* Evita que el checkbox se deforme */
    transition: all 0.2s;
}

.cookie-option input[type="checkbox"]:checked {
    background-color: #fca311;
    border-color: #fca311;
}

.cookie-option input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

.cookie-option input[type="checkbox"]:checked::after { opacity: 1; }
.cookie-option input[type="checkbox"]:disabled {
    background-color: #ccc;
    border-color: #aaa;
    cursor: not-allowed;
}

.option-text {
    display: flex;
    flex-direction: column;
}

.option-title { font-weight: bold; color: #14213d; font-size: 1em; }
.option-desc { color: #777; font-size: 0.85em; line-height: 1.4; }

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================
   3. RESPONSIVE (Tablets y Pantallas Medianas)
   ========================================== */
@media (max-width: 1024px) {
    .cookie-content {
        flex-direction: column; /* Pasamos a columna */
        align-items: stretch; /* Estiramos para ocupar el ancho */
        text-align: center;
        gap: 15px;
    }
    
    .cookie-content h3 {
        white-space: normal; /* Permitimos que el título salte de línea si hace falta */
    }

    .cookie-buttons {
        justify-content: center; /* Centramos los botones en tablet */
    }
}

/* ==========================================
   4. RESPONSIVE (Móviles)
   ========================================== */
@media (max-width: 600px) {
    .cookie-banner {
        padding: 15px 0; /* Un poco menos de padding general en móvil */
    }

    .cookie-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px; /* Reducimos ligeramente el gap entre botones */
    }

    .cookie-buttons .btn {
        width: 100%;
    }

    /* Ajustes Modal en Móvil */
    .cookie-modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-buttons {
        flex-direction: column-reverse; /* El botón cerrar abajo */
        width: 100%;
        gap: 10px;
    }

    .modal-buttons .btn {
        width: 100%;
    }
}