/**
 * Estilos para el modal de consentimiento de cookies
 * Proporciones y diseño premium basados en el nuevo requerimiento
 */

/* Overlay que cubre toda la página */
.cookie-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
}

.cookie-overlay.active {
    display: block;
}

#cookie-modal {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh; /* Asegura que no se pase de la pantalla */
    overflow-y: auto; /* Permite scroll si el contenido es largo */
}

/* Contenido del modal */
.cookie-modal-content {
    background-color: #fff;
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 35px 50px 25px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Fila principal - Icono + Texto + Botones */
.cookie-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    width: 100%;
}

/* Sección izquierda: Icono + Texto */
.cookie-left-section {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    width: 50%;
    flex: none;
}

/* Columna icono */
.cookie-icon-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.cookie-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-top: 5px; /* Pequeño ajuste para alinear visualmente con la primera línea del título */
}

/* Columna texto */
.cookie-text-col {
    flex-grow: 1;
}

.cookie-heading {
    font-size: 24px;
    font-weight: 700;
    color: #273881;
    margin: 0 0 10px 0;
    font-family: 'Montserrat', sans-serif;
}

.cookie-desc {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-family: 'Roboto', sans-serif;
    text-align: left;
    max-width: 600px;
}

/* Columna botones */
.cookie-buttons-col {
    display: flex;
    gap: 15px;
    align-items: center;
    width: 50%;
    justify-content: flex-end;
}

/* Estilo base para botones */
.cookie-modal-content .btn {
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

/* Botón Configurar - Outline Azul */
.cookie-btn-config {
    background-color: transparent !important;
    border: 2px solid #273881 !important;
    color: #273881 !important;
}

.cookie-btn-config:hover {
    background-color: #273881 !important;
    color: #fff !important;
}

/* Botón Aceptar Básicas - Gris Sólido */
.cookie-btn-basic {
    background-color: #E2E4EB !important;
    color: #636779 !important;
}

.cookie-btn-basic:hover {
    background-color: #d1d4de !important;
}

/* Botón Aceptar Todas - Naranja con Sombra */
.cookie-btn-all {
    background-color: #FF8800 !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(255, 136, 0, 0.3);
}

.cookie-btn-all:hover {
    background-color: #e67a00 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 136, 0, 0.4);
}

/* Footer del Modal */
.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0; /* Quitado como se solicitó */
    padding-top: 15px;
    border-top: none;
    width: 100%;
}

.cookie-protection {
    color: #999;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-protection .dot {
    color: #db7125;
    font-size: 18px;
}

/* Panel de configuración Rediseñado */
.cookie-settings {
    display: none;
    overflow: hidden;
    border-radius: 30px;
    margin-top: 15px;
    border: none !important;
    background-color: transparent !important;
}

.cookie-settings-container {
    display: flex;
    background-color: #f4f6f9;
    min-height: 500px;
    border: none !important;
}

/* Sidebar Izquierda */
.cookie-settings-sidebar {
    background-color: #001F4D;
    color: #fff;
    width: 35%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    border: none !important;
}

.sidebar-logo {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff !important;
}

.sidebar-tagline {
    font-size: 14px;
    opacity: 0.7;
    margin: 5px 0 0 0;
    font-family: 'Roboto', sans-serif;
    color: #ffffff !important;
}

.sidebar-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff !important;
}

.sidebar-desc {
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.8;
    font-family: 'Roboto', sans-serif;
}

.sidebar-bottom {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #FF8800;
    border-radius: 50%;
    display: inline-block;
}

/* Contenido Derecha */
.cookie-settings-content {
    width: 65%;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
}

.settings-title {
    font-size: 26px;
    font-weight: 700;
    color: #001F4D;
    margin: 0 0 5px 0;
    font-family: 'Montserrat', sans-serif;
}

.settings-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 30px;
    font-family: 'Roboto', sans-serif;
}

.cookie-cards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.cookie-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.cookie-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: transparent !important;
}

.card-icon-essential,
.card-icon-analytics,
.card-icon-advertising { background-color: transparent !important; }

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-info {
    flex-grow: 1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #001F4D;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

.badge-mandatory {
    font-size: 10px;
    font-weight: 700;
    background-color: #e2e4eb;
    color: #636779;
    padding: 2px 8px;
    border-radius: 4px;
}

.card-desc {
    font-size: 14px;
    color: #777;
    line-height: 1.4;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    text-align: left;
}

/* Custom Switches */
.card-toggle {
    flex-shrink: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #FF8800;
}

input:disabled + .slider {
    background-color: #9db2cc;
    cursor: not-allowed;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Settings Footer Buttons */
.settings-footer-actions {
    margin-top: 35px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.settings-footer-actions .btn-settings-secondary {
    background-color: #eef1f6;
    color: #001F4D;
    border: none;
    padding: 12px 25px;
    border-radius: 15px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.2s;
}

.settings-footer-actions .btn-settings-secondary:hover {
    background-color: #e2e8f0;
}

.settings-footer-actions .btn-settings-primary {
    background-color: #FF8800;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 15px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 15px rgba(255, 136, 0, 0.3);
    transition: all 0.2s;
}

.settings-footer-actions .btn-settings-primary:hover {
    background-color: #e67a00;
    transform: translateY(-2px);
}

/* Responsive Refined */
@media (max-width: 991px) {
    .cookie-settings-container {
        flex-direction: column;
    }
    .cookie-settings-sidebar {
        width: 100%;
        padding: 30px 25px;
        min-height: auto;
        border-bottom-left-radius: 0;
        border-top-right-radius: 30px;
        text-align: center;
        gap: 15px;
        border-top-left-radius: 30px;
    }
    .cookie-settings-content {
        width: 100%;
        padding: 30px 20px;
    }
    .sidebar-title {
        font-size: 24px;
    }
    .sidebar-desc {
        font-size: 14px;
    }
    .cookie-settings-sidebar br {
        display: none;
    }
}

@media (max-width: 767px) {
    #cookie-modal {
        bottom: 10px;
        width: 98%;
        max-height: 95vh;
    }
    
    .cookie-modal-content {
        padding: 25px 20px;
        border-radius: 25px;
    }
    
    .cookie-main-row {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-left-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cookie-buttons-col {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-buttons-col .btn {
        width: 100%;
    }
    
    /* Settings específicas de móvil */
    .settings-title {
        font-size: 20px;
        text-align: center;
    }
    .settings-subtitle {
        text-align: center;
        font-size: 13px;
    }
    
    .cookie-card {
        padding: 15px;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
    }
    
    .card-info {
        width: calc(100% - 60px);
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-desc {
        width: 100%;
        margin-top: 10px;
        font-size: 13px;
    }
    
    .settings-footer-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .settings-footer-actions button {
        width: 100%;
    }
    
    .sidebar-logo {
        font-size: 22px;
    }
    
    .sidebar-tagline {
        font-size: 12px;
    }
    
    .cookie-modal-footer {
        justify-content: center;
        text-align: center;
    }
}

/* Popup de información de cookies */
.cookie-info-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    overflow-y: auto;
    padding: 20px;
}

.cookie-info-popup.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.cookie-info-content {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-info-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
}

.cookie-info-close:hover {
    color: #333;
}

.cookie-info-title {
    color: #1a4c7c;
    margin-bottom: 20px;
    font-size: 22px;
    padding-right: 40px;
}

.cookie-info-text {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.cookie-info-text p {
    margin-bottom: 15px;
}

.cookie-info-text a {
    color: #1a4c7c;
    text-decoration: underline;
}

.cookie-info-link {
    color: #1a4c7c;
    font-size: 13px;
    text-decoration: underline;
    margin-top: 8px;
    display: inline-block;
    cursor: pointer;
}

.cookie-info-link:hover {
    color: #2d6aa3;
}

.cookie-info-link-light {
    color: #fff;
    font-size: 13px;
    text-decoration: underline;
    margin-top: 8px;
    display: inline-block;
    cursor: pointer;
}

.cookie-info-link-light:hover {
    color: #ccc;
}