/* ==========================================
   Estilos para Modal de Cookies Legal
   ========================================== */

/* Banner de cookies en la parte inferior */
.cookies-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    padding: 25px;
    z-index: 9999;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.3s ease-in-out;
    border-top: 3px solid #3498db;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookies-banner-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cookies-banner-text {
    flex: 1;
    min-width: 250px;
}

.cookies-banner-text h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ecf0f1;
    letter-spacing: 0.5px;
}

.cookies-banner-text p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    color: #d0d0d0;
}

.cookies-more-info {
    color: #3498db;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.2s ease;
    cursor: pointer;
    display: inline-block;
}

.cookies-more-info:hover,
.cookies-more-info:focus {
    color: #2980b9;
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.cookies-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 250px;
}

.cookies-banner-actions button {
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-accept-all,
.btn-settings {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

.btn-accept-all:hover,
.btn-settings:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
}

.btn-accept-all:focus,
.btn-settings:focus {
    outline: 3px solid #ecf0f1;
    outline-offset: 2px;
}

.btn-reject-all {
    background-color: transparent;
    border-color: #bdc3c7;
    color: #bdc3c7;
}

.btn-reject-all:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ecf0f1;
    color: #ecf0f1;
    transform: translateY(-1px);
}

.btn-reject-all:focus {
    outline: 3px solid #ecf0f1;
    outline-offset: 2px;
}

/* Modal de cookies */
#cookiesModal .modal-content {
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
}

#cookiesModal .modal-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    border-bottom: 3px solid #3498db;
    border-radius: 10px 10px 0 0;
    padding: 25px 30px;
}

#cookiesModal .modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

#cookiesModal .modal-header .close {
    color: white;
    opacity: 0.8;
    font-size: 2rem;
    line-height: 1;
}

#cookiesModal .modal-header .close:hover,
#cookiesModal .modal-header .close:focus {
    opacity: 1;
    outline: 2px solid white;
    outline-offset: -2px;
}

/* Body del modal */
#cookiesModal .modal-body {
    padding: 40px;
    max-height: 70vh;
    overflow-y: auto;
    background-color: #fafafa;
}

.cookies-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 35px;
    font-weight: 500;
}

/* Categorías de cookies */
.cookies-categories {
    margin-bottom: 30px;
}

.cookie-category {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: white;
}

.cookie-category:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

.category-header {
    padding: 20px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.category-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
}

.category-label input[type="checkbox"] {
    cursor: pointer;
    width: 24px;
    height: 24px;
    accent-color: #3498db;
    flex-shrink: 0;
}

.category-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.category-label input[type="checkbox"]:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    border-radius: 2px;
}

.category-name {
    font-weight: 700;
    color: #0a0a0a;
    font-size: 1.05rem;
}

.btn-info-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #3498db;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-info-toggle:hover,
.btn-info-toggle:focus {
    background-color: rgba(52, 152, 219, 0.1);
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.toggle-icon {
    display: inline-block;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.category-description {
    padding: 25px;
    background-color: #ffffff;
    border-top: 2px solid #e0e0e0;
    color: #444;
    font-size: 1rem;
    line-height: 1.8;
}

.category-description p {
    margin: 0 0 15px 0;
}

.category-description p:last-child {
    margin-bottom: 0;
}

.category-description strong {
    color: #1a1a1a;
    font-weight: 700;
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
}

/* Información adicional */
.cookies-info {
    padding: 20px;
    background-color: #e3f2fd;
    border-left: 5px solid #2196f3;
    border-radius: 4px;
    margin-bottom: 30px;
}

.cookies-info p {
    margin: 0;
    color: #1565c0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
}

.cookies-info a {
    color: #0d47a1;
    text-decoration: underline;
    font-weight: 700;
}

.cookies-info a:hover,
.cookies-info a:focus {
    color: #0a3d91;
    outline: 2px solid #0d47a1;
    outline-offset: 2px;
}

/* Footer del modal */
#cookiesModal .modal-footer {
    padding: 20px 40px;
    border-top: 2px solid #e0e0e0;
    background-color: #fafafa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

#cookiesModal .modal-footer button {
    font-weight: 700;
    padding: 12px 28px;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
    min-width: 140px;
}

#cookiesModal .modal-footer .btn-secondary {
    background-color: #e0e0e0;
    border-color: #b0b0b0;
    color: #1a1a1a;
}

#cookiesModal .modal-footer .btn-secondary:hover {
    background-color: #d0d0d0;
    border-color: #a0a0a0;
    transform: translateY(-2px);
}

#cookiesModal .modal-footer .btn-primary {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

#cookiesModal .modal-footer .btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .cookies-banner {
        padding: 20px;
    }

    .cookies-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .cookies-banner-text h3 {
        font-size: 1.2rem;
    }

    .cookies-banner-text p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .cookies-banner-actions {
        justify-content: stretch;
        width: 100%;
    }

    .cookies-banner-actions button {
        flex: 1;
        min-width: auto;
        font-size: 0.95rem;
        padding: 10px 15px;
    }

    .category-header {
        flex-wrap: wrap;
        padding: 15px;
    }

    #cookiesModal .modal-body {
        max-height: 70vh;
        padding: 25px;
    }

    #cookiesModal .modal-footer {
        flex-direction: column-reverse;
        padding: 15px 25px;
    }

    #cookiesModal .modal-footer button {
        width: 100%;
        min-width: auto;
    }

    .cookies-banner-text {
        min-width: 100%;
    }
}

@media (max-width: 576px) {
    .cookies-banner {
        padding: 15px;
        border-top: 2px solid #3498db;
    }

    .cookies-banner-text h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .cookies-banner-text p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .cookies-banner-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .cookies-banner-actions button {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    #cookiesModal .modal-dialog {
        margin: 10px;
    }

    #cookiesModal .modal-content {
        border-radius: 8px;
    }

    #cookiesModal .modal-header {
        padding: 18px 20px;
    }

    #cookiesModal .modal-title {
        font-size: 1.4rem;
    }

    #cookiesModal .modal-body {
        padding: 20px;
        font-size: 0.95rem;
    }

    .category-label {
        gap: 12px;
    }

    .category-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .category-description {
        padding: 18px;
        font-size: 0.95rem;
    }
}

/* Accesibilidad */
.cookies-banner:focus-within,
#cookiesModal:focus-within {
    z-index: 10000;
}

/* Print styles */
@media print {
    .cookies-banner,
    #cookiesModal {
        display: none !important;
    }
}

/* Modo oscuro (si está soportado) */
@media (prefers-color-scheme: dark) {
    .cookies-banner {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .cookies-banner-text p {
        color: #d0d0d0;
    }

    #cookiesModal .modal-content {
        background-color: #2d2d2d;
        color: #f0f0f0;
    }

    #cookiesModal .modal-body {
        color: #f0f0f0;
    }

    .category-header {
        background-color: #3a3a3a;
    }

    .cookies-info {
        background-color: #1a1a1a;
        border-left-color: #3498db;
        color: #f0f0f0;
    }
}
