/* ==========================================================================
   PLAYMATIC CMP - COOKIE BANNER & PREFERENCES MODAL (RGPD / LSSI-CE COMPLIANT)
   ========================================================================== */

/* Banner Contenedor Principal (Nivel 1) */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: min(92%, 840px);
    background: rgba(10, 10, 18, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 242, 254, 0.08);
    z-index: 999999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
}

.cookie-banner.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.cookie-banner-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-banner-header svg {
    color: #00f2fe;
    flex-shrink: 0;
}

.cookie-banner-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.cookie-banner-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #cbd5e1;
    margin: 0;
}

.cookie-banner-text a {
    color: #00f2fe;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.cookie-banner-text a:hover {
    color: #70f7ff;
}

/* Tres Botones con IDÉNTICA jerarquía visual según directrices AEPD */
.cookie-banner-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 4px;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    background: transparent;
    color: #ffffff;
    min-height: 44px;
    box-sizing: border-box;
}

/* Botón Aceptar Todas */
.cookie-btn-accept {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.22) 0%, rgba(79, 172, 254, 0.28) 100%);
    border-color: rgba(0, 242, 254, 0.6);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 242, 254, 0.2);
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.35) 0%, rgba(79, 172, 254, 0.45) 100%);
    border-color: #00f2fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0, 242, 254, 0.35);
}

/* Botón Rechazar no esenciales */
.cookie-btn-reject {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Botón Configurar */
.cookie-btn-settings {
    background: rgba(123, 44, 191, 0.15);
    border-color: rgba(123, 44, 191, 0.5);
    color: #ffffff;
}

.cookie-btn-settings:hover {
    background: rgba(123, 44, 191, 0.28);
    border-color: #a855f7;
    transform: translateY(-2px);
}

/* ==========================================================================
   MODAL DE CONFIGURACIÓN DE COOKIES (Nivel 2)
   ========================================================================== */

.cookie-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.cookie-modal {
    background: #090a10;
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 20px;
    width: min(100%, 650px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 242, 254, 0.1);
    transform: scale(0.94);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    font-family: inherit;
    color: #ffffff;
}

.cookie-modal-backdrop.active .cookie-modal {
    transform: scale(1);
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.cookie-modal-title svg {
    color: #00f2fe;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.cookie-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.cookie-modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cookie-modal-intro {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

/* Categorías de Cookies */
.cookie-category-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s ease;
}

.cookie-category-item:hover {
    border-color: rgba(0, 242, 254, 0.2);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cookie-category-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.cookie-badge-required {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.cookie-category-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #94a3b8;
    margin: 0;
}

/* Toggle Switch Accesible */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.18);
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.cookie-switch input:checked + .cookie-slider {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    border-color: #00f2fe;
}

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

.cookie-switch input:disabled + .cookie-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Footer del Modal */
.cookie-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   BOTÓN FLOTANTE PERMANENTE DE ACCESO AL CMP (REVOCABILIDAD RGPD)
   ========================================================================== */

.cookie-floating-trigger {
    position: fixed;
    bottom: 22px;
    left: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(10, 10, 18, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: #00f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.15);
    z-index: 99998;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-floating-trigger:hover {
    transform: scale(1.1);
    border-color: #00f2fe;
    color: #ffffff;
    box-shadow: 0 6px 24px rgba(0, 242, 254, 0.4);
}

.cookie-floating-trigger svg {
    width: 22px;
    height: 22px;
}

/* Responsividad en Dispositivos Móviles */
@media (max-width: 768px) {
    .cookie-banner {
        width: calc(100% - 24px);
        bottom: 12px;
        padding: 20px 18px;
        border-radius: 16px;
    }

    .cookie-banner-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }

    .cookie-floating-trigger {
        bottom: 14px;
        left: 14px;
        width: 40px;
        height: 40px;
    }
}
