/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #fff;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    display: none;
}

.cookie-banner.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #b0b0b0;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: #667eea;
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cookie-btn-reject {
    background: transparent;
    color: #fff;
    border: 1px solid #444;
}

.cookie-btn-reject:hover {
    background: #333;
}

.cookie-btn-settings {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.cookie-btn-settings:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Modal de configuración de cookies */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    color: #333;
}

.cookie-modal-header {
    padding: 24px;
    border-bottom: 1px solid #eee;
}

.cookie-modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
}

.cookie-modal-header p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.cookie-modal-body {
    padding: 24px;
}

.cookie-category {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-category-header h4 {
    margin: 0;
    font-size: 1rem;
}

.cookie-category p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 48px;
    height: 26px;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

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

.cookie-modal-footer {
    padding: 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cookie-modal-footer .cookie-btn {
    color: #333;
}

.cookie-modal-footer .cookie-btn-accept {
    color: #fff;
}

/* Páginas legales */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.legal-page .last-updated {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.legal-page h2 {
    font-size: 1.3rem;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.legal-page h3 {
    font-size: 1.1rem;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #333;
}

.legal-page p, .legal-page li {
    line-height: 1.7;
    color: #444;
    margin-bottom: 12px;
}

.legal-page ul {
    padding-left: 24px;
}

.legal-page a {
    color: #667eea;
}

.legal-page .contact-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.legal-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    margin-bottom: 24px;
}

.legal-page .back-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    /* Banner de cookies móvil */
    .cookie-banner {
        padding: 16px;
    }

    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .cookie-banner-text {
        min-width: unset;
    }

    .cookie-banner-text h3 {
        font-size: 1rem;
        justify-content: center;
    }

    .cookie-banner-text p {
        font-size: 0.8rem;
    }

    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .cookie-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* Modal de cookies móvil */
    .cookie-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .cookie-modal-content {
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }

    .cookie-modal-header {
        padding: 16px;
    }

    .cookie-modal-header h2 {
        font-size: 1.1rem;
    }

    .cookie-modal-header p {
        font-size: 0.8rem;
    }

    .cookie-modal-body {
        padding: 16px;
    }

    .cookie-category {
        padding: 12px 0;
    }

    .cookie-category-header h4 {
        font-size: 0.9rem;
    }

    .cookie-category p {
        font-size: 0.8rem;
    }

    .cookie-toggle {
        width: 44px;
        height: 24px;
        flex-shrink: 0;
    }

    .cookie-toggle-slider:before {
        height: 18px;
        width: 18px;
    }

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

    .cookie-modal-footer {
        padding: 16px;
        flex-direction: column;
        gap: 8px;
    }

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

    /* Páginas legales móvil */
    .legal-page {
        padding: 24px 16px;
    }

    .legal-page h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .legal-page .last-updated {
        font-size: 0.8rem;
        margin-bottom: 24px;
    }

    .legal-page h2 {
        font-size: 1.15rem;
        margin-top: 24px;
        margin-bottom: 12px;
    }

    .legal-page h3 {
        font-size: 1rem;
        margin-top: 16px;
    }

    .legal-page p, .legal-page li {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .legal-page ul {
        padding-left: 20px;
    }

    .legal-page .contact-box {
        padding: 16px;
        margin: 16px 0;
    }

    .legal-page .contact-box p {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .legal-page .back-link {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    /* Tablas en páginas legales */
    .legal-page table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
    }

    .legal-page th, .legal-page td {
        padding: 8px !important;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-text h3 {
        font-size: 0.9rem;
    }

    .cookie-banner-text p {
        font-size: 0.75rem;
    }

    .legal-page h1 {
        font-size: 1.3rem;
    }

    .legal-page h2 {
        font-size: 1.05rem;
    }

    .legal-page p, .legal-page li {
        font-size: 0.85rem;
    }
}
