/* list-split-button.css — Botón split "Mi lista" (estilo IMDb) + popover.
   Familia violeta de Platea (el dorado queda reservado a "Comprar entradas").
   Tokens scopeados a .lb-wrap (no globales). */

.lb-wrap {
    --lb-primary: #ba9eff;
    --lb-primary-deep: #8455ef;
    --lb-ink: #f7f2ff;
    --lb-muted: rgba(247, 242, 255, 0.62);
    --lb-soft: rgba(247, 242, 255, 0.44);
    --lb-line: rgba(255, 255, 255, 0.11);
    position: relative;
    display: inline-flex;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ── Split shell (variante outline) ─────────────────────────────── */
.lb-split {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    min-height: 2.55rem;
    background: rgba(167, 139, 250, 0.10);
    border: 1px solid rgba(167, 139, 250, 0.34);
    transition: background .18s, border-color .18s, box-shadow .18s, transform .18s;
}

.lb-split:hover {
    transform: translateY(-1px);
    background: rgba(167, 139, 250, 0.16);
    border-color: rgba(167, 139, 250, 0.50);
    box-shadow: 0 10px 26px rgba(132, 85, 239, 0.18);
}

.lb-split.is-saved {
    background: rgba(167, 139, 250, 0.20);
    border-color: rgba(167, 139, 250, 0.55);
}

.lb-main-form {
    display: inline-flex;
    margin: 0;
}

.lb-main,
.lb-caret {
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background .15s, color .15s;
}

.lb-main {
    gap: 0.5rem;
    padding: 0 0.85rem 0 0.95rem;
    border-radius: 999px 0 0 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: #e3d9ff;
}

.lb-split.is-saved .lb-main {
    color: #fff;
}

.lb-main-ico {
    display: inline-flex;
    opacity: 0.92;
}

.lb-main-label {
    white-space: nowrap;
}

.lb-caret {
    padding: 0 0.6rem 0 0.55rem;
    border-radius: 0 999px 999px 0;
    color: rgba(214, 201, 255, 0.78);
}

.lb-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.5rem 0;
    background: rgba(167, 139, 250, 0.32);
}

.lb-main:hover,
.lb-caret:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.lb-main:focus-visible,
.lb-caret:focus-visible {
    outline: 2px solid rgba(167, 139, 250, 0.72);
    outline-offset: 3px;
}

.lb-caret-ico {
    transition: transform .18s;
}

.lb-split.is-open .lb-caret {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.lb-split.is-open .lb-caret-ico {
    transform: rotate(180deg);
}

/* ── Popover ────────────────────────────────────────────────────── */
/* position: fixed so the popover escapes the hero's `overflow: hidden`
   clipping context; JS anchors it to the button on open/scroll/resize. */
.lb-pop {
    position: fixed;
    z-index: 1000;
    width: 304px;
    padding: 0.5rem;
    background: #1b1822;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.3);
    animation: lb-pop-in .16s cubic-bezier(.2, .8, .2, 1);
    transform-origin: top left;
}

.lb-pop[hidden] {
    display: none;
}

@keyframes lb-pop-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lb-pop-arrow {
    position: absolute;
    top: -6px;
    left: 22px;
    width: 12px;
    height: 12px;
    background: #1b1822;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(45deg);
}

.lb-pop-head {
    padding: 0.4rem 0.55rem 0.5rem;
}

.lb-pop-head-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--lb-soft);
}

/* rows */
.lb-pop-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 11px;
    transition: background .14s;
}

.lb-pop-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.lb-pop-row-default {
    background: rgba(167, 139, 250, 0.07);
}

.lb-pop-row-default:hover {
    background: rgba(167, 139, 250, 0.12);
}

/* navigation link covers body + arrow */
.lb-pop-row-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.5rem 0.55rem 0;
    text-decoration: none;
    color: var(--lb-ink);
}

.lb-pop-row-link:focus-visible {
    outline: 2px solid rgba(167, 139, 250, 0.6);
    outline-offset: -2px;
    border-radius: 11px;
}

.lb-pop-row-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.lb-pop-row-title {
    font-size: 0.88rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-pop-row-sub {
    font-size: 0.7rem;
    color: var(--lb-soft);
}

/* tick a la izquierda — toggle de pertenencia (form propio) */
.lb-pop-tick-form {
    margin: 0;
    padding-left: 0.55rem;
    display: inline-flex;
}

.lb-pop-check {
    flex-shrink: 0;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background .14s, border-color .14s, transform .12s;
}

.lb-pop-check:hover {
    border-color: rgba(167, 139, 250, 0.6);
    transform: scale(1.08);
}

.lb-pop-check:focus-visible {
    outline: 2px solid rgba(167, 139, 250, 0.72);
    outline-offset: 2px;
}

.lb-pop-check.is-on {
    background: var(--lb-primary);
    border-color: var(--lb-primary);
    color: #1a1226;
}

.lb-pop-check.is-on:hover {
    background: #cbb4ff;
}

.lb-pop-check-ico {
    display: none;
}

.lb-pop-check.is-on .lb-pop-check-ico {
    display: block;
}

/* flecha a la derecha — "ir a la lista" */
.lb-pop-go {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--lb-soft);
    transition: transform .14s, color .14s;
}

.lb-pop-row:hover .lb-pop-go {
    color: var(--lb-primary);
    transform: translateX(2px);
}

/* divider con etiqueta */
.lb-pop-divider {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem 0.35rem;
}

.lb-pop-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.lb-pop-divider span {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lb-soft);
}

.lb-pop-scroll {
    max-height: 216px;
    overflow-y: auto;
    margin: 0 -0.1rem;
    padding: 0 0.1rem;
}

.lb-pop-scroll::-webkit-scrollbar {
    width: 7px;
}

.lb-pop-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

/* footer / crear */
.lb-pop-foot {
    margin-top: 0.35rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-pop-create {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.55rem;
    border: 0;
    border-radius: 11px;
    background: none;
    color: var(--lb-primary);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s;
}

.lb-pop-create:hover {
    background: rgba(167, 139, 250, 0.12);
}

.lb-pop-create:focus-visible {
    outline: 2px solid rgba(167, 139, 250, 0.72);
    outline-offset: -2px;
}

.lb-pop-create-ico {
    width: 2.05rem;
    height: 2.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px dashed rgba(167, 139, 250, 0.4);
    color: var(--lb-primary);
}

.lb-pop-form {
    display: flex;
    gap: 0.45rem;
    padding: 0.35rem 0.15rem;
    margin: 0;
}

.lb-pop-form[hidden] {
    display: none;
}

.lb-pop-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
    padding: 0.55rem 0.7rem;
}

.lb-pop-input:focus {
    outline: none;
    border-color: var(--lb-primary);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.lb-pop-input::placeholder {
    color: var(--lb-soft);
}

.lb-pop-form-save {
    border: 0;
    border-radius: 10px;
    background: var(--lb-primary);
    color: #1a1226;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0 0.95rem;
    cursor: pointer;
}

.lb-pop-form-save:disabled {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 768px) {
    .lb-pop {
        width: min(304px, calc(100vw - 2rem));
    }
}
