/* ============================================================
   WebSalad Movie Ratings — style.css
   ============================================================ */

/* ── Variabili ─────────────────────────────────────────────── */
:root {
    --wsmr-bg:          #0d1117;
    --wsmr-card-bg:     #161b22;
    --wsmr-border:      #30363d;
    --wsmr-text:        #e6edf3;
    --wsmr-text-muted:  #8b949e;
    --wsmr-accent:      #f0b429;
    --wsmr-radius:      10px;
    --wsmr-shadow:      0 4px 20px rgba(0,0,0,.45);
    --wsmr-rt:          #fa320a;
    --wsmr-imdb:        #f5c518;
    --wsmr-mc:          #6c3;
    --wsmr-tmdb:        #01b4e4;
}

/* ── Card singola ──────────────────────────────────────────── */
.wsmr-card {
    display: flex;
    gap: 20px;
    background: var(--wsmr-card-bg);
    border: 1px solid var(--wsmr-border);
    border-radius: var(--wsmr-radius);
    box-shadow: var(--wsmr-shadow);
    overflow: hidden;
    margin: 24px 0;
    color: var(--wsmr-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.wsmr-card__poster {
    flex: 0 0 180px;
    position: relative;
}

.wsmr-card__poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--wsmr-radius) 0 0 var(--wsmr-radius);
}

.wsmr-card__type {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.wsmr-card__body {
    flex: 1;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wsmr-card__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--wsmr-text);
    line-height: 1.2;
}

.wsmr-card__year {
    font-weight: 400;
    color: var(--wsmr-text-muted);
    font-size: 1.1rem;
}

.wsmr-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wsmr-meta-tag {
    background: rgba(255,255,255,.07);
    border: 1px solid var(--wsmr-border);
    border-radius: 20px;
    font-size: 12px;
    padding: 3px 10px;
    color: var(--wsmr-text-muted);
}

.wsmr-card__overview {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--wsmr-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Rating badges ─────────────────────────────────────────── */
.wsmr-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wsmr-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--wsmr-border);
}

.wsmr-rating__icon  { font-size: 15px; }
.wsmr-rating__source { color: var(--wsmr-text-muted); font-size: 11px; font-weight: 400; }
.wsmr-rating__value  { color: var(--wsmr-text); }

.wsmr-rating--internet-movie-database { border-color: var(--wsmr-imdb); }
.wsmr-rating--internet-movie-database .wsmr-rating__value { color: var(--wsmr-imdb); }

.wsmr-rating--rotten-tomatoes { border-color: var(--wsmr-rt); }
.wsmr-rating--rotten-tomatoes .wsmr-rating__value { color: var(--wsmr-rt); }

.wsmr-rating--metacritic { border-color: var(--wsmr-mc); }
.wsmr-rating--metacritic .wsmr-rating__value { color: var(--wsmr-mc); }

.wsmr-rating--tmdb { border-color: var(--wsmr-tmdb); }
.wsmr-rating--tmdb .wsmr-rating__value { color: var(--wsmr-tmdb); }

/* ── Streaming ─────────────────────────────────────────────── */
.wsmr-streaming__label {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--wsmr-text-muted);
}

.wsmr-streaming__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wsmr-streaming__item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--wsmr-border);
    border-radius: 6px;
    padding: 4px 8px;
    text-decoration: none;
    transition: background .2s;
    min-width: 48px;
    min-height: 36px;
}

.wsmr-streaming__item:hover { background: rgba(255,255,255,.15); }
.wsmr-streaming__item img { height: 28px; width: auto; display: block; }
.wsmr-streaming__item:not(:has(img)) { color: var(--wsmr-text); font-size: 12px; padding: 4px 12px; }

/* ── Footer card ───────────────────────────────────────────── */
.wsmr-card__footer { margin-top: auto; }

.wsmr-btn-imdb {
    display: inline-block;
    background: var(--wsmr-imdb);
    color: #000 !important;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: opacity .2s;
}
.wsmr-btn-imdb:hover { opacity: .85; }

/* ── Griglia (trending / now playing) ──────────────────────── */
.wsmr-grid-wrap {
    margin: 24px 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;        /* previene scroll orizzontale */
}

.wsmr-grid__heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--wsmr-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wsmr-grid {
    display: grid;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}
.wsmr-grid--cols-1 { grid-template-columns: repeat(1, 1fr); }
.wsmr-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.wsmr-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.wsmr-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.wsmr-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.wsmr-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

.wsmr-thumb {
    background: var(--wsmr-card-bg);
    border: 1px solid var(--wsmr-border);
    border-radius: var(--wsmr-radius);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--wsmr-text);
    transition: transform .2s, box-shadow .2s;
    /* Previene overflow interno */
    min-width: 0;
    box-sizing: border-box;
}

.wsmr-thumb:hover {
    transform: translateY(-3px);
    box-shadow: var(--wsmr-shadow);
}

.wsmr-thumb__img {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.wsmr-thumb__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wsmr-thumb__type {
    position: absolute;
    top: 6px; left: 6px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.wsmr-thumb__vote {
    position: absolute;
    bottom: 6px; right: 6px;
    background: rgba(0,0,0,.8);
    color: var(--wsmr-imdb);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.wsmr-thumb__info {
    padding: 10px 12px;
}

.wsmr-thumb__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--wsmr-text);
}

.wsmr-thumb__year {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--wsmr-text-muted);
}

/* ── Griglia streaming arricchita (movie_coming_soon) ──────── */

.wsmr-thumb--rich .wsmr-thumb__img {
    position: relative;
}

/* Badge piattaforma streaming (Netflix, Prime, ecc.) */
.wsmr-thumb__platform {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,.8);
    border-radius: 5px;
    padding: 3px 5px;
    display: flex;
    align-items: center;
    max-width: 80px;
}

.wsmr-thumb__platform img {
    height: 20px;
    width: auto;
    display: block;
}

.wsmr-thumb__platform span {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating principale in overlay (angolo in basso a destra) */
.wsmr-thumb__vote--internet-movie-database { color: var(--wsmr-imdb); }
.wsmr-thumb__vote--rotten-tomatoes         { color: var(--wsmr-rt); }
.wsmr-thumb__vote--metacritic              { color: var(--wsmr-mc); }
.wsmr-thumb__vote--tmdb                    { color: var(--wsmr-tmdb); }

/* Generi nella thumb */
.wsmr-thumb__genres {
    margin: 2px 0 0;
    font-size: 10px;
    color: var(--wsmr-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mini badge rating multipli */
.wsmr-thumb__ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.wsmr-mini-rating {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--wsmr-border);
    color: var(--wsmr-text-muted);
    white-space: nowrap;
}

.wsmr-mini-rating--internet-movie-database { border-color: var(--wsmr-imdb); color: var(--wsmr-imdb); }
.wsmr-mini-rating--rotten-tomatoes         { border-color: var(--wsmr-rt);   color: var(--wsmr-rt);   }
.wsmr-mini-rating--metacritic              { border-color: var(--wsmr-mc);   color: var(--wsmr-mc);   }
.wsmr-mini-rating--tmdb                    { border-color: var(--wsmr-tmdb); color: var(--wsmr-tmdb); }

/* Data disponibilità */
.wsmr-thumb__added {
    margin: 5px 0 0;
    font-size: 10px;
    color: var(--wsmr-text-muted);
}

/* Link titolo nella thumb */
.wsmr-thumb__title a {
    color: var(--wsmr-text);
    text-decoration: none;
}
.wsmr-thumb__title a:hover {
    color: var(--wsmr-accent);
    text-decoration: underline;
}

/* Placeholder no-poster */
.wsmr-thumb__no-poster {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wsmr-border);
    font-size: 3rem;
}

/* ── Errori ────────────────────────────────────────────────── */
.wsmr-error {
    background: #2d1b1b;
    border: 1px solid #6e3030;
    border-radius: 6px;
    padding: 10px 14px;
    color: #f0a0a0;
    font-size: 14px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .wsmr-card { flex-direction: column; }
    .wsmr-card__poster { flex: none; max-height: 280px; }
    .wsmr-card__poster img { border-radius: var(--wsmr-radius) var(--wsmr-radius) 0 0; }

    .wsmr-grid--cols-3,
    .wsmr-grid--cols-4,
    .wsmr-grid--cols-5,
    .wsmr-grid--cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .wsmr-grid--cols-2,
    .wsmr-grid--cols-3,
    .wsmr-grid--cols-4,
    .wsmr-grid--cols-5,
    .wsmr-grid--cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 360px) {
    .wsmr-grid--cols-2,
    .wsmr-grid--cols-3,
    .wsmr-grid--cols-4,
    .wsmr-grid--cols-5,
    .wsmr-grid--cols-6 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   WSMR SINGLE CARD  —  template pagina singola [wsmr_single_card]
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Wrapper globale ─────────────────────────────────────────────────────────── */
.wsmr-single {
    font-family: inherit;
    color: #e6edf3;
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    /* Previene overflow orizzontale globale */
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

/* ── HERO ────────────────────────────────────────────────────────────────────── */
.wsmr-single__hero {
    position: relative;
    min-height: 380px;
    padding: 40px 32px;
    background-color: #161b22;
    /* Backdrop con overlay scuro */
    background-image:
        linear-gradient(to right, rgba(13,17,23,.97) 38%, rgba(13,17,23,.6) 100%),
        var(--wsmr-bd, none);
    background-size: cover;
    background-position: center top;
    /* Box model corretto */
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.wsmr-single__hero-inner {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    /* Previene che figli flex espandano oltre il contenitore */
    overflow: hidden;
}

.wsmr-single__poster {
    flex-shrink: 0;
    width: 200px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.wsmr-single__poster img {
    display: block;
    width: 100%;
    height: auto;
}

.wsmr-single__hero-info {
    flex: 1;
    min-width: 0;
    /* Previene overflow di testi lunghi */
    overflow-wrap: break-word;
    word-break: break-word;
}

.wsmr-single__type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    background: #f0b429;
    color: #0d1117;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.wsmr-single__title {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 6px;
    color: #f0f6fc;
}

.wsmr-single__year {
    font-weight: 400;
    opacity: .65;
    font-size: .8em;
}

.wsmr-single__tagline {
    font-style: italic;
    color: #8b949e;
    margin: 0 0 14px;
    font-size: .95rem;
}

.wsmr-single__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

/* ── Rating nel hero ─────────────────────────────────────────────────────────── */
.wsmr-single__ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.wsmr-single__rating {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    min-width: 110px;
}

.wsmr-single__rating-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.wsmr-single__rating-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.wsmr-single__rating-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f6fc;
}

.wsmr-single__rating-source {
    font-size: 0.7rem;
    color: #8b949e;
    white-space: nowrap;
}

/* Colori bordo per fonte */
.wsmr-single__rating.wsmr-rating--internet-movie-database { border-color: #f5c518; }
.wsmr-single__rating.wsmr-rating--rotten-tomatoes         { border-color: #fa320a; }
.wsmr-single__rating.wsmr-rating--metacritic              { border-color: #6c3; }
.wsmr-single__rating.wsmr-rating--tmdb                    { border-color: #01b4e4; }

/* ── CTA buttons ─────────────────────────────────────────────────────────────── */
.wsmr-single__cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wsmr-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}
.wsmr-btn:hover { opacity: .8; text-decoration: none; }

.wsmr-btn--imdb { background: #f5c518; color: #000; }
.wsmr-btn--tmdb { background: #01b4e4; color: #000; }

/* ── BODY (main + sidebar) ───────────────────────────────────────────────────── */
.wsmr-single__body {
    display: grid;
    /* minmax(0,1fr) invece di 1fr: permette alla colonna di restringersi
       sotto la dimensione del contenuto (fix overflow cast scrollabile) */
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    padding: 32px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── Figli diretti della grid body ──────────────────────────────────────────── */
.wsmr-single__main {
    min-width: 0;   /* consente alla colonna grid di restringersi */
    /* NON overflow:hidden qui: blocca il cast scroll su Safari.
       Il contenimento è garantito da minmax(0,1fr) sulla colonna. */
}
.wsmr-single__sidebar {
    min-width: 0;
}

/* ── Sections ────────────────────────────────────────────────────────────────── */
.wsmr-single__section {
    margin-bottom: 32px;
}
.wsmr-single__section:last-child {
    margin-bottom: 0;
}

.wsmr-single__section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8b949e;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262d;
}

.wsmr-single__overview {
    line-height: 1.75;
    color: #c9d1d9;
    margin: 0;
    font-size: .97rem;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* ── Cast ────────────────────────────────────────────────────────────────────── */
.wsmr-single__cast {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #30363d transparent;
    /* Necessario affinché overflow-x: auto funzioni dentro una grid cell */
    min-width: 0;
    max-width: 100%;
}
.wsmr-single__cast::-webkit-scrollbar       { height: 4px; }
.wsmr-single__cast::-webkit-scrollbar-track { background: transparent; }
.wsmr-single__cast::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }

.wsmr-cast-card {
    flex-shrink: 0;
    width: 100px;
    text-align: center;
}

.wsmr-cast-card__photo {
    width: 100px;
    height: 130px;
    border-radius: 6px;
    overflow: hidden;
    background: #21262d;
    margin-bottom: 6px;
}
.wsmr-cast-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wsmr-cast-card__no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #30363d;
}

.wsmr-cast-card__name {
    font-size: .78rem;
    font-weight: 600;
    color: #e6edf3;
    margin: 0 0 2px;
    line-height: 1.3;
}
.wsmr-cast-card__char {
    font-size: .72rem;
    color: #8b949e;
    margin: 0;
    line-height: 1.3;
}

/* ── Scheda tecnica ──────────────────────────────────────────────────────────── */
.wsmr-single__sidebar {
    border-left: 1px solid #21262d;
    padding-left: 28px;
}

.wsmr-single__details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 14px;
    margin: 0;
}
.wsmr-single__details dt {
    color: #8b949e;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    padding-top: 1px;
}
.wsmr-single__details dd {
    color: #c9d1d9;
    font-size: .85rem;
    margin: 0;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .wsmr-single__hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .wsmr-single__poster { width: 160px; }
    .wsmr-single__meta-row,
    .wsmr-single__ratings,
    .wsmr-single__cta { justify-content: center; }

    .wsmr-single__body {
        grid-template-columns: 1fr;
        padding: 24px 20px;
    }
    .wsmr-single__sidebar {
        border-left: none;
        border-top: 1px solid #21262d;
        padding-left: 0;
        padding-top: 24px;
    }
    /* Assicura che la main column non esca */
    .wsmr-single__main,
    .wsmr-single__sidebar {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .wsmr-single__hero  { padding: 24px 16px; }
    .wsmr-single__body  { padding: 20px 16px; gap: 20px; }
    .wsmr-single__poster { width: 120px; }

    /* Rating: rimuovi min-width, lascia che si adattino */
    .wsmr-single__rating {
        min-width: 0;
        flex: 1 1 calc(50% - 6px);
        padding: 8px 10px;
    }
    .wsmr-single__rating-value { font-size: .95rem; }
    .wsmr-single__rating-icon  { font-size: 1.2rem; }

    /* Cast scroll: tocco più fluido su mobile */
    .wsmr-single__cast {
        -webkit-overflow-scrolling: touch;
    }

    /* Testo taglio senza overflow */
    .wsmr-single__title    { font-size: 1.4rem; }
    .wsmr-single__overview { font-size: .9rem; }

    /* Bottoni CTA interi su mobile */
    .wsmr-single__cta { flex-direction: column; align-items: center; }
    .wsmr-btn { width: 100%; max-width: 260px; text-align: center; }
}

@media (max-width: 360px) {
    .wsmr-single__hero   { padding: 20px 12px; }
    .wsmr-single__body   { padding: 16px 12px; }
    .wsmr-single__poster { width: 100px; }
    .wsmr-single__rating { flex: 1 1 100%; }
}

/* ── Link CPT sulle miniature ───────────────────────────────────────────────── */
.wsmr-thumb__link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.wsmr-thumb__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    color: inherit;
    text-decoration: none;
}
.wsmr-thumb__link:hover .wsmr-thumb__title {
    color: #f0b429;
}

/* ── Badge piattaforme streaming ─────────────────────────────────────────────── */
.wsmr-platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.wsmr-platform-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--wsmr-platform-color, #555);
    border: 1px solid rgba(255,255,255,.15);
}
/* Variante più piccola usata nelle card della griglia */
.wsmr-platform-badge--sm {
    padding: 2px 8px;
    font-size: .65rem;
    border-radius: 12px;
}
.wsmr-thumb__platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.wsmr-platform-badges__note {
    font-size: .72rem;
    color: var(--wsmr-text-muted);
    margin: 4px 0 0;
    font-style: normal;
}

/* ── Card non ancora importata ────────────────────────────────────────────────── */
.wsmr-thumb__not-synced {
    font-size: .7rem;
    color: #484f58;
    font-style: italic;
    margin: 4px 0 0;
}

/* ── Attribution TMDB ────────────────────────────────────────────────────────── */
.wsmr-attribution {
    margin-top: 12px;
    padding: 10px 32px 24px;
    border-top: 1px solid #21262d;
    font-size: 11px;
    color: #484f58;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .wsmr-attribution { padding: 10px 16px 20px; }
}
.wsmr-attribution a {
    color: #6e7681;
    text-decoration: none;
}
.wsmr-attribution a:hover {
    color: #01b4e4;
    text-decoration: underline;
}

/* ============================================================
   [wsmr_recommend] — Motore di raccomandazione
   Tutti i selettori usano .wsmr-rec come radice per battere
   la specificità del tema e di Elementor.
   ============================================================ */

.wsmr-rec {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ── Form container ─────────────────────────────────────────── */
.wsmr-rec .wsmr-rec__form {
    background: #161b22 !important;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 32px;
}
.wsmr-rec .wsmr-rec__section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #21262d;
}
.wsmr-rec .wsmr-rec__section:last-of-type { border-bottom: none; margin-bottom: 16px; }
.wsmr-rec .wsmr-rec__section-title {
    font-size: .95rem !important;
    font-weight: 700 !important;
    color: #e6edf3 !important;
    margin: 0 0 12px !important;
}
.wsmr-rec .wsmr-rec__optional { font-size: .75rem; font-weight: 400; color: #8b949e; }
.wsmr-rec .wsmr-rec__hint     { font-size: .8rem; color: #8b949e; margin: 0 0 12px; }

/* ── Pill checkboxes ────────────────────────────────────────── */
.wsmr-rec .wsmr-rec__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wsmr-rec .wsmr-rec__pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px;
    padding: 5px 13px !important;
    border-radius: 20px !important;
    border: 2px solid #30363d !important;
    cursor: pointer;
    font-size: .78rem !important;
    font-weight: 600;
    color: #8b949e;
    background: transparent !important;
    transition: all .15s;
    user-select: none;
    line-height: 1.4 !important;
    box-sizing: border-box;
}
/* Nascondi la checkbox nativa */
.wsmr-rec .wsmr-rec__pill input[type="checkbox"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
}
/* Platform hover / checked (classe --checked aggiunta via JS) */
.wsmr-rec .wsmr-rec__pill--platform {
    border-color: var(--pill-color, #30363d) !important;
}
.wsmr-rec .wsmr-rec__pill--platform:hover,
.wsmr-rec .wsmr-rec__pill--platform.wsmr-rec__pill--checked {
    background: var(--pill-color, #0073aa) !important;
    border-color: var(--pill-color, #0073aa) !important;
    color: #fff !important;
}
/* Genere hover / checked */
.wsmr-rec .wsmr-rec__pill--genre:hover {
    border-color: #f0b429 !important;
    color: #f0b429 !important;
}
.wsmr-rec .wsmr-rec__pill--genre.wsmr-rec__pill--checked {
    background: #f0b429 !important;
    border-color: #f0b429 !important;
    color: #000 !important;
    font-weight: 700;
}

/* ── Autocomplete ───────────────────────────────────────────── */
.wsmr-rec .wsmr-rec__liked-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 520px;
    margin-bottom: 10px;
}
.wsmr-rec .wsmr-ac__wrap { position: relative; }

/* Override aggressivo degli stili tema sugli input */
.wsmr-rec .wsmr-ac__input,
.wsmr-rec .wsmr-ac__input:not([type="submit"]) {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: 42px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    background: #0d1117 !important;
    background-color: #0d1117 !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    color: #e6edf3 !important;
    font-size: .88rem !important;
    font-weight: 400 !important;
    line-height: 42px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s;
}
.wsmr-rec .wsmr-ac__input:focus {
    border-color: #f0b429 !important;
    box-shadow: 0 0 0 2px rgba(240,180,41,.15) !important;
}
.wsmr-rec .wsmr-ac__input.wsmr-ac__input--ok {
    border-color: #3fb950 !important;
}
/* Placeholder */
.wsmr-rec .wsmr-ac__input::placeholder { color: #484f58 !important; }

.wsmr-rec .wsmr-ac__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    z-index: 99999;
    box-shadow: 0 8px 28px rgba(0,0,0,.6);
}
.wsmr-rec .wsmr-ac__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: .84rem;
    color: #e6edf3;
    transition: background .1s;
    border: none !important;
}
.wsmr-rec .wsmr-ac__item:hover { background: #21262d; }
.wsmr-rec .wsmr-ac__thumb {
    width: 34px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.wsmr-rec .wsmr-ac__thumb--empty {
    width: 34px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #21262d;
    border-radius: 4px;
    font-size: 1rem;
    flex-shrink: 0;
}
.wsmr-rec .wsmr-ac__info   { line-height: 1.35; }
.wsmr-rec .wsmr-ac__year   { color: #8b949e; font-size: .78rem; margin-left: 2px; }
.wsmr-rec .wsmr-ac__empty  { padding: 10px 14px; color: #8b949e; font-size: .82rem; font-style: italic; }

/* ── Bottoni ────────────────────────────────────────────────── */
.wsmr-rec .wsmr-rec__add-btn {
    display: block;
    background: transparent !important;
    border: 1px dashed #30363d !important;
    border-radius: 8px !important;
    color: #8b949e !important;
    padding: 8px 16px !important;
    cursor: pointer;
    font-size: .82rem !important;
    max-width: 520px;
    width: 100%;
    text-align: center;
    transition: all .15s;
    margin-top: 2px;
    box-shadow: none !important;
}
.wsmr-rec .wsmr-rec__add-btn:hover {
    border-color: #f0b429 !important;
    color: #f0b429 !important;
}
.wsmr-rec .wsmr-rec__submit-btn {
    display: inline-block;
    margin-top: 12px;
    background: #f0b429 !important;
    color: #000 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 32px !important;
    font-size: .95rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    box-shadow: none !important;
}
.wsmr-rec .wsmr-rec__submit-btn:hover   { opacity: .85; transform: translateY(-1px); }
.wsmr-rec .wsmr-rec__submit-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Errore / risultati ─────────────────────────────────────── */
.wsmr-rec .wsmr-rec__error {
    background: #2d1515;
    border: 1px solid #c44;
    color: #f88;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: .88rem;
}
.wsmr-rec .wsmr-rec__results { margin-top: 12px; }

/* ── Badge affinità sulla card ──────────────────────────────── */
.wsmr-thumb__affinity {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(13,17,23,.88);
    border: 1px solid #f0b429;
    color: #f0b429;
    font-size: .6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: .03em;
    pointer-events: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 680px) {
    .wsmr-rec .wsmr-rec__form            { padding: 18px 14px !important; }
    .wsmr-rec .wsmr-rec__liked-list      { max-width: 100%; }
    .wsmr-rec .wsmr-rec__add-btn         { max-width: 100%; }
}

@media (max-width: 480px) {
    .wsmr-rec .wsmr-rec__form    { padding: 14px 12px !important; }
    /* Bottone Scopri a piena larghezza */
    .wsmr-rec .wsmr-rec__submit-btn {
        width: 100% !important;
        padding: 12px 16px !important;
        box-sizing: border-box !important;
    }
    /* Pills su 2 colonne max su mobile */
    .wsmr-rec .wsmr-rec__pills { gap: 6px; }
    .wsmr-rec .wsmr-rec__pill  { font-size: .72rem !important; padding: 4px 10px !important; }
}

/* ── Responsive card base (wsmr-card) ───────────────────────── */
@media (max-width: 480px) {
    .wsmr-card { gap: 12px; }
    .wsmr-card__poster { flex: none; max-height: 200px; }
    .wsmr-card__body   { padding: 14px 14px 12px; gap: 8px; }
    .wsmr-card__title  { font-size: 1.1rem; }
}

/* ============================================================
   [wsmr_catalog] — Pagina catalogo per piattaforma
   ============================================================ */

.wsmr-cp {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* ── Intestazione ─────────────────────────────────────────── */
.wsmr-cp__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.wsmr-cp .wsmr-cp__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #e6edf3 !important;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}
.wsmr-cp__heading-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wsmr-cp__count {
    margin: 0;
    font-size: .85rem;
    color: var(--wsmr-text-muted, #8b949e);
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.wsmr-cp__count-num {
    font-weight: 700;
    color: var(--wsmr-text, #e6edf3);
}

/* ── Barra filtri — tutte le regole usano .wsmr-cp come radice
   per battere la specificità del tema/Elementor ────────────── */
.wsmr-cp .wsmr-cp__filters {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 24px !important;
    padding: 12px 14px !important;
    background: #161b22 !important;
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.wsmr-cp .wsmr-cp__filter-search {
    flex: 1 1 200px !important;
    min-width: 160px !important;
}

/* Input ricerca */
.wsmr-cp .wsmr-cp__search-input,
.wsmr-cp .wsmr-cp__search-input:not([type="submit"]) {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: 40px !important;
    padding: 0 14px 0 36px !important;
    margin: 0 !important;
    background: #0d1117 !important;
    background-color: #0d1117 !important;
    background-image: none !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    color: #e6edf3 !important;
    font-size: .85rem !important;
    font-weight: 400 !important;
    line-height: 40px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s;
    /* icona 🔍 tramite background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
}
.wsmr-cp .wsmr-cp__search-input:focus {
    border-color: #f0b429 !important;
    box-shadow: 0 0 0 2px rgba(240,180,41,.15) !important;
}
.wsmr-cp .wsmr-cp__search-input::placeholder { color: #484f58 !important; }

/* Gruppi filtro */
.wsmr-cp .wsmr-cp__filter-group { flex: 0 0 auto !important; }

/* Select */
.wsmr-cp .wsmr-cp__select,
.wsmr-cp .wsmr-cp__select:not([multiple]) {
    display: inline-block !important;
    height: 40px !important;
    padding: 0 32px 0 12px !important;
    margin: 0 !important;
    background: #0d1117 !important;
    background-color: #0d1117 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    color: #e6edf3 !important;
    font-size: .82rem !important;
    font-weight: 400 !important;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    max-width: 170px;
    white-space: nowrap;
    transition: border-color .15s;
}
.wsmr-cp .wsmr-cp__select:focus {
    border-color: #f0b429 !important;
    box-shadow: 0 0 0 2px rgba(240,180,41,.15) !important;
}
.wsmr-cp .wsmr-cp__select:hover { border-color: #8b949e !important; }
.wsmr-cp .wsmr-cp__select option { background: #161b22 !important; color: #e6edf3 !important; }

/* Bottone reset */
.wsmr-cp .wsmr-cp__reset-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 40px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid #f0b429 !important;
    border-radius: 8px !important;
    color: #f0b429 !important;
    font-size: .8rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    box-shadow: none !important;
    line-height: 1 !important;
}
.wsmr-cp .wsmr-cp__reset-btn:hover {
    background: rgba(240,180,41,.12) !important;
}

/* ── Griglia risultati ────────────────────────────────────── */
.wsmr-cp__results {
    position: relative;
    transition: opacity .2s;
}
.wsmr-cp__grid-wrap { transition: opacity .25s; }

.wsmr-cp__empty {
    padding: 40px 20px;
    text-align: center;
    color: #8b949e;
    font-size: .95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Spinner ──────────────────────────────────────────────── */
.wsmr-cp__loading {
    position: absolute;
    inset: 0;
    display: none !important;      /* !important evita override da temi */
    pointer-events: none;          /* non blocca click anche se visibile per errore */
    align-items: center;
    justify-content: center;
    background: rgba(13,17,23,.5);
    border-radius: 8px;
    z-index: 10;
}
.wsmr-cp__loading.is-visible {
    display: flex !important;
    pointer-events: all;
}
.wsmr-cp__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #30363d;
    border-top-color: #f0b429;
    border-radius: 50%;
    animation: wsmr-spin .7s linear infinite;
}
@keyframes wsmr-spin { to { transform: rotate(360deg); } }

/* ── Paginazione ──────────────────────────────────────────── */
.wsmr-cp__pagination {
    margin-top: 28px;
    display: flex;
    justify-content: center;
}
.wsmr-cp__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.wsmr-cp__page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    color: #8b949e !important;
    font-size: .85rem !important;
    cursor: pointer;
    transition: all .15s;
    box-shadow: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.wsmr-cp__page-btn:hover {
    background: #21262d !important;
    color: #e6edf3 !important;
    border-color: #8b949e !important;
}
.wsmr-cp__page-btn--active {
    background: #f0b429 !important;
    border-color: #f0b429 !important;
    color: #000 !important;
    font-weight: 700 !important;
    cursor: default;
}
.wsmr-cp__page-ellipsis {
    color: #484f58;
    font-size: .85rem;
    padding: 0 2px;
    line-height: 36px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 860px) {
    .wsmr-cp .wsmr-cp__select { max-width: 150px; font-size: .78rem !important; }
}

@media (max-width: 680px) {
    .wsmr-cp .wsmr-cp__filters  { padding: 10px 12px !important; gap: 6px !important; }
    .wsmr-cp .wsmr-cp__filter-search { flex: 1 1 100% !important; }
    .wsmr-cp .wsmr-cp__filter-group  { flex: 1 1 calc(50% - 4px) !important; }
    .wsmr-cp .wsmr-cp__select        { max-width: 100% !important; width: 100% !important; }
    .wsmr-cp .wsmr-cp__reset-btn     { width: 100% !important; justify-content: center !important; }
}

@media (max-width: 400px) {
    .wsmr-cp .wsmr-cp__filter-group { flex: 1 1 100% !important; }
}

/* ── Contenimento anti-overflow globale del plugin ───────────────────────────
   Garantisce che nessun elemento del plugin causi scroll orizzontale,
   indipendentemente dal tema/Elementor che wrappa il componente.
   ─────────────────────────────────────────────────────────────────────────── */
.wsmr-single,
.wsmr-grid-wrap,
.wsmr-card,
.wsmr-rec {
    max-width: 100% !important;
}

/* Tutte le immagini interne non escono mai dal contenitore */
.wsmr-single img,
.wsmr-grid-wrap img,
.wsmr-card img,
.wsmr-rec img {
    max-width: 100%;
    height: auto;
}

/* ── [wsmr_search] – barra di ricerca con autocomplete ──────────────────── */

/* Icona lente come data-URI (grigia, usata come bg dell'input) */
.wsmr-search-bar__input {
    display: block !important;
    width: 220px !important;
    height: 36px !important;
    padding: 0 12px 0 34px !important;
    border: 1px solid #30363d !important;
    border-radius: 18px !important;
    background-color: #0d1117 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 10px center !important;
    background-size: 15px 15px !important;
    color: #e6edf3 !important;
    font-size: 13px !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color .2s, border-radius .15s !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}
.wsmr-search-bar__input::placeholder { color: #8b949e !important; }
.wsmr-search-bar__input:focus        { border-color: #58a6ff !important; }

/* Struttura del wrapper */
.wsmr-search-bar {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

/* Bottone icona – visibile solo su mobile */
.wsmr-search-bar__toggle {
    display: none !important;
    width: 36px !important;
    height: 36px !important;
    min-width: unset !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: background .2s !important;
}
.wsmr-search-bar__toggle:hover,
.wsmr-search-bar__toggle:focus {
    background: rgba(255,255,255,.1) !important;
    outline: none !important;
    box-shadow: none !important;
}
.wsmr-search-bar__toggle svg {
    display: block !important;
    pointer-events: none !important;
}

/* Angoli inferiori piatti quando la tendina è aperta */
.wsmr-search-bar:has(.wsmr-search-bar__dropdown:not([hidden])) .wsmr-search-bar__input {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-color: #21262d !important;
}

/* ── Dropdown ── */
.wsmr-search-bar__dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
    z-index: 9999 !important;
    min-width: 280px !important;
}

/* ── Singolo risultato ── */
.wsmr-sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    text-decoration: none !important;
    color: #e6edf3 !important;
    transition: background .15s;
    border-top: 1px solid #21262d;
}
.wsmr-sb-item:first-child { border-top: none; }
.wsmr-sb-item:hover,
.wsmr-sb-item.is-active   { background: #21262d !important; }

.wsmr-sb-item__poster {
    flex-shrink: 0;
    width: 34px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #0d1117;
}
.wsmr-sb-item__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wsmr-sb-item__no-poster {
    display: block;
    width: 100%;
    height: 100%;
    background: #21262d;
}
.wsmr-sb-item__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.wsmr-sb-item__title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wsmr-sb-item__year {
    font-size: 12px;
    color: #8b949e;
}
.wsmr-sb-item__arrow {
    flex-shrink: 0;
    color: #484f58;
    transition: color .15s, transform .15s;
}
.wsmr-sb-item:hover .wsmr-sb-item__arrow,
.wsmr-sb-item.is-active .wsmr-sb-item__arrow {
    color: #58a6ff;
    transform: translateX(3px);
}

/* Nel menu di navigazione */
.nav-menu .wsmr-search-bar,
.menu     .wsmr-search-bar {
    margin: auto 8px !important;
    align-self: center !important;
}

/* ── Mobile: mostra solo l'icona, input nascosto (l'overlay fa tutto) ─── */
@media (max-width: 768px) {
    .wsmr-search-bar {
        width: auto !important;
    }
    .wsmr-search-bar__toggle {
        display: flex !important;
    }
    .wsmr-search-bar__input,
    .wsmr-search-bar__dropdown {
        display: none !important;
    }
}

/* ── Overlay ricerca mobile ───────────────────────────────────────────── */
#wsmr-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #0d1117;
    flex-direction: column;
    animation: wsmrSovIn .18s ease;
}
#wsmr-search-overlay.is-open {
    display: flex !important;
}
@keyframes wsmrSovIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wsmr-sov__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
}
.wsmr-sov__field {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}
.wsmr-sov__icon {
    position: absolute;
    left: 12px;
    color: #8b949e;
    pointer-events: none;
    flex-shrink: 0;
}
.wsmr-sov__input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1px solid #30363d;
    border-radius: 10px;
    background: #161b22;
    color: #e6edf3;
    font-size: 16px;   /* evita zoom su iOS */
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.wsmr-sov__input:focus { border-color: #58a6ff; }
.wsmr-sov__input::placeholder { color: #8b949e; }

.wsmr-sov__close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: unset !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #8b949e !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: background .15s, color .15s !important;
}
.wsmr-sov__close:hover {
    background: #21262d !important;
    color: #e6edf3 !important;
}

.wsmr-sov__results {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}
.wsmr-sov__empty {
    padding: 24px 20px;
    color: #8b949e;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

/* Risultati nell'overlay: più spaziosi */
#wsmr-search-overlay .wsmr-sb-item {
    padding: 12px 20px;
    border-top-color: #21262d;
}
#wsmr-search-overlay .wsmr-sb-item__poster {
    width: 42px;
    height: 62px;
}
#wsmr-search-overlay .wsmr-sb-item__title {
    font-size: 15px;
}
#wsmr-search-overlay .wsmr-sb-item__year {
    font-size: 13px;
}

/* ── Pagina risultati di ricerca (wsmr_catalog senza platform) ─────────── */
.wsmr-cp[data-platform=""] .wsmr-cp__heading-dot {
    background: #58a6ff !important;
}
.wsmr-cp[data-platform=""] .wsmr-cp__heading em {
    font-style: normal;
    color: #58a6ff;
}

/* ════════════════════════════════════════════════════════════════════════════
   Bottone CTA principale — .cosaguardo-button (voce di menu)
   ════════════════════════════════════════════════════════════════════════════ */

li.cosaguardo-button,
.cosaguardo-button {
    display: flex !important;
    align-items: center !important;
}

/* Gradiente direttamente su <a> — NON su ::before perché Elementor imposta
   "opacity:0" su tutti .elementor-item::before in stato non-hover tramite il
   selettore ad alta specificità (0,5,1):
     .elementor-item:not(:hover):not(:focus):not(.elementor-item-active)
       :not(.highlighted):before { opacity:0 }
   Sul hover poi transiziona ::before a opacity:1 con background bianco
   (pointer-background animation) causando il flash bianco.
   Soluzione: gradiente su <a> + ::before/::after neutralizzati con opacity:0. */
.cosaguardo-button a,
.cosaguardo-button > a,
li.cosaguardo-button > a {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 9px 22px !important;
    border-radius: 100px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: .4px !important;
    text-decoration: none !important;
    color: #fff !important;
    overflow: hidden !important;
    /* Gradiente sul background diretto: resiste a qualsiasi background-color
       impostato da Elementor, poiché background-image sovrasta background-color. */
    background-image: linear-gradient(
        110deg,
        #e50914,
        #ff5f1f,
        #ffbe00,
        #ff5f1f,
        #e50914,
        #ff5f1f,
        #ffbe00
    ) !important;
    background-size: 400% 100% !important;
    background-color: transparent !important;
    animation: cgGrad 4s linear infinite, cgPulse 2.4s ease-in-out infinite alternate !important;
    transition: transform .2s ease, filter .2s ease !important;
    white-space: nowrap !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
}

/* ── ::before e ::after: neutralizzati ──
   Elementor usa ::before per il "pointer-background" hover animation.
   Forziamo opacity:0 !important così il bianco non può mai comparire. */
.cosaguardo-button a::before,
li.cosaguardo-button > a::before,
.cosaguardo-button a::after,
li.cosaguardo-button > a::after {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hover — toni caldi accelerati.
   Elementor imposta --e-global-color-accent (#61CE70, verde) come hover color
   del nav menu; lo azzeriamo sulla variabile e forziamo #fff sul testo.
   NOTA: non usiamo "background: transparent" sull'hover perché Elementor può
   sovrascrivere background-color con !important e specificità maggiore.
   Invece mettiamo il gradiente DIRETTAMENTE su <a>:hover: background-image
   si renderizza sopra background-color, quindi qualunque colore Elementor
   imposti viene coperto dal nostro gradiente. */
li.cosaguardo-button,
li.cosaguardo-button > a,
li.cosaguardo-button > a:hover,
li.cosaguardo-button > a:focus {
    --e-global-color-accent: #fff !important;  /* azzera il verde Elementor */
}

.cosaguardo-button a:hover,
li.cosaguardo-button > a:hover,
li.cosaguardo-button > a:focus,
.elementor-nav-menu li.cosaguardo-button > a:hover,
.elementor-nav-menu li.cosaguardo-button > a:focus,
.elementor-nav-menu--main li.cosaguardo-button > a:hover,
.elementor-nav-menu--main .elementor-nav-menu > li.cosaguardo-button > a:hover,
nav li.cosaguardo-button > a:hover {
    transform: scale(1.06) translateY(-1px) !important;
    color: #fff !important;
    /* Gradiente direttamente su <a>:hover — sovrasta qualsiasi background-color
       imposto da Elementor perché background-image ha la precedenza visiva su
       background-color, indipendentemente da chi "vince" su quest'ultimo. */
    background-image: linear-gradient(
        110deg,
        #e50914,
        #ff5f1f,
        #ffbe00,
        #ff5f1f,
        #e50914,
        #ff5f1f,
        #ffbe00
    ) !important;
    background-size: 400% 100% !important;
    background-color: transparent !important;
    animation: cgGrad 1.8s linear infinite, cgPulse 2.4s ease-in-out infinite alternate !important;
    filter: brightness(1.10) saturate(1.20) !important;
}

/* ::before sull'hover: rimane a opacity:0 (la regola base lo neutralizza già) */

/* ── Keyframes ── */
@keyframes cgGrad {
    0%   { background-position: 0%   center; }
    100% { background-position: 400% center; }
}

@keyframes cgPulse {
    from { box-shadow: 0 0  6px rgba(229, 9,  20, .50), 0 2px  6px rgba(0,0,0,.30); }
    to   { box-shadow: 0 0 24px rgba(255,190,  0, .80), 0 0 40px rgba(255,95,31,.40), 0 4px 14px rgba(0,0,0,.35); }
}

@keyframes cgShimmer {
    0%   { background-position:  200% center; }
    100% { background-position: -200% center; }
}

/* ════ Mobile — versione fire ════ */
@media (max-width: 768px) {

    li.cosaguardo-button,
    .cosaguardo-button {
        justify-content: center !important;
        margin: 6px 16px !important;
    }

    /* Gradiente fire statico direttamente su <a> (stesso approccio desktop,
       ma con colori più profondi e animazione brightness invece di scroll). */
    .cosaguardo-button a,
    li.cosaguardo-button > a {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        padding: 13px 24px !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        letter-spacing: 1.5px !important;
        text-transform: uppercase !important;
        border-radius: 12px !important;        /* rettangolare, non pill */
        background-image: linear-gradient(
            115deg,
            #c0000a,
            #e50914 20%,
            #ff5f1f 45%,
            #ffbe00 65%,
            #ff5f1f 80%,
            #e50914
        ) !important;
        background-size: 100% 100% !important;
        /* cgFirePulse: pulsazione brightness sul gradiente; cgPulseMobile: glow */
        animation: cgFirePulse 1.8s ease-in-out infinite alternate,
                   cgPulseMobile 1.8s ease-in-out infinite alternate !important;
    }
}

@keyframes cgPulseMobile {
    from { box-shadow: 0 0 10px rgba(229,  9, 20, .70), 0 3px 10px rgba(0,0,0,.40); }
    to   { box-shadow: 0 0 30px rgba(255,190,  0, .90), 0 0 55px rgba(255,95,31,.55), 0 5px 18px rgba(0,0,0,.45); }
}

@keyframes cgFirePulse {
    from { filter: brightness(0.95) saturate(1.1); }
    to   { filter: brightness(1.30) saturate(1.50); }
}
