/* ── Interest list — floating button + bottom-sheet drawer ─────────────
 * Site-wide (enqueued on every page). Uses design tokens only.
 * ─────────────────────────────────────────────────────────────────────── */

/* ── Floating button — stacked just above the WhatsApp float (same corner) ── */
.ba-interest-float {
    position: fixed;
    right: 1.25rem;
    bottom: calc(1.25rem + 52px + 0.75rem); /* WhatsApp bottom + height + gap */
    z-index: 960;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-orange);
    color: #fff;
    font-size: 1.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
    text-decoration: none;
    touch-action: manipulation;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ba-interest-float:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
    transform: scale(1.05);
    color: #fff;
}

.ba-interest-float:active {
    transform: scale(0.95);
}

/* Hover pill — "My Saved List (3)" (text set by JS via data-tooltip) */
.ba-interest-float::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--color-dark);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
}

.ba-interest-float:hover::after,
.ba-interest-float:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

/* Count badge */
.ba-interest-float__count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-dark);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ── Header indicator — appears in the top menu when the list has items ── */
.ba-interest-nav {
    position: relative;
    display: none;             /* JS shows it only when the list has items */
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--color-orange);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    flex: 0 0 auto;
    touch-action: manipulation;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ba-interest-nav:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.ba-interest-nav:active {
    transform: scale(0.95);
}

.ba-interest-nav__count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--color-dark);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

@media (max-width: 991.98px) {
    .ba-interest-nav {
        align-self: center;
    }
}

/* ── Heart interest button — the site-wide add-to-list control ──── */
.ba-heart-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Inside cards (courses page) the CTA slot was full-width — centre the heart */
.ba-card .ba-heart-wrap {
    justify-content: center;
}

/* Status message under the button — fades in/out, no layout shift */
.ba-heart-msg {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--color-green);
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}

.ba-heart-msg.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ba-heart-msg.is-remove {
    color: var(--color-danger);
}

.ba-heart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--color-primary);
    background: #fff;
    color: var(--color-primary);
    cursor: pointer;
    flex: 0 0 auto;
    text-decoration: none;
    touch-action: manipulation;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.ba-heart-btn svg {
    fill: currentColor;
}

/* Icon swap: heart by default, checkmark once added, X on added-hover */
.ba-heart-btn__check,
.ba-heart-btn__x {
    display: none;
    width: 26px;
    height: 26px;
}

.ba-heart-btn.is-in-list .ba-heart-btn__heart {
    display: none;
}

.ba-heart-btn.is-in-list .ba-heart-btn__check {
    display: block;
}

.ba-heart-btn:hover {
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.05);
}

.ba-heart-btn:active {
    transform: scale(0.95);
}

/* Added to list — big green checkmark, no fill, no border */
.ba-heart-btn.is-in-list {
    background: transparent;
    color: var(--color-green);
    border-color: transparent;
}

/* Added + hover — checkmark becomes an X in the removal colour */
.ba-heart-btn.is-in-list:hover {
    background: transparent;
    color: var(--color-danger);
    transform: scale(1.05);
}

.ba-heart-btn.is-in-list:hover .ba-heart-btn__check {
    display: none;
}

.ba-heart-btn.is-in-list:hover .ba-heart-btn__x {
    display: block;
}

/* ── Backdrop ──────────────────────────────────────────────────────── */
.ba-interest-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.ba-interest-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ── Drawer — bottom sheet, centred with a max width on desktop ───── */
.ba-interest-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.22);
    transform: translateY(100%);
    /* visibility:hidden keeps the closed sheet from ever painting a
       white sliver at the viewport bottom (mobile dynamic toolbars) */
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}

.ba-interest-drawer.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s;
}

body.ba-interest-locked {
    overflow: hidden;
}

/* Header */
.ba-interest-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ba-interest-drawer__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-dark);
}

/* Title + helper subtitle, stacked on the left of the drawer head */
.ba-interest-drawer__title-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
    padding-right: 0.75rem;
}

.ba-interest-drawer__sub {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--color-text-muted);
}

/* Items */
.ba-interest-drawer__body {
    overflow-y: auto;
    padding: 0.5rem 1.25rem;
    flex: 1;
}

.ba-interest-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ba-interest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ba-interest-item__label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.ba-interest-item__remove {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 8px;
    touch-action: manipulation;
    transition: color 0.15s, background 0.15s;
}

/* Soft red hover — deleting feels responsive without screaming */
.ba-interest-item__remove:hover {
    color: var(--color-danger);
    background: rgba(214, 69, 69, 0.12);
}

/* Empty state — simple card shown when the list has no items */
.ba-interest-empty {
    margin: 0.5rem 0 0.25rem;
    padding: 1.75rem 1.25rem;
    text-align: center;
    background: var(--color-surface-alt);
    border: 1px dashed rgba(91, 156, 234, 0.35);
    border-radius: 12px;
}

.ba-interest-empty__title {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

.ba-interest-empty__body {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--color-text-muted);
}

/* Footer */
.ba-interest-drawer__foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.ba-interest-clear {
    flex: 0 0 auto;
    min-height: 44px;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0 0.5rem;
    text-decoration: underline;
    touch-action: manipulation;
}

.ba-interest-clear:hover {
    color: var(--color-orange);
}

.ba-interest-drawer__foot .btn-primary {
    flex: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons already in the list (JS marks them) */
a[data-ba-orig].is-in-list {
    background: var(--color-success, #28a745);
    border-color: var(--color-success, #28a745);
}

@media (max-width: 575.98px) {
    .ba-interest-drawer {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
}
