/**
 * Estilos para el Sistema de Gestión de Cookies - Navatej
 * Diseño coherente con el estilo del sitio web
 */

/* ===================================
   BANNER DE COOKIES
   =================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.8) 100%);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid var(--accent-gray);
    display: none;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 1rem;
    align-items: center;
}

.cookie-banner-text {
    grid-column: 1;
    grid-row: 1;
}

.cookie-banner-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-banner-text p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.cookie-banner-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-banner-links {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    margin-top: 0.5rem;
}

.cookie-banner-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.cookie-banner-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* ===================================
   BOTONES DE COOKIES
   =================================== */

.cookie-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
}

.cookie-btn-primary {
    background: var(--white);
    color: var(--primary-black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cookie-btn-primary:hover {
    background: var(--light-gray);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===================================
   MODAL DE CONFIGURACIÓN
   =================================== */

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: var(--white);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    margin: 5vh auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.cookie-modal.show .cookie-modal-content {
    transform: translateY(0) scale(1);
}

.cookie-modal-header {
    padding: 1.5rem 2rem;
    background: var(--primary-black);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cookie-modal-body {
    padding: 2rem;
    max-height: 50vh;
    overflow-y: auto;
}

.cookie-modal-body > p {
    margin-bottom: 1.5rem;
    color: var(--medium-gray);
    line-height: 1.6;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--accent-gray);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.cookie-category:hover {
    border-color: var(--medium-gray);
}

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

.cookie-category-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-black);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-category p {
    font-size: 0.875rem;
    color: var(--medium-gray);
    line-height: 1.5;
    margin: 0;
}

/* ===================================
   SWITCH DE COOKIES
   =================================== */

.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: var(--accent-gray);
    transition: 0.3s;
    border-radius: 24px;
}

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

input:checked + .cookie-slider {
    background-color: var(--primary-black);
}

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

input:disabled + .cookie-slider {
    background-color: var(--medium-gray);
    cursor: not-allowed;
}

input:disabled + .cookie-slider:before {
    background-color: var(--light-gray);
}

/* ===================================
   FOOTER DEL MODAL
   =================================== */

.cookie-modal-footer {
    padding: 1.5rem 2rem;
    background: var(--light-gray);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid var(--accent-gray);
}

.cookie-modal-footer .cookie-btn {
    min-width: 140px;
    justify-content: center;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .cookie-banner-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
        padding: 0 1rem;
    }
    
    .cookie-banner-text {
        grid-column: 1;
        grid-row: 1;
    }
    
    .cookie-banner-actions {
        grid-column: 1;
        grid-row: 2;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .cookie-banner-links {
        grid-column: 1;
        grid-row: 3;
    }
    
    .cookie-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .cookie-modal-content {
        width: 95%;
        margin: 2vh auto;
        max-height: 90vh;
    }
    
    .cookie-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .cookie-modal-header h2 {
        font-size: 1.1rem;
    }
    
    .cookie-modal-body {
        padding: 1.5rem;
    }
    
    .cookie-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }
    
    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
    
    .cookie-category {
        padding: 0.75rem;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cookie-switch {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 1rem 0;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-banner-text h3 {
        font-size: 1.1rem;
    }
    
    .cookie-banner-text p {
        font-size: 0.875rem;
    }
}

/* ===================================
   ANIMACIONES Y EFECTOS
   =================================== */

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cookie-banner.show {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-modal.show .cookie-modal-content {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   ACCESIBILIDAD
   =================================== */

.cookie-btn:focus,
.cookie-modal-close:focus,
.cookie-switch input:focus + .cookie-slider {
    outline: 2px solid var(--primary-black);
    outline-offset: 2px;
}

.cookie-banner-links a:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
    border-radius: var(--radius);
}

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-modal,
    .cookie-modal-content,
    .cookie-btn,
    .cookie-slider {
        transition: none;
    }
    
    .cookie-banner.show,
    .cookie-modal.show .cookie-modal-content {
        animation: none;
    }
}

/* ===================================
   MODO OSCURO (OPCIONAL)
   =================================== */

@media (prefers-color-scheme: dark) {
    .cookie-modal-content {
        background: var(--secondary-black);
        color: var(--white);
    }
    
    .cookie-modal-body > p,
    .cookie-category p {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .cookie-category {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.05);
    }
    
    .cookie-category:hover {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .cookie-category-header h3 {
        color: var(--white);
    }
    
    .cookie-modal-footer {
        background: var(--primary-black);
        border-color: rgba(255, 255, 255, 0.2);
    }
}