:root {
    /* Identidad de marca vigente — se mapean a los tokens
       centrales de main.css (var(--brand-*)) en vez de
       repetir valores hex, igual que en el resto del sitio. */
    --rc-bg: var(--brand-white, #ffffff);
    --rc-bg-soft: var(--brand-gray-100, #f7f6f4);
    --rc-accent: var(--brand-primary, #AA210F);
    --rc-accent-dark: var(--brand-primary-dark, #8c1a0c);
    --rc-accent-light: var(--brand-primary-light, #D08856);
    --rc-text: var(--brand-secondary, #41403C);
    --rc-text-dim: var(--brand-text-light, #6b6862);
    --rc-border: var(--brand-gray-200, #e4e1da);
}

#rc-cookie-root { font-family: var(--brand-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif); }

/* ---------- Banner ---------- */
.rc-cookie-banner {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9999;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: var(--rc-bg);
    border: 1px solid var(--rc-border);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 20, 20, 0.2);
    padding: 16px;
    animation: rc-rise .35s cubic-bezier(.2,.8,.2,1);
}
.rc-cookie-banner[hidden] { display:none; }

@keyframes rc-rise {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.rc-close-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--rc-bg-soft);
    color: var(--rc-text-dim);
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.rc-close-x:hover { background: var(--rc-border); color: var(--rc-text); }

.rc-view[hidden] { display: none !important; }

/* ---------- Vista compacta ---------- */
.rc-view-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 18px;
}

.rc-cookie-icon svg { width: 32px; height: 32px; display:block; }

.rc-cookie-title {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
    color: var(--rc-text);
}
.rc-cookie-text {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--rc-text-dim);
}
.rc-cookie-link {
    color: var(--rc-accent);
    text-decoration: none;
    margin-left: 4px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(20, 20, 20, 0.35);
}
.rc-cookie-link:hover { border-bottom-color: var(--rc-accent); }

.rc-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rc-cookie-actions .rc-btn-primary { flex: 1 1 100%; order: 3; }
.rc-cookie-actions .rc-btn-outline { flex: 1 1 auto; order: 2; }
.rc-cookie-actions .rc-btn-ghost { flex: 1 1 auto; order: 1; padding-left: 0; }

.rc-btn {
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--brand-radius-btn, 4px 14px 4px 14px);
    padding: 9px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.rc-btn:active { transform: translateY(1px) scale(0.98); }

.rc-btn-primary {
    background: linear-gradient(135deg, var(--rc-accent), var(--rc-accent-dark));
    color: var(--rc-bg);
    box-shadow: 0 6px 14px rgba(20, 20, 20, 0.22);
    width: 100%;
}
.rc-btn-primary:hover { box-shadow: 0 8px 18px rgba(20, 20, 20, 0.32); }

.rc-btn-outline {
    background: transparent;
    color: var(--rc-text);
    border-color: var(--rc-border);
}
.rc-btn-outline:hover { border-color: var(--rc-accent); color: var(--rc-accent); }

.rc-btn-ghost {
    background: transparent;
    color: var(--rc-text-dim);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.rc-btn-ghost:hover { color: var(--rc-text); }

/* ---------- Vista detalle ---------- */
.rc-view-detail { padding-right: 18px; }

.rc-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.rc-detail-back {
    background: transparent;
    border: none;
    color: var(--rc-text-dim);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
}
.rc-detail-back:hover { color: var(--rc-accent); }

.rc-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 12px;
}
.rc-detail-item {
    border: 1px solid var(--rc-border);
    border-radius: 10px;
    padding: 9px 10px;
    background: var(--rc-bg-soft);
}
.rc-detail-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}
.rc-detail-item-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--rc-text);
}
.rc-detail-item-text {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--rc-text-dim);
}

.rc-switch { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; flex-shrink: 0; }
.rc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.rc-switch-track {
    position: absolute; inset: 0;
    background: var(--rc-border);
    border-radius: 999px;
    transition: background .2s ease;
    display: block;
}
.rc-switch-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--rc-bg);
    box-shadow: 0 1px 3px rgba(20, 20, 20, 0.3);
    transition: transform .2s ease;
}
.rc-switch input:checked + .rc-switch-track { background: var(--rc-accent); }
.rc-switch input:checked + .rc-switch-track .rc-switch-thumb { transform: translateX(16px); }
.rc-switch-disabled { cursor: not-allowed; opacity: .55; }

.rc-detail-actions {
    display: flex;
    gap: 8px;
}
.rc-detail-actions .rc-btn { flex: 1; }

/* ---------- Galletita flotante ---------- */
.rc-cookie-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9998;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--rc-border);
    background: var(--rc-bg);
    box-shadow: 0 8px 20px rgba(20, 20, 20, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: rc-pop .25s ease;
}
.rc-cookie-fab[hidden] { display: none; }
.rc-cookie-fab svg { width: 26px; height: 26px; }
.rc-cookie-fab:hover { transform: scale(1.06); }

@keyframes rc-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .rc-cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-width: none;
        padding: 14px;
        border-radius: 14px;
    }
    .rc-cookie-fab { left: 10px; bottom: 10px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .rc-cookie-banner, .rc-cookie-fab { animation: none; }
}
