/* ============================================
   BLENDA COOKIE CONSENT BANNER
   Sistema modular CSS compatible con temas
   ============================================ */

/* Banner Container */
.blenda-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--blenda-bg-primary, #ffffff);
    border-top: 2px solid var(--blenda-border-primary, #dee2e6);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: var(--blenda-spacing-lg, 1.5rem);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.blenda-cookie-banner.show {
    transform: translateY(0);
}

/* Dark theme support */
[data-theme="dark"] .blenda-cookie-banner {
    background: var(--blenda-bg-primary, #1a1a1a);
    border-top-color: var(--blenda-border-primary, #333);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Banner Content */
.blenda-cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--blenda-spacing-md, 1rem);
}

@media (min-width: 768px) {
    .blenda-cookie-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--blenda-spacing-lg, 1.5rem);
    }
}

/* Text Content */
.blenda-cookie-text {
    flex: 1;
}

.blenda-cookie-text h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 var(--blenda-spacing-sm, 0.5rem) 0;
    color: var(--blenda-text-primary, #212529);
}

[data-theme="dark"] .blenda-cookie-text h3 {
    color: var(--blenda-text-primary, #f8f9fa);
}

.blenda-cookie-text p {
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0;
    color: var(--blenda-text-secondary, #6c757d);
}

[data-theme="dark"] .blenda-cookie-text p {
    color: var(--blenda-text-secondary, #adb5bd);
}

.blenda-cookie-text a {
    color: var(--blenda-brand-primary, #1b6ec2);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.blenda-cookie-text a:hover {
    color: var(--blenda-contrast-primary, #0056b3);
    text-decoration: underline;
}

[data-theme="dark"] .blenda-cookie-text a {
    color: var(--blenda-brand-primary, #4a9eff);
}

/* Button Group */
.blenda-cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--blenda-spacing-sm, 0.5rem);
    align-items: center;
}

@media (max-width: 767px) {
    .blenda-cookie-buttons {
        width: 100%;
    }
}

/* Cookie Buttons - Base Styles */
.blenda-cookie-btn {
    padding: var(--blenda-spacing-sm, 0.5rem) var(--blenda-spacing-lg, 1.5rem);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px; /* WCAG AAA touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--blenda-spacing-xs, 0.25rem);
}

@media (max-width: 767px) {
    .blenda-cookie-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 120px;
    }
}

/* Accept Button - Primary Style */
.blenda-cookie-btn-accept {
    background: var(--blenda-brand-success, #198754);
    color: #ffffff;
    border-color: var(--blenda-brand-success, #198754);
}

.blenda-cookie-btn-accept:hover {
    background: #157347;
    border-color: #146c43;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 135, 71, 0.2);
}

.blenda-cookie-btn-accept:active {
    transform: translateY(0);
}

/* Reject Button - Outline Style */
.blenda-cookie-btn-reject {
    background: transparent;
    color: var(--blenda-text-primary, #212529);
    border-color: var(--blenda-border-primary, #dee2e6);
}

.blenda-cookie-btn-reject:hover {
    background: var(--blenda-bg-secondary, #f8f9fa);
    border-color: var(--blenda-border-primary, #ced4da);
    transform: translateY(-1px);
}

[data-theme="dark"] .blenda-cookie-btn-reject {
    color: var(--blenda-text-primary, #f8f9fa);
    border-color: var(--blenda-border-primary, #495057);
}

[data-theme="dark"] .blenda-cookie-btn-reject:hover {
    background: var(--blenda-bg-secondary, #2d2d2d);
    border-color: var(--blenda-border-primary, #6c757d);
}

/* Configure Button - Link Style */
.blenda-cookie-btn-configure {
    background: transparent;
    color: var(--blenda-brand-primary, #1b6ec2);
    border: none;
    padding: var(--blenda-spacing-sm, 0.5rem);
    text-decoration: underline;
    font-weight: 400;
}

.blenda-cookie-btn-configure:hover {
    color: var(--blenda-contrast-primary, #0056b3);
    text-decoration: none;
}

[data-theme="dark"] .blenda-cookie-btn-configure {
    color: var(--blenda-brand-primary, #4a9eff);
}

/* Focus States - WCAG AAA Compliance */
.blenda-cookie-btn:focus-visible {
    outline: 3px solid var(--blenda-brand-primary, #1b6ec2);
    outline-offset: 2px;
}

/* Icon Styles */
.blenda-cookie-btn i {
    font-size: 1rem;
}

/* Loading State */
.blenda-cookie-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation for entrance */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.blenda-cookie-banner.animate-in {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Cookie Preferences Modal - Para futuras mejoras */
.blenda-cookie-preferences {
    /* Estilos para modal de configuración detallada */
    /* Se implementará si se necesita más granularidad */
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .blenda-cookie-banner,
    .blenda-cookie-btn {
        transition: none;
    }
    
    .blenda-cookie-banner.animate-in {
        animation: none;
        transform: translateY(0);
        opacity: 1;
    }
}

/* Print styles - hide banner when printing */
@media print {
    .blenda-cookie-banner {
        display: none;
    }
}
