/* ========================================
   Sistema de Cookies - DriveMaster
   ======================================== */

/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    border-top: 3px solid #28a745;
    animation: slideUp 0.5s 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;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-banner-text h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

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

.cookie-banner-links {
    display: flex;
    gap: 15px;
}

.cookie-banner-links a {
    color: #28a745;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.cookie-banner-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-banner-buttons .btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-banner-buttons .btn-primary {
    background: #28a745;
    color: #ffffff;
}

.cookie-banner-buttons .btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.cookie-banner-buttons .btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.cookie-banner-buttons .btn-secondary:hover {
    background: #ffffff;
    color: #1a1a1a;
}

.cookie-banner-buttons .btn-outline {
    background: transparent;
    color: #28a745;
    border: 2px solid #28a745;
}

.cookie-banner-buttons .btn-outline:hover {
    background: #28a745;
    color: #ffffff;
}

/* Modal de Preferencias de Cookies */
.cookie-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

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

.cookie-modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
}

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

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    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: 30px;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

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

.cookie-category-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

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

/* 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: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

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

input:checked + .cookie-slider {
    background-color: #28a745;
}

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

input:disabled + .cookie-slider {
    background-color: #28a745;
    cursor: not-allowed;
}

input:disabled + .cookie-slider:before {
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 25px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.cookie-modal-footer .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-modal-footer .btn-primary {
    background: #28a745;
    color: #ffffff;
}

.cookie-modal-footer .btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.cookie-modal-footer .btn-success {
    background: #20c997;
    color: #ffffff;
}

.cookie-modal-footer .btn-success:hover {
    background: #1aa085;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .cookie-banner-buttons .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .cookie-modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 20px;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-banner-text h4 {
        font-size: 16px;
    }
    
    .cookie-banner-text p {
        font-size: 13px;
    }
    
    .cookie-banner-buttons .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .cookie-modal-header h3 {
        font-size: 20px;
    }
    
    .cookie-category {
        padding: 15px;
    }
    
    .cookie-category-header h4 {
        font-size: 16px;
    }
}

/* Animaciones adicionales */
.cookie-banner.hide {
    animation: slideDown 0.5s ease-in forwards;
}

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

.cookie-preferences-modal.hide {
    animation: fadeOut 0.3s ease-in forwards;
}

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

/* Estilos para el estado de carga */
.cookie-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cookie-loading .btn {
    position: relative;
}

.cookie-loading .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
