/* ============================================================
   CONFIGURATORE PREVENTIVO — /preventivo-online/
   Template: page-preventivo-online.php
   ============================================================ */

/* ---- HERO ---- */
#pv-hero {
    background: linear-gradient(135deg, var(--ink) 0%, var(--green-dark, #1e4d1c) 100%);
    color: var(--paper);
    padding: 5rem 2rem 4rem;
    text-align: center;
}
.pv-hero-inner { max-width: 900px; margin: 0 auto; }
.pv-eyebrow {
    text-transform: uppercase; letter-spacing: .1em;
    font-size: .8rem; font-weight: 600;
    color: var(--gold); margin: 0 0 1.5rem;
}
.pv-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700; line-height: 1.15;
    margin: 0 0 1.5rem; color: var(--paper);
}
.pv-title em { color: var(--green-light, #7dba79); font-style: italic; font-weight: 400; }
.pv-lead {
    font-size: 1.1rem; line-height: 1.6;
    max-width: 640px; margin: 0 auto 2.5rem;
    color: rgba(255,255,255,.85);
}
.pv-hero-cta {
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
    margin-bottom: 3rem;
}
.pv-hero-trust {
    display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap;
}
.pv-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    padding: .45rem .85rem; border-radius: 100px;
    font-size: .78rem; color: rgba(255,255,255,.85);
}
.pv-badge strong { color: var(--gold); font-weight: 700; }

/* ---- COME FUNZIONA ---- */
.pv-come-funziona { padding: 5rem 2rem; background: var(--cream); }
.pv-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px; margin: 3rem auto 0;
}
.pv-step {
    background: var(--paper);
    padding: 2rem 1.75rem;
    border-radius: 6px;
    border-top: 3px solid var(--green);
    position: relative;
}
.pv-step-num {
    position: absolute; top: -20px; left: 1.75rem;
    background: var(--green); color: var(--paper);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem; font-weight: 700;
}
.pv-step h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem; margin: 1rem 0 .75rem;
    color: var(--ink);
}
.pv-step p { color: var(--muted); line-height: 1.55; margin: 0; font-size: .95rem; }

/* ---- CONFIGURATORE ---- */
.pv-config { padding: 5rem 2rem; background: var(--paper); }
.pv-config-head { text-align: center; margin-bottom: 3rem; }

/* Card selettore prodotto */
.pv-cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    max-width: 1200px; margin: 0 auto 3rem;
}
.pv-cat-card {
    background: var(--cream);
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 1.5rem 1rem;
    display: flex; flex-direction: column; align-items: center; gap: .75rem;
    cursor: pointer;
    transition: all .25s ease;
    font-family: inherit;
    text-align: center;
    min-height: 130px;
    justify-content: center;
}
.pv-cat-card:hover {
    background: var(--paper);
    border-color: var(--green-light, #7dba79);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(15,26,14,.08);
}
.pv-cat-card[aria-selected="true"] {
    background: var(--green);
    border-color: var(--green);
    color: var(--paper);
}
.pv-cat-card[aria-selected="true"] .pv-cat-label { color: var(--paper); }
.pv-cat-icon { font-size: 2.25rem; line-height: 1; }
.pv-cat-label {
    font-size: .9rem; font-weight: 600; color: var(--ink);
    line-height: 1.3;
}

/* Pannello configuratore */
.pv-panel {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--cream);
    border-radius: 8px;
    padding: 2.5rem;
    border-top: 4px solid var(--green);
}
.pv-panel-head {
    display: flex; align-items: flex-start; gap: 1.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(15,26,14,.08);
}
.pv-panel-icon {
    font-size: 3rem; line-height: 1;
    background: var(--paper);
    width: 70px; height: 70px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pv-panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem; font-weight: 700;
    color: var(--ink); margin: 0 0 .5rem;
}
.pv-panel-desc { color: var(--muted); margin: 0; font-size: .95rem; line-height: 1.5; }

/* Info box (link correlati) */
.pv-info-box {
    background: rgba(59,140,55,.08);
    border-left: 3px solid var(--green);
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    font-size: .9rem; color: var(--ink);
    line-height: 1.5;
}
.pv-info-box a { color: var(--green); font-weight: 600; }

/* Campi */
.pv-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
}
.pv-field { display: flex; flex-direction: column; }
.pv-field[data-fullwidth="true"] { grid-column: 1 / -1; }
.pv-field-label {
    font-weight: 600; font-size: .9rem;
    color: var(--ink); margin-bottom: .5rem;
    display: block;
}
.pv-req { color: var(--green); margin-left: .15rem; }

.pv-select, .pv-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid rgba(15,26,14,.15);
    border-radius: 4px;
    background: var(--paper);
    font-family: inherit;
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .2s;
}
.pv-select:focus, .pv-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(59,140,55,.15);
}

.pv-radio-group, .pv-check-group {
    display: flex; flex-direction: column; gap: .5rem;
}
.pv-check-group { max-height: 180px; overflow-y: auto; padding-right: .5rem; }
.pv-radio, .pv-check {
    display: flex; align-items: flex-start; gap: .6rem;
    cursor: pointer; padding: .35rem 0;
    font-size: .9rem; line-height: 1.4;
    color: var(--ink);
}
.pv-radio input, .pv-check input {
    margin-top: .15rem; flex-shrink: 0;
    accent-color: var(--green);
}

.pv-field-note {
    font-size: .8rem; color: var(--muted);
    margin: .5rem 0 0; font-style: italic;
    line-height: 1.4;
}

.pv-info-bottom {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: rgba(59,140,55,.08);
    border-radius: 4px;
    color: var(--ink);
    font-size: .9rem;
}

/* Empty state (nessuna categoria selezionata) */
.pv-empty {
    text-align: center; padding: 3rem 2rem;
    background: var(--cream);
    border-radius: 6px; max-width: 640px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1rem;
}
.pv-empty p { margin: 0; }

/* ---- FORM CONTATTI ---- */
.pv-contatti { padding: 5rem 2rem; background: var(--cream); }
.pv-form {
    max-width: 720px; margin: 0 auto;
    background: var(--paper);
    padding: 2.5rem;
    border-radius: 8px;
}
.pv-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.pv-form-field { display: flex; flex-direction: column; margin-bottom: 1.25rem; }
.pv-form-field label {
    font-weight: 600; font-size: .9rem;
    color: var(--ink); margin-bottom: .5rem;
}
.pv-form-field input, .pv-form-field textarea {
    padding: .75rem 1rem;
    border: 1px solid rgba(15,26,14,.15);
    border-radius: 4px;
    background: var(--paper);
    font-family: inherit;
    font-size: .95rem;
    color: var(--ink);
}
.pv-form-field input:focus, .pv-form-field textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(59,140,55,.15);
}
.pv-form-field textarea { resize: vertical; min-height: 100px; }

.pv-privacy .pv-check {
    font-size: .85rem;
    color: var(--muted);
}
.pv-privacy a { color: var(--green); text-decoration: underline; }

.pv-form-submit {
    text-align: center; margin-top: 2rem;
}
.pv-form-submit button {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-width: 260px;
}
.pv-form-help {
    margin-top: .75rem; font-size: .8rem; color: var(--muted);
}

.pv-form-msg {
    margin-top: 1.5rem; padding: 1rem;
    border-radius: 4px; text-align: center;
    font-size: .9rem;
}
.pv-form-msg.pv-msg-ok {
    background: rgba(59,140,55,.15);
    color: var(--green);
    border: 1px solid var(--green);
}
.pv-form-msg.pv-msg-err {
    background: rgba(200,60,60,.1);
    color: #a53030;
    border: 1px solid #a53030;
}

/* ---- TRUST ---- */
.pv-trust { padding: 5rem 2rem; background: var(--paper); }
.pv-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px; margin: 3rem auto 0;
}
.pv-trust-card {
    text-align: center;
    padding: 2rem 1.25rem;
    background: var(--cream);
    border-radius: 6px;
    border-top: 3px solid var(--green);
}
.pv-trust-num {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem; font-weight: 700;
    color: var(--gold); display: block;
    line-height: 1; margin-bottom: 1rem;
}
.pv-trust-card p {
    color: var(--muted); line-height: 1.5;
    font-size: .9rem; margin: 0;
}
.pv-trust-card strong { color: var(--ink); }

/* ---- FAQ ---- */
.pv-faq { padding: 5rem 2rem; background: var(--cream); }
.pv-faq-list {
    max-width: 720px; margin: 3rem auto 0;
    display: flex; flex-direction: column; gap: .75rem;
}
.pv-faq-item {
    background: var(--paper);
    border-radius: 6px;
    border-left: 3px solid var(--green);
    overflow: hidden;
}
.pv-faq-item summary {
    padding: 1.15rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    font-size: 1rem;
    list-style: none;
    display: flex; align-items: center; justify-content: space-between;
}
.pv-faq-item summary::-webkit-details-marker { display: none; }
.pv-faq-item summary::after {
    content: '+';
    font-size: 1.5rem; font-weight: 300;
    color: var(--green);
    transition: transform .2s;
}
.pv-faq-item[open] summary::after {
    transform: rotate(45deg);
}
.pv-faq-item p {
    padding: 0 1.5rem 1.25rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    font-size: .9rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .pv-fields { grid-template-columns: 1fr; }
    .pv-steps { grid-template-columns: 1fr; max-width: 500px; gap: 2.5rem; }
    .pv-trust-grid { grid-template-columns: repeat(2, 1fr); }
    .pv-cats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
    #pv-hero { padding: 3.5rem 1.25rem; }
    .pv-config, .pv-contatti, .pv-trust, .pv-faq, .pv-come-funziona { padding: 3.5rem 1.25rem; }
    .pv-panel { padding: 1.75rem 1.25rem; }
    .pv-panel-head { flex-direction: column; gap: .75rem; }
    .pv-panel-icon { width: 55px; height: 55px; font-size: 2.25rem; }
    .pv-panel-title { font-size: 1.4rem; }
    .pv-form { padding: 1.75rem 1.25rem; }
    .pv-form-row { grid-template-columns: 1fr; gap: 0; }
    .pv-cats-grid { grid-template-columns: repeat(2, 1fr); }
    .pv-cat-card { min-height: 110px; padding: 1.15rem .5rem; }
    .pv-cat-icon { font-size: 1.75rem; }
    .pv-cat-label { font-size: .8rem; }
}

/* ═══════════════════════════════════════════════════════════════
   VISUAL RADIO (icone piega Pieghevoli)
═══════════════════════════════════════════════════════════════ */
.pv-visual-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
    margin-top: .25rem;
}
.pv-visual-radio {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 1rem .75rem;
    background: var(--paper);
    border: 1.5px solid var(--border, #e5ddc7);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
    gap: .5rem;
}
.pv-visual-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.pv-visual-radio:hover {
    border-color: var(--green-mid, #5da058);
    background: var(--cream);
    transform: translateY(-1px);
}
.pv-visual-radio:has(input:checked) {
    border-color: var(--green, #3b8c37);
    background: var(--cream);
    box-shadow: 0 0 0 3px rgba(59,140,55,.12);
}
.pv-vr-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #666);
    transition: color .2s;
    min-height: 40px;
}
.pv-visual-radio:has(input:checked) .pv-vr-icon {
    color: var(--green, #3b8c37);
}
.pv-vr-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.pv-vr-sub {
    font-size: .75rem;
    color: var(--muted, #666);
    line-height: 1.35;
}

/* ═══════════════════════════════════════════════════════════════
   QUANTITÀ CUSTOM (appare quando si sceglie "Altra")
═══════════════════════════════════════════════════════════════ */
.pv-quantita-custom {
    display: block;
    width: 100%;
    margin-top: .625rem;
    padding: .625rem .75rem;
    font-size: .95rem;
    border: 1.5px solid var(--green, #3b8c37);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    animation: pv-fade-in .25s ease-out;
}
.pv-quantita-custom:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,140,55,.18);
}
@keyframes pv-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .pv-visual-radio-group {
        grid-template-columns: repeat(2, 1fr);
        gap: .5rem;
    }
    .pv-visual-radio {
        padding: .75rem .5rem;
    }
    .pv-vr-label { font-size: .8rem; }
    .pv-vr-sub   { font-size: .7rem; }
}
