/* 1. Reset estricto y variables */
#aepd-cookie-banner,
#aepd-cookie-modal {
    font-family: 'Open Sans', Arial, sans-serif;
    box-sizing: border-box;
}

#aepd-cookie-banner *,
#aepd-cookie-modal * {
    box-sizing: border-box;
}

/* 2. Diseño del Banner Principal - AEPD LEGAL - como web oficial */
#aepd-cookie-banner {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    background-color: #cbd5e1 !important;
    /* Gris azulado medio (Slate-300) - Mucho más contraste */
    z-index: 5000 !important;
    border-top: 3px solid #1e293b !important;
    /* Borde superior reducido para móvil */
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.15) !important;
    /* Sombra más ligera */
    display: none;
}

.aepd-banner-container {
    position: relative !important;
    background-color: transparent !important;
    width: 100% !important;
    max-width: 1300px !important;
    margin: 0 auto !important;
    padding: 10px 8px !important;
    /* Padding muy reducido para móvil */
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

.aepd-banner-text {
    font-size: 11px !important;
    /* Texto reducido para móvil */
    line-height: 1.3 !important;
    text-align: center !important;
    color: #0f172a !important;
    /* Texto casi negro para legibilidad sobre gris */
    max-width: 950px !important;
    font-weight: 500 !important;
    /* Algo más de peso */
}

.aepd-banner-text a {
    color: #0056b3 !important;
    text-decoration: underline !important;
}

/* 3. SIMETRÍA TOTAL DE BOTONES (Requisito estricto AEPD) */
.aepd-banner-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    /* Espacio mínimo en móvil */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    justify-content: center !important;
}

.aepd-btn {
    flex: 1 !important;
    width: 100% !important;
    min-height: 30px !important;
    padding: 4px 6px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-align: center !important;
    background-color: #f8f9fa !important;
    color: #333333 !important;
    border: 1px solid #cccccc !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.aepd-btn:hover {
    background-color: #334155 !important;
    /* Cambio de color notable */
    color: #ffffff !important;
    border-color: #1e293b !important;
    transform: translateY(-2px) !important;
    /* Efecto de elevación */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* En PC/Tablet los 3 botones se ponen en la misma fila con tamaño idéntico */
@media (min-width: 992px) {
    .aepd-banner-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
        padding: 50px 40px !important;
        gap: 30px !important;
    }

    .aepd-banner-text {
        text-align: left !important;
        flex: 1 !important;
        margin-bottom: 0 !important;
        font-size: 15px !important;
    }

    .aepd-banner-buttons {
        flex-direction: row !important;
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
        justify-content: flex-end !important;
        gap: 15px !important;
    }

    .aepd-btn {
        width: auto !important;
        min-width: 150px !important;
        font-size: 13px !important;
        min-height: 40px !important;
        padding: 10px 15px !important;
    }
}

/* Tablets medianas y grandes */
@media (min-width: 768px) and (max-width: 991px) {
    .aepd-banner-container {
        padding: 30px 25px !important;
        gap: 20px !important;
    }

    .aepd-banner-text {
        font-size: 14px !important;
    }

    .aepd-banner-buttons {
        max-width: 100% !important;
        gap: 12px !important;
    }

    .aepd-btn {
        font-size: 12px !important;
    }
}

/* Smartphones y dispositivos pequeños */
@media (max-width: 767px) {
    #aepd-cookie-banner {
        border-top: 2px solid #1e293b !important;
    }

    .aepd-banner-container {
        padding: 9px 7px !important;
        gap: 7px !important;
    }

    .aepd-banner-text {
        font-size: 10px !important;
        line-height: 1.25 !important;
    }

    .aepd-banner-buttons {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        gap: 5px !important;
    }

    .aepd-btn {
        min-height: 30px !important;
        padding: 4px 6px !important;
        font-size: 9px !important;
    }
}

/* Smartphones muy pequeños (menos de 360px) */
@media (max-width: 359px) {
    .aepd-banner-container {
        padding: 7px 5px !important;
        gap: 5px !important;
    }

    .aepd-banner-text {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    .aepd-btn {
        min-height: 28px !important;
        padding: 3px 5px !important;
        font-size: 8px !important;
    }
}

/* 4. Diseño del Modal de Configuración */
#aepd-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.aepd-modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 550px;
    border-radius: 8px;
    padding: 12px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.aepd-modal-header h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 16px;
    color: #333;
}

.aepd-modal-header p {
    font-size: 12px !important;
    margin-bottom: 12px !important;
}

.aepd-cookie-option {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.aepd-cookie-option:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.aepd-opt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
}

.aepd-opt-header label {
    margin: 0;
    line-height: 1.2;
}

.aepd-opt-desc {
    margin: 0;
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

/* 5. Toggle Switches interactivos */
.aepd-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    flex-shrink: 0;
    margin: 0;
}

.aepd-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.aepd-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dddddd;
    transition: .3s;
    border-radius: 20px;
}

.aepd-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input[type=checkbox].aepd-chk {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
}

.aepd-toggle input:checked+.aepd-slider {
    background-color: #2c3e50;
}

.aepd-toggle input:checked+.aepd-slider:before {
    transform: translateX(20px);
}

.aepd-toggle input:disabled+.aepd-slider {
    background-color: #bbbbbb;
    cursor: not-allowed;
}

.aepd-modal-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: right;
    width: 100%;
}

@media (max-width: 600px) {
    .aepd-modal-content {
        padding: 10px;
        max-width: 100%;
        max-height: 75vh;
    }

    .aepd-modal-header h3 {
        font-size: 14px;
        margin-bottom: 3px;
    }

    .aepd-modal-header p {
        font-size: 11px !important;
        margin-bottom: 10px !important;
    }

    .aepd-cookie-option {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .aepd-opt-header {
        font-size: 12px;
        gap: 8px;
        margin-bottom: 3px;
    }

    .aepd-opt-desc {
        font-size: 10px;
        line-height: 1.3;
    }

    .aepd-modal-footer {
        margin-top: 8px;
        padding-top: 8px;
    }

    .aepd-btn {
        font-size: 11px !important;
        min-height: 32px !important;
        padding: 6px 10px !important;
    }
}

/* Smartphones muy pequeños */
@media (max-width: 380px) {
    .aepd-modal-content {
        padding: 8px;
        max-height: 70vh;
    }

    .aepd-modal-header h3 {
        font-size: 13px;
    }

    .aepd-modal-header p {
        font-size: 10px !important;
    }

    .aepd-cookie-option {
        margin-bottom: 6px;
        padding-bottom: 6px;
    }

    .aepd-opt-header {
        font-size: 11px;
    }

    .aepd-opt-desc {
        font-size: 9px;
    }

    .aepd-btn {
        font-size: 10px !important;
        min-height: 30px !important;
        padding: 5px 8px !important;
    }
}