/* ==========================================================================
   BANNER DE COOKIES - ASTIFAX & CO
   ========================================================================== */

.cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 48px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(26, 26, 110, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(26, 26, 110, 0.08), 
                0 1px 3px rgba(26, 26, 110, 0.02);
    padding: 1.5rem;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    color: #1a1a2e;
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.4s ease;
    pointer-events: none;
    box-sizing: border-box;
}

.cookie-banner.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* --- Título y texto --- */
.cookie-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a6e; /* Navy */
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-title span {
    font-size: 1.3rem;
}

.cookie-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6b7280; /* Muted */
    margin-bottom: 1.25rem;
}

.cookie-link {
    color: #00bcd4; /* Cyan */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-link:hover {
    color: #1565c0; /* Blue */
    text-decoration: underline;
}

/* --- Panel de Preferencias --- */
.cookie-prefs {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.3s ease, 
                margin 0.3s ease;
    margin-bottom: 0;
}

.cookie-prefs.open {
    max-height: 350px; /* Suficiente para los items */
    opacity: 1;
    margin-bottom: 1.25rem;
    border-top: 1px solid rgba(26, 26, 110, 0.06);
    padding-top: 1rem;
}

.cookie-pref-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
}

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

.cookie-pref-checkbox-wrapper {
    display: flex;
    align-items: center;
    height: 20px;
}

/* Checkbox personalizado */
.cookie-pref-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #e2e6ea;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
    background-color: #fff;
}

.cookie-pref-item input[type="checkbox"]:checked {
    background-color: #00bcd4; /* Cyan */
    border-color: #00bcd4;
}

.cookie-pref-item input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cookie-pref-item input[type="checkbox"]:disabled {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

.cookie-pref-item input[type="checkbox"]:disabled:checked::after {
    color: #9ca3af;
}

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

.cookie-pref-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a6e; /* Navy */
    margin-bottom: 2px;
    cursor: pointer;
}

.cookie-pref-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 99px;
    font-weight: 500;
}

.cookie-pref-badge--required {
    background-color: rgba(26, 26, 110, 0.06);
    color: #1a1a6e;
}

.cookie-pref-badge--optional {
    background-color: rgba(0, 188, 212, 0.08);
    color: #00bcd4;
}

.cookie-pref-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

/* --- Botones --- */
.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-btn {
    flex: 1;
    min-width: 110px;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.813rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
    outline: none;
    border: none;
}

.cookie-btn:active {
    transform: scale(0.98);
}

.cookie-btn--primary {
    background-color: #00bcd4; /* Cyan */
    color: #ffffff;
}

.cookie-btn--primary:hover {
    background-color: #1565c0; /* Blue */
}

.cookie-btn--secondary {
    background-color: transparent;
    color: #1a1a6e; /* Navy */
    border: 1px solid rgba(26, 26, 110, 0.15);
}

.cookie-btn--secondary:hover {
    background-color: rgba(26, 26, 110, 0.04);
    border-color: rgba(26, 26, 110, 0.3);
}

.cookie-btn--link {
    background: none;
    border: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.813rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.65rem 0.5rem;
    flex: none;
    width: 100%;
    margin-top: 4px;
    text-align: center;
    transition: color 0.2s;
}

.cookie-btn--link:hover {
    color: #1a1a6e;
}

/* Botón de Guardar en Modo Preferencias */
.cookie-btn--save {
    background-color: #1565c0; /* Blue */
    color: #ffffff;
    display: none;
    width: 100%;
    flex: none;
}

.cookie-btn--save:hover {
    background-color: #1a1a6e;
}

/* Ajustes Responsive */
@media (max-width: 480px) {
    .cookie-banner {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        padding: 1.25rem;
    }
    .cookie-buttons {
        flex-direction: column;
    }
    .cookie-btn {
        width: 100%;
        flex: none;
    }
}
