/* =============================================================
   pectus-size-chips.css
   /wp-content/themes/tuo-tema-figlio/css/pectus-size-chips.css
   ============================================================= */

/* Chips row */
.psc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--psc-gap, 8px);
}

/* Chip */
.psc-chip {
    padding: 8px 18px;
    border: 1px solid #E4E0D8;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.65;
    color: #6B7A85;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .18s, color .18s, background .18s;
    box-sizing: border-box;
}
.psc-chip:hover         { border-color: #1A9080; color: #1A9080; }
.psc-chip:focus-visible { outline: 2px solid #1A9080; outline-offset: 2px; }
.psc-chip.active        { background: #1A9080; border-color: #1A9080; color: #fff; }

/*
 * PORTAL ROOT — creato via JS, non ha stili propri,
 * ma serve che il browser non lo nasconda.
 */
#psc-portal-root {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}

/*
 * TOOLTIP
 *
 * position: absolute dentro il portal fixed a (0,0).
 * Le coordinate vengono impostate direttamente in viewport px via JS.
 * Nessun overflow:hidden può tagliarlo perché il portal è fuori
 * da ogni stacking context del tema.
 *
 * RESET TIPOGRAFICO COMPLETO:
 * Il tooltip viene renderizzato nel portal, al di fuori della
 * struttura DOM di Bricks. Senza reset espliciti, il browser
 * può ereditare font-size/line-height dalle regole CSS globali
 * del tema (body, html, sezioni), gonfiando l'altezza del tooltip
 * e rendendo il posizionamento imprevedibile.
 */
.psc-tooltip {
    position: absolute;
    pointer-events: auto;

    /* Dimensioni */
    width: 300px;
    box-sizing: border-box;
    padding: 16px 18px;

    /* Bordi e sfondo */
    background: #ffffff;
    border: 1px solid #E4E0D8;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13);

    /* Reset tipografia — valori px fissi, niente rem/em */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    color: #0E1820;

    /* Animazione */
    animation: psc-in .16s ease;
}

/* Tutti i figli ereditano il reset, non i valori del tema */
.psc-tooltip,
.psc-tooltip * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

@keyframes psc-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Freccia */
.psc-tt-arrow {
    position: absolute;
    top: -5px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-left:  1px solid #E4E0D8;
    border-top:   1px solid #E4E0D8;
    transform: rotate(45deg);
}
.psc-tooltip.flip .psc-tt-arrow {
    top: auto;
    bottom: -5px;
    border-left:  none;
    border-top:   none;
    border-right:  1px solid #E4E0D8;
    border-bottom: 1px solid #E4E0D8;
}

/* Contenuto — tutto in px, nessun rem */
.psc-tt-title {
    font-size: 19px;
    font-weight: 400;
    color: #0E1820;
    line-height: 1.1;
    margin: 0 0 4px;
}
.psc-tt-range {
    font-size: 11px;
    font-weight: 500;
    color: #1A9080;
    line-height: 1;
    margin: 0 0 10px;
    letter-spacing: 0;
}
.psc-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 12px;
}
.psc-badge-child { background: #EAF6F4; color: #0F5045; }
.psc-badge-adult { background: #EBF2FE; color: #1A3A8F; }
.psc-badge-pro   { background: #EEEDF8; color: #3D3580; }

.psc-tt-divider {
    height: 1px;
    background: #E4E0D8;
    margin: 0 0 10px;
}
.psc-tt-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 7px;
}
.psc-tt-row:last-of-type { margin-bottom: 0; }
.psc-tt-label { color: #6B7A85; flex-shrink: 0; }
.psc-tt-val   { color: #0E1820; font-weight: 500; text-align: right; max-width: 158px; }
.psc-tt-muted { color: #6B7A85; font-weight: 400; }

.psc-tt-link {
    display: block;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #E4E0D8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    line-height: 1;
    color: #1A9080;
    text-decoration: none;
    transition: color .18s;
}
.psc-tt-link:hover { color: #0F6A5A; }

/* Mobile */
@media (max-width: 640px) {
    .psc-tooltip { width: calc(100vw - 32px); }
}
