/* ==========================================================================
   GDPR Cookie Consent – Viñeta compacta
   ========================================================================== */

/* Panel – tarjeta flotante */
.cookie-consent-panel {
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cookie-consent-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Título */
.cookie-title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}

.cookie-title::before {
    content: '🍪 ';
}

/* Descripción */
.cookie-description {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #6b7280;
}

/* Opciones */
.cookie-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cookie-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.cookie-option:last-child {
    border-bottom: none;
}

.cookie-option-header {
    flex: 1;
}

.cookie-option-description {
    display: none;
}

/* Label */
.cookie-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.cookie-label input[type="checkbox"].cookie-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    flex: 1;
}

.cookie-required {
    font-size: 10px;
    font-weight: 500;
    color: #9ca3af;
}

/* Toggle switch */
.checkmark {
    position: relative;
    display: block;
    width: 36px;
    height: 20px;
    min-width: 36px;
    background: #d1d5db;
    border-radius: 20px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.cookie-label input[type="checkbox"]:checked + .checkmark {
    background: #974315;
}

.cookie-label input[type="checkbox"]:checked + .checkmark::after {
    transform: translateX(16px);
}

.cookie-label input[type="checkbox"]:focus-visible + .checkmark {
    outline: 2px solid #974315;
    outline-offset: 2px;
}

/* Técnicas – badge "siempre activo" en vez de toggle */
.cookie-label input[type="checkbox"][disabled] {
    display: none;
}

/* Botones */
.cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cookie-btn {
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    line-height: 1.3;
}

.cookie-btn:focus-visible {
    outline: 2px solid #974315;
    outline-offset: 2px;
}

.cookie-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.cookie-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.cookie-btn-primary {
    background: #442F24;
    color: #E7E0CF;
}

.cookie-btn-primary:hover {
    background: #5a3d2f;
}

/* Aceptar todas – ocupa fila completa */
.cookie-btn-accent {
    grid-column: 1 / -1;
    background: #974315;
    color: #fff;
}

.cookie-btn-accent:hover {
    background: #7a3611;
}

/* Footer */
.cookie-footer {
    text-align: center;
}

.cookie-policy-link {
    font-size: 10px;
    color: #9ca3af;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.cookie-policy-link:hover {
    color: #974315;
}

/* Botón flotante de configuración */
.cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #442F24;
    color: #E7E0CF;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: opacity 0.25s, transform 0.25s, background 0.2s;
    padding: 0;
    opacity: 0;
    transform: scale(0.8);
}

.cookie-settings-btn.is-visible {
    opacity: 1;
    transform: scale(1);
}

.cookie-settings-btn:hover {
    background: #974315;
    transform: scale(1.08);
}

.cookie-settings-btn:focus-visible {
    outline: 2px solid #974315;
    outline-offset: 3px;
}

.cookie-settings-btn svg {
    width: 20px;
    height: 20px;
}

/* Móvil */
@media (max-width: 420px) {
    .cookie-consent-panel {
        width: auto;
        max-width: calc(100vw - 24px);
    }

    .cookie-consent-content {
        padding: 16px;
        gap: 12px;
    }

    .cookie-settings-btn {
        bottom: 12px;
        left: 12px;
    }
}
