/* 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;
}

/* ===== MOBILE-FIRST APPROACH ===== */
/* 2. Diseño del Banner Principal - MOBILE FIRST */
#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;
    z-index: 5000 !important;
    border-top: 3px solid #1e293b !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15) !important;
    display: none;
    max-height: 50vh !important;
    overflow-y: auto !important;
}

.aepd-banner-container {
    position: relative !important;
    background-color: transparent !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 12px 12px !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

.aepd-banner-text {
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    color: #0f172a !important;
    max-width: 100% !important;
    font-weight: 500 !important;
    width: 100% !important;
    word-wrap: break-word !important;
}

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

/* 3. BOTONES MOBILE-FIRST: Apilados verticalmente */
.aepd-banner-buttons {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 280px !important;
    justify-content: center !important;
}

.aepd-btn {
    width: 100% !important;
    min-height: 36px !important;
    padding: 8px 12px !important;
    font-size: 12px !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;
    white-space: nowrap !important;
}

.aepd-btn:active {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* ===== TABLET (600px+) ===== */
@media (min-width: 600px) {
    .aepd-banner-container {
        padding: 14px 14px !important;
        gap: 10px !important;
    }

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

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

/* ===== DESKTOP (992px+) ===== */
@media (min-width: 992px) {
    #aepd-cookie-banner {
        max-height: none !important;
    }

    .aepd-banner-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
        padding: 20px 30px !important;
        gap: 20px !important;
    }

    .aepd-banner-text {
        text-align: left !important;
        flex: 1 !important;
        font-size: 13px !important;
    }

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

    .aepd-btn {
        width: auto !important;
        min-width: 130px !important;
        min-height: 38px !important;
        padding: 8px 16px !important;
        font-size: 12px !important;
    }

    .aepd-btn:hover {
        background-color: #334155 !important;
        color: #ffffff !important;
        border-color: #1e293b !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    }
}

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

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

.aepd-modal-header h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.aepd-modal-header p {
    font-size: 12px !important;
    margin: 0 0 12px 0 !important;
    color: #666;
}

.aepd-cookie-option {
    margin-bottom: 12px;
    padding-bottom: 12px;
    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: 10px;
    font-weight: 600;
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
}

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

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

/* Toggle Switches */
.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: 12px;
    border-top: 1px solid #eee;
    text-align: right;
    width: 100%;
}

/* ===== TABLET (600px+) ===== */
@media (min-width: 600px) {
    #aepd-cookie-modal {
        align-items: center;
    }

    .aepd-modal-content {
        max-width: 500px;
        border-radius: 8px;
        padding: 20px;
    }

    .aepd-modal-header h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

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

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

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

    .aepd-opt-desc {
        font-size: 12px;
        line-height: 1.5;
    }

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

/* ===== DESKTOP (992px+) ===== */
@media (min-width: 992px) {
    .aepd-modal-content {
        max-width: 550px;
        max-height: 90vh;
    }

    .aepd-modal-header h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

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

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

    .aepd-opt-desc {
        font-size: 13px;
        line-height: 1.5;
    }
}