/* 
 * Sistema de Cookies - Facoadicción 2026
 * Colores de marca: #B11A1A (Rojo), #0D3049 (Azul), #669BBB (Acento)
 * Versión: 1.0
 */

/* ===== BANNER DE COOKIES ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #B11A1A 0%, #0D3049 100%);
    color: white;
    padding: 24px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h3 {
    font-size: 22px;
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-icon {
    font-size: 28px;
}

.cookie-text p {
    font-size: 15px;
    line-height: 1.7;
    opacity: 0.95;
}

.cookie-text a {
    color: #FFF;
    text-decoration: underline;
    font-weight: 600;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.cookie-text a:hover {
    opacity: 0.9;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cookie-btn-accept {
    background: white;
    color: #B11A1A;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.4);
}

.cookie-btn-settings {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cookie-btn-settings:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background: rgba(0, 0, 0, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-reject:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* ===== MODAL DE PREFERENCIAS ===== */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.cookie-modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: scale(0.9) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.cookie-modal {
    background: white;
    border-radius: 20px;
    max-width: 750px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cookie-modal-header {
    background: linear-gradient(135deg, #B11A1A 0%, #0D3049 100%);
    color: white;
    padding: 32px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.cookie-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #669BBB, #B11A1A, #0D3049);
}

.cookie-modal-header h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-modal-header p {
    font-size: 15px;
    opacity: 0.95;
    line-height: 1.6;
}

.cookie-modal-body {
    padding: 32px;
}

.cookie-category {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 2px solid #f1f3f5;
    transition: all 0.3s ease;
}

.cookie-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cookie-category:hover {
    background: #f8f9fa;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 12px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-necessary {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
}

.icon-performance {
    background: linear-gradient(135deg, #d1f4e0 0%, #a3e4c4 100%);
    color: #0ca678;
}

.icon-functional {
    background: linear-gradient(135deg, #cfe2ff 0%, #9ec5fe 100%);
    color: #0d6efd;
}

.icon-marketing {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #cc8800;
}

.cookie-category-title h3 {
    font-size: 19px;
    font-weight: 700;
    color: #0D3049;
    margin: 0;
}

.cookie-badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-badge-required {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
}

.cookie-badge-optional {
    background: linear-gradient(135deg, #cfe2ff 0%, #9ec5fe 100%);
    color: #0d6efd;
}

.cookie-category-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 10px;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    width: 58px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 32px;
    transition: 0.4s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.4s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #B11A1A 0%, #0D3049 100%);
    box-shadow: 0 0 12px rgba(177, 26, 26, 0.4);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:disabled + .toggle-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

.toggle-switch:hover .toggle-slider:not(input:disabled + .toggle-slider) {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

/* ===== FOOTER DEL MODAL ===== */
.cookie-modal-footer {
    padding: 24px 32px;
    background: linear-gradient(to top, #f8f9fa 0%, #ffffff 100%);
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    border-top: 2px solid #e9ecef;
}

.cookie-modal-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cookie-modal-btn-primary {
    background: linear-gradient(135deg, #B11A1A 0%, #8E1515 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(177, 26, 26, 0.3);
}

.cookie-modal-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(177, 26, 26, 0.4);
}

.cookie-modal-btn-secondary {
    background: white;
    color: #0D3049;
    border: 2px solid #0D3049;
}

.cookie-modal-btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

/* ===== NOTIFICACIONES ===== */
.toast-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, #0D3049 0%, #0A263A 100%);
    color: white;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-notification.success {
    background: linear-gradient(135deg, #0ca678 0%, #099268 100%);
}

.toast-notification.warning {
    background: linear-gradient(135deg, #cc8800 0%, #b37700 100%);
}

.toast-notification i {
    font-size: 24px;
}

.toast-notification .toast-close {
    margin-left: auto;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.toast-notification .toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.cookie-modal::-webkit-scrollbar {
    width: 10px;
}

.cookie-modal::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 0 20px 20px 0;
}

.cookie-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #B11A1A 0%, #0D3049 100%);
    border-radius: 10px;
}

.cookie-modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8E1515 0%, #0A263A 100%);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-buttons {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        justify-content: center;
    }

    .cookie-modal {
        margin: 10px;
        border-radius: 16px;
    }

    .cookie-modal-header {
        padding: 24px;
        border-radius: 16px 16px 0 0;
    }

    .cookie-modal-body {
        padding: 24px;
    }

    .cookie-modal-footer {
        flex-direction: column;
        padding: 20px 24px;
    }

    .cookie-modal-btn {
        width: 100%;
        justify-content: center;
    }

    .toast-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}