/* Classi legacy rimosse il 6 settembre 2026: .ts-rewards-summary-cards,
   .ts-rewards-level-progress e le prime versioni di .ts-rewards-card e della
   tabella movimenti non erano più usate da nessun template e ridefinivano gli
   stessi selettori della pagina punti con un'altra tavolozza. */


/* ===========================================================================
   Pagina punti — area account
   ---------------------------------------------------------------------------
   Il tema VIGAL ha una tavolozza sola: nero, sabbia (#F2EBE5), bianco, Poppins,
   bottoni maiuscoli con raggio 5px. La pagina punti parla quella lingua e non
   ne introduce un'altra: nessun viola, nessun verde, nessuna emoji. Tutti i
   riquadri sono uguali — fondo bianco, filo di bordo, stesso raggio — così la
   pagina si legge come una colonna sola: a distinguerli sono le etichette e i
   numeri, non i fondi colorati, che la trasformerebbero in un arlecchino. La
   sabbia resta solo dove non è una carta: la pastiglia del codice coupon e la
   pista delle barre di avanzamento.
   =========================================================================== */

.ts-rewards-points {
    --ts-ink: #1a1a1a;
    --ts-text: #363636;
    --ts-muted: #8a8178;
    --ts-sand: #f2ebe5;
    --ts-sand-deep: #e6dcd2;
    --ts-line: #e3dad1;
    --ts-radius: 5px;

    max-width: 100%;
    color: var(--ts-text);
}

.ts-rewards-points *,
.ts-rewards-points *::before,
.ts-rewards-points *::after {
    box-sizing: border-box;
}

/* --- etichette e bottoni, gli unici due elementi ripetuti ovunque ---------- */

.ts-rewards-points .ts-rewards-card__label,
.ts-rewards-points .ts-rewards-redeem__title,
.ts-rewards-points .ts-rewards-hero__unit,
.ts-rewards-points .ts-rewards-hero__level {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ts-rewards-points .ts-rewards-btn {
    display: inline-block;
    padding: 12px 26px;
    border: 1px solid var(--ts-ink);
    border-radius: var(--ts-radius);
    background: transparent;
    /* !important a malincuore, ma serve: il widget My Account di Elementor colora
       OGNI link dentro l'area account con
       `.elementor-widget-woocommerce-my-account … .woocommerce a`, che pesa più di
       qualunque selettore ragionevole di questo foglio. Senza, il bottone nero si
       ritrova il testo nero del tema — invisibile — e il colore dipenderebbe
       dall'ordine di caricamento dei CSS. */
    color: var(--ts-ink) !important;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.ts-rewards-points .ts-rewards-btn:hover,
.ts-rewards-points .ts-rewards-btn:focus-visible {
    background: var(--ts-ink);
    color: #fff !important;
}

.ts-rewards-points .ts-rewards-btn--primary {
    background: var(--ts-ink);
    color: #fff !important;
}

.ts-rewards-points .ts-rewards-btn--primary:hover,
.ts-rewards-points .ts-rewards-btn--primary:focus-visible {
    background: #000;
    color: #fff !important;
}

/* --- 1. Saldo e stato livello (UX §4, priorità 1 e 5) --------------------- */

.ts-rewards-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 34px 32px;
    margin: 0 0 18px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

.ts-rewards-hero__balance {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ts-rewards-hero__value {
    font-size: clamp(38px, 7vw, 54px);
    font-weight: 500;
    line-height: 1;
    color: var(--ts-ink);
    font-variant-numeric: tabular-nums;
}

.ts-rewards-hero__unit {
    color: var(--ts-muted);
}

.ts-rewards-hero__empty h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 500;
    color: var(--ts-ink);
}

.ts-rewards-hero__empty p {
    margin: 0;
    font-size: 14px;
    color: var(--ts-muted);
}

.ts-rewards-hero__level {
    padding: 7px 16px;
    border: 1px solid var(--ts-ink);
    border-radius: 999px;
    color: var(--ts-ink);
    white-space: nowrap;
}

/* --- Messaggi in evidenza: coupon pronto, livello da difendere ------------ */

.ts-rewards-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    margin: 0 0 18px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-left: 3px solid var(--ts-ink);
    border-radius: var(--ts-radius);
}

.ts-rewards-banner__title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--ts-ink);
}

.ts-rewards-banner__note {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ts-muted);
}

.ts-rewards-banner__code {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: var(--ts-sand);
    border-radius: var(--ts-radius);
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--ts-ink);
}

/* --- 2 e 3. Le due progressioni (UX §4, §7) ------------------------------- */

.ts-rewards-progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 0 0 18px;
}

.ts-rewards-card {
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

/* Il livello sta su fondo sabbia: si distingue dal vantaggio senza colori
   estranei alla tavolozza. */
.ts-rewards-card--level {
    background: #fff;
    border-color: var(--ts-line);
}

.ts-rewards-card__label {
    display: block;
    color: var(--ts-muted);
}

.ts-rewards-card__headline {
    margin: 8px 0 14px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ts-ink);
}

.ts-rewards-card__goal {
    display: block;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ts-muted);
}

.ts-rewards-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--ts-sand-deep);
    overflow: hidden;
}

.ts-rewards-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ts-ink);
    transition: width .4s ease;
}

/* --- 4. Vantaggi disponibili: una riga sola ------------------------------- */

.ts-rewards-advantages-row {
    padding: 16px 22px;
    margin: 0 0 18px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

.ts-rewards-advantages-row__title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ts-ink);
}

.ts-rewards-advantages-row__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.ts-rewards-advantages-row__list li {
    position: relative;
    padding-left: 16px;
    font-size: 13.5px;
    color: var(--ts-text);
}

.ts-rewards-advantages-row__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ts-ink);
}

/* --- Riscatto ------------------------------------------------------------- */

.ts-rewards-redeem {
    padding: 22px 24px;
    margin: 0 0 18px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

.ts-rewards-redeem__title {
    margin: 0 0 16px;
    color: var(--ts-muted);
}

.ts-rewards-tier-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

/* La soglia consigliata: fondo sabbia e bordo pieno, senza cambiare famiglia
   di colori. */
.ts-rewards-tier-card--best {
    background: #fff;
    border-color: var(--ts-ink);
}

.ts-rewards-tier-card--selected {
    box-shadow: 0 0 0 2px var(--ts-ink);
}

.ts-rewards-tier-card__info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
}

.ts-rewards-tier-card__points {
    font-size: 15px;
    font-weight: 500;
    color: var(--ts-ink);
    font-variant-numeric: tabular-nums;
}

.ts-rewards-tier-card__value {
    font-size: 14px;
    color: var(--ts-text);
}

.ts-rewards-tier-card__minspend {
    font-size: 12.5px;
    color: var(--ts-muted);
}

.ts-rewards-redeem__more {
    margin-top: 14px;
}

.ts-rewards-redeem__more > summary,
.ts-rewards-history > summary {
    cursor: pointer;
    padding: 12px 0;
    font-size: 13px;
    color: var(--ts-ink);
    list-style: none;
}

.ts-rewards-redeem__more > summary::-webkit-details-marker,
.ts-rewards-history > summary::-webkit-details-marker {
    display: none;
}

.ts-rewards-redeem__more > summary::before,
.ts-rewards-history > summary::before {
    content: "+";
    display: inline-block;
    width: 16px;
    font-weight: 500;
    color: var(--ts-muted);
}

.ts-rewards-redeem__more[open] > summary::before,
.ts-rewards-history[open] > summary::before {
    content: "–";
}

.ts-rewards-tier-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.ts-rewards-redeem-confirm {
    margin-top: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

.ts-rewards-redeem-confirm p {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--ts-ink);
}

.ts-rewards-redeem-confirm .ts-rewards-btn + .ts-rewards-btn {
    margin-left: 8px;
}

.ts-rewards-redeem-message {
    margin-top: 12px;
    font-size: 13.5px;
}

.ts-rewards-redeem-message--success {
    color: #1f6b4a;
}

.ts-rewards-redeem-message--error {
    color: #a3302a;
}

/* --- Storico movimenti ---------------------------------------------------- */

.ts-rewards-history {
    padding: 4px 22px 8px;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
}

.ts-rewards-history[open] {
    padding-bottom: 18px;
}

.ts-rewards-ledger-table {
    width: 100%;
    margin: 6px 0 0;
    border-collapse: collapse;
    font-size: 13.5px;
}

.ts-rewards-ledger-table th {
    padding: 10px 8px;
    border-bottom: 1px solid var(--ts-line);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    color: var(--ts-muted);
}

.ts-rewards-ledger-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f2efec;
    vertical-align: top;
}

.ts-rewards-ledger-table tr:last-child td {
    border-bottom: none;
}

/* I movimenti si leggono dal segno, non dal colore: il verde e il rosso qui
   sarebbero due tinte in più senza aggiungere informazione. */
.ts-rewards-points--positive {
    color: var(--ts-ink);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.ts-rewards-points--negative {
    color: var(--ts-muted);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
    .ts-rewards-hero {
        padding: 26px 22px;
    }

    .ts-rewards-tier-card {
        align-items: flex-start;
    }

    .ts-rewards-tier-card .ts-rewards-btn {
        width: 100%;
        text-align: center;
    }
}


.ts-rewards-birthday-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ts-rewards-birthday-form input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.ts-rewards-birthday-success {
    margin-top: 8px;
    padding: 8px 12px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 13px;
}

.ts-rewards-loyalty-page {
    max-width: 800px;
    margin: 0 auto;
}

.ts-rewards-loyalty-hero {
    text-align: center;
    padding: 48px 24px;
    /* Nero pieno: la sfumatura verso il viola era l'ultimo pezzo di una tavolozza
       che il tema non ha. */
    background: #1a1a1a;
    border-radius: 5px;
    color: #fff;
    margin-bottom: 32px;
}

.ts-rewards-loyalty-hero__title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
}

.ts-rewards-loyalty-hero__subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.ts-rewards-loyalty-hero__personal {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.ts-rewards-loyalty-hero__balance {
    font-size: 32px;
    font-weight: 800;
}

.ts-rewards-loyalty-hero__balance-label {
    font-size: 14px;
    opacity: 0.85;
}

.ts-rewards-loyalty-hero__level {
    font-size: 14px;
    opacity: 0.85;
}

.ts-rewards-loyalty-section {
    margin-bottom: 32px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e3dad1;
    border-radius: 5px;
}

.ts-rewards-loyalty-section__title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}

.ts-rewards-loyalty-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ts-rewards-loyalty-step {
    text-align: center;
    padding: 20px;
    background: #f2ebe5;
    border-radius: 5px;
}

/* Numeri, non emoji: i passi sono due e in ordine, e il resto del programma non
   parla per faccine. */
.ts-rewards-loyalty-step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    border: 1px solid #1a1a1a;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

.ts-rewards-loyalty-step p {
    font-size: 14px;
    color: #555;
    margin: 0;
}

.ts-rewards-loyalty-table-wrapper {
    overflow-x: auto;
}

.ts-rewards-loyalty-table {
    width: 100%;
    border-collapse: collapse;
}

.ts-rewards-loyalty-table th,
.ts-rewards-loyalty-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.ts-rewards-loyalty-table th {
    background: #f8f9fa;
    font-weight: 700;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
}

.ts-rewards-loyalty-table td {
    font-size: 14px;
}

.ts-rewards-loyalty-note {
    font-size: 13px;
    color: #888;
    margin: 12px 0 0;
    font-style: italic;
}

.ts-rewards-loyalty-cta {
    text-align: center;
    padding: 32px 24px;
}

.ts-rewards-loyalty-cta .button {
    font-size: 16px;
    padding: 14px 32px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.ts-rewards-loyalty-cta .button:hover {
    background: #000;
}

@media (max-width: 768px) {
    .ts-rewards-loyalty-steps {
        grid-template-columns: 1fr;
    }

    .ts-rewards-loyalty-hero__title {
        font-size: 22px;
    }
}

.ts-rewards-product-widget {
    margin: 12px 0;
    font-size: 14px;
    position: relative;
}

/* Stessa carta color sabbia della pagina punti: l'annuncio si legge come parte del
   programma fedeltà, non come l'ennesimo badge del tema. */
.ts-rewards-product-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: #f2ebe5;
    border: 1px solid #e3dad1;
    border-radius: 5px;
    font-weight: 600;
    letter-spacing: .01em;
    color: #1a1a1a;
    cursor: default;
}

.ts-rewards-tooltip-trigger {
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    vertical-align: middle;
    color: #8a8178;
}

.ts-rewards-tooltip-trigger:hover {
    color: #1a1a1a;
}

.ts-rewards-tooltip {
    display: none;
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid #e3dad1;
    border-radius: 5px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 260px;
    max-width: 320px;
    margin-top: 8px;
}

.ts-rewards-tooltip--visible {
    display: block;
}

.ts-rewards-cart-widget {
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid #e9ecef;
}

.ts-rewards-cart-points {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.ts-rewards-cart-points__earn {
    color: #008a20;
    font-weight: 600;
}

.ts-rewards-cart-points__missing {
    color: #cc6b2c;
}

.ts-rewards-cart-points__gap {
    color: #d63638;
    font-weight: 600;
}

.ts-rewards-checkout-widget {
    margin: 16px 0;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
}

.ts-rewards-checkout-coupon-gap {
    color: #d63638;
    font-weight: 600;
    font-size: 14px;
}

.ts-rewards-checkout-coupon-apply {
    text-align: center;
}

.ts-rewards-checkout-coupon-apply__title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.ts-rewards-checkout-coupon-apply__value {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.ts-rewards-checkout-coupon-apply__code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ts-rewards-coupon-code-display {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 8px 12px;
    background: #fff;
    border: 1px dashed #1a1a1a;
    border-radius: 4px;
}

.ts-rewards-apply-coupon-btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ts-rewards-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ts-rewards-card__value {
        font-size: 22px;
    }

    .ts-rewards-tooltip {
        min-width: 200px;
        max-width: 280px;
    }

    .ts-rewards-checkout-coupon-apply__code {
        flex-direction: column;
    }
}

/* Riga del gadget nel carrello: deve leggersi come un regalo, non come un prodotto
   aggiunto per sbaglio. */
.ts-rewards-gadget-badge {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a1a;
}

/* Missioni e referral: due card in fondo alla pagina punti, spente per default */
.ts-rewards-mission-list { list-style: none; margin: 0; padding: 0; }
.ts-rewards-mission {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ts-line);
}
.ts-rewards-mission:last-child { border-bottom: 0; }
.ts-rewards-mission__testo { display: flex; flex-direction: column; gap: 4px; max-width: 60ch; }
.ts-rewards-mission__desc { font-size: 0.9em; opacity: 0.75; }
.ts-rewards-mission__azione { display: flex; align-items: center; gap: 12px; }
.ts-rewards-mission__punti { font-weight: 600; white-space: nowrap; }
.ts-rewards-mission__fatto,
.ts-rewards-mission__attesa { font-size: 0.85em; opacity: 0.7; white-space: nowrap; }
.ts-rewards-mission__msg { flex-basis: 100%; margin: 6px 0 0; font-size: 0.9em; }
.ts-rewards-referral__link input {
    width: 100%;
    font-family: monospace;
    padding: 10px 12px;
    border: 1px solid var(--ts-line);
    border-radius: 6px;
    background: #fff;
}
.ts-rewards-referral__conto { margin: 8px 0 0; font-size: 0.9em; opacity: 0.8; }

/* Avviso del coupon in carrello e checkout: un messaggio e un pulsante, mai un campo.
   Il campo dove si scrive un codice sul sito è uno solo, quello di WooCommerce. */
.ts-rewards-coupon-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 12px 0;
    padding: 12px 16px;
    border: 1px solid var(--ts-line, #e3ded6);
    border-radius: 8px;
    background: #fff;
}
.ts-rewards-coupon-notice__text { margin: 0; flex: 1 1 240px; }
.ts-rewards-coupon-notice.is-waiting { border-style: dashed; opacity: 0.9; }
.ts-rewards-coupon-notice__btn {
    flex: 0 0 auto;
    padding: 10px 18px;
    border: 0;
    border-radius: 5px;
    background: #1a1a1a;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}
.ts-rewards-coupon-notice__btn:hover { background: #333; }
/* Un lampo sul campo appena riempito: senza, il salto della pagina non si capisce. */
.ts-rewards-coupon-target {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
    transition: outline-color .3s ease;
}
/* Nel carrello l'avviso nasce dentro il form del coupon, che è un flex: senza questa
   riga si infilerebbe accanto al campo e allungherebbe il pulsante, che è il difetto
   appena corretto nel tema. Qui si prende una riga tutta sua, sotto il campo. */
.wd-coupon-form .ts-rewards-coupon-notice { flex: 1 1 100%; }

/* Il codice del salone, scritto nel campo dei coupon come qualsiasi altro codice. */
.ts-rewards-salon-code-msg { flex: 1 1 100%; margin: 6px 0 0; font-size: 0.95em; }
.ts-rewards-salon-code-msg.is-attesa { opacity: 0.7; }
.ts-rewards-salon-code-msg.is-ko { color: #ca1919; }
.ts-rewards-salon-code-msg.is-ok { color: #1a6b37; }
.ts-rewards-salon-code-active {
    flex: 1 1 100%;
    margin: 8px 0 0;
    padding: 10px 14px;
    border: 1px solid var(--ts-line, #e3ded6);
    border-radius: 8px;
    background: #fff;
    font-size: 0.95em;
}
.ts-rewards-salon-code-active a { margin-left: 10px; text-decoration: underline; }
