/* =========================================================
   COOKIE BANNER - GDPR Compliant
   ========================================================= */

/* Overlay oscuro cuando el panel está abierto */
.cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 77, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Banner principal (parte inferior) */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 4px solid #ff6b35;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 28px;
}

.cookie-banner-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.cookie-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.cookie-banner-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b1f4d;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.cookie-banner-desc {
    font-size: 0.92rem;
    color: #3b4660;
    line-height: 1.6;
    margin-bottom: 0;
}

.cookie-banner-desc a {
    color: #1e4fd8;
    text-decoration: underline;
}

.cookie-banner-desc a:hover {
    color: #0b1f4d;
}

/* Botones del banner */
.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.cookie-btn {
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cookie-btn:focus {
    outline: 3px solid #1e4fd8;
    outline-offset: 2px;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.cookie-btn-secondary {
    background: #f4f6fb;
    color: #0b1f4d;
    border: 1px solid #d6dcec;
}

.cookie-btn-secondary:hover {
    background: #eef1f8;
}

.cookie-btn-tertiary {
    background: transparent;
    color: #6b7590;
    border: 1px solid #d6dcec;
}

.cookie-btn-tertiary:hover {
    background: #f8faff;
    color: #0b1f4d;
}

/* Panel de configuración detallada */
.cookie-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: #fff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.cookie-panel.show {
    transform: translateX(0);
}

.cookie-panel-header {
    background: linear-gradient(135deg, #0b1f4d, #12326f);
    color: #fff;
    padding: 24px 28px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cookie-panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.cookie-panel-subtitle {
    font-size: 0.92rem;
    opacity: 0.9;
}

.cookie-panel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-panel-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.cookie-panel-body {
    padding: 24px 28px;
}

.cookie-category {
    background: #f8faff;
    border: 1px solid #e6eaf3;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-category-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0b1f4d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-desc {
    font-size: 0.88rem;
    color: #6b7590;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d6dcec;
    border-radius: 26px;
    transition: 0.3s;
}

.cookie-toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(22px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-category-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e6eaf3;
    font-size: 0.82rem;
    color: #6b7590;
}

.cookie-category-list strong {
    color: #0b1f4d;
}

/* Panel footer con botones */
.cookie-panel-footer {
    padding: 20px 28px;
    border-top: 1px solid #eef1f8;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: #fff;
}

.cookie-panel-footer .cookie-btn {
    width: 100%;
    justify-content: center;
}

/* Botón flotante para reabrir configuración */
.cookie-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #0b1f4d;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9990;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
}

.cookie-fab:hover {
    transform: scale(1.1);
    background: #1e4fd8;
}

.cookie-fab.show {
    display: flex;
}

/* Responsive */
@media (max-width: 600px) {
    .cookie-banner-inner {
        padding: 20px;
    }
    
    .cookie-banner-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-banner-actions .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-panel {
        max-width: 100%;
    }
    
    .cookie-panel-body,
    .cookie-panel-header,
    .cookie-panel-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Animación de entrada */
@keyframes cookieSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-banner.show {
    animation: cookieSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}