/**
 * Estilos para el sistema de cookies
 * TOMALACARTA.COM
 */

/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    animation: slideUp 0.5s ease-out;
    backdrop-filter: blur(10px);
    border-top: 2px solid #15554A;
}

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

.cookie-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.cookie-banner-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

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

.cookie-banner-text h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.cookie-banner-text p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
}

.cookie-link {
    color: #4db8ac;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.cookie-link:hover {
    color: #6dd3c7;
    text-decoration: underline;
}

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

/* Botones del Banner */
.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.cookie-btn-settings {
    background: transparent;
    color: #ffffff;
    border: 2px solid #4a4a4a;
}

.cookie-btn-settings:hover {
    background: #4a4a4a;
    border-color: #5a5a5a;
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background: #f44336;
    color: white;
    border: 2px solid #f44336;
}

.cookie-btn-reject:hover {
    background: #d32f2f;
    border-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.cookie-btn-accept {
    background: #15554A;
    color: white;
    border: 2px solid #15554A;
}

.cookie-btn-accept:hover {
    background: #1f6b5f;
    border-color: #1f6b5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 85, 74, 0.3);
}

/* Modal de Configuración */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.cookie-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cookie-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cookie-modal-header {
    padding: 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #15554A 0%, #1f6b5f 100%);
}

.cookie-modal-header h2 {
    margin: 0;
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.cookie-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

.cookie-modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.cookie-modal-intro {
    margin: 0 0 25px 0;
    color: #333;
    line-height: 1.6;
    font-size: 15px;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-category {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.cookie-category-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.cookie-category-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Switch personalizado */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

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

.cookie-switch input:checked + .cookie-slider {
    background-color: #15554A;
}

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

.cookie-switch input:disabled + .cookie-slider {
    background-color: #15554A;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Detalles de cookies */
.cookie-details {
    margin-top: 15px;
}

.cookie-details details {
    cursor: pointer;
}

.cookie-details summary {
    color: #15554A;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.cookie-details summary:hover {
    color: #1f6b5f;
}

.cookie-details ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    list-style: none;
}

.cookie-details li {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
    padding-left: 15px;
    position: relative;
}

.cookie-details li:before {
    content: "•";
    color: #15554A;
    position: absolute;
    left: 0;
}

.cookie-details strong {
    color: #333;
}

.cookie-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f5f5f5;
}

.cookie-btn-save {
    background: #4CAF50;
    color: white;
    border: 2px solid #4CAF50;
}

.cookie-btn-save:hover {
    background: #45a049;
    border-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-main {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .cookie-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .cookie-modal-body {
        padding: 15px;
        max-height: calc(95vh - 180px);
    }
    
    .cookie-modal-footer {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cookie-category {
        padding: 15px;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .cookie-switch {
        order: -1;
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .cookie-banner-text h3 {
        font-size: 18px;
    }
    
    .cookie-banner-text p {
        font-size: 13px;
    }
    
    .cookie-btn {
        width: 100%;
    }
    
    .cookie-modal-header h2 {
        font-size: 20px;
    }
    
    .cookie-modal-footer {
        padding: 15px;
    }
}

/* Animación de ocultación */
.cookie-banner.hide {
    animation: slideDown 0.5s ease-out forwards;
}

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

/* Estados de hover mejorados */
.cookie-category:focus-within {
    outline: 2px solid #15554A;
    outline-offset: 2px;
}

/* Mejoras de accesibilidad */
.cookie-btn:focus,
.cookie-modal-close:focus,
.cookie-switch input:focus + .cookie-slider {
    outline: 2px solid #15554A;
    outline-offset: 2px;
}

/* Scrollbar personalizado para el modal */
.cookie-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cookie-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb {
    background: #15554A;
    border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb:hover {
    background: #1f6b5f;
}