/* Lo Squalo — Configuratore "Crea il tuo viaggio"
   Prima lo smartphone: un passaggio per schermata, pulsanti grandi,
   navigazione Indietro/Avanti fissa in basso. Usa i colori di styles.css. */

.page-viaggio .container { min-height: 100dvh; }

.cfg-header {
    text-align: center;
    padding: 18px 16px 6px;
}
.cfg-header .logo-mark { width: 130px; height: 36px; }
.cfg-title {
    margin-top: 6px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--blu-squalo);
}

.cfg {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 120px;
    flex: 1;
}

/* ---- avanzamento ---- */
.cfg-progress { margin: 8px 0 18px; }
.cfg-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.cfg-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: #e3dfd5;
    overflow: hidden;
}
.cfg-progress-bar span {
    display: block;
    height: 100%;
    background: var(--blu-squalo);
    transition: width .25s ease;
}

/* ---- passaggio ---- */
.cfg-step h2 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
}
.cfg-step .cfg-lead {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.cfg-step:focus { outline: none; }

.cfg-field { margin-bottom: 16px; }
.cfg-field > label,
.cfg-field > .cfg-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.cfg-field .cfg-help {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.cfg input[type="text"],
.cfg input[type="email"],
.cfg input[type="tel"],
.cfg input[type="number"],
.cfg input[type="date"],
.cfg input[type="month"],
.cfg select,
.cfg textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    font: inherit;
    font-size: 16px; /* evita lo zoom automatico su iPhone */
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid #d6d1c4;
    border-radius: 10px;
}
.cfg textarea { min-height: 88px; resize: vertical; }
.cfg input:focus, .cfg select:focus, .cfg textarea:focus {
    outline: none;
    border-color: var(--blu-squalo);
    box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.15);
}
.cfg-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cfg-row > * { min-width: 0; }
.cfg input[type="date"], .cfg input[type="month"] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }

/* ---- scelte grandi (tipo cliente, servizi) ---- */
.cfg-choices { display: grid; gap: 10px; }
.cfg-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 12px 14px;
    text-align: left;
    font: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid #d6d1c4;
    border-radius: 12px;
    cursor: pointer;
}
.cfg-choice strong { display: block; font-size: 0.98rem; font-weight: 600; }
.cfg-choice small { display: block; font-size: 0.8rem; color: var(--text-secondary); }
.cfg-choice .cfg-tick {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #c9c3b4;
}
.cfg-choice[aria-pressed="true"] {
    border-color: var(--blu-squalo);
    background: #eef4f7;
}
.cfg-choice[aria-pressed="true"] .cfg-tick {
    border-color: var(--blu-squalo);
    background: var(--blu-squalo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* dettagli di un servizio scelto */
.cfg-sub {
    margin: -4px 0 4px;
    padding: 12px 12px 4px;
    background: #fff;
    border: 1.5px solid var(--blu-squalo);
    border-top: 0;
    border-radius: 0 0 12px 12px;
}
.cfg-choice[aria-pressed="true"].has-sub { border-radius: 12px 12px 0 0; }

/* ---- etichette selezionabili ---- */
.cfg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cfg-chip {
    min-height: 40px;
    padding: 8px 14px;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: #fff;
    border: 1.5px solid #d6d1c4;
    border-radius: 20px;
    cursor: pointer;
}
.cfg-chip[aria-pressed="true"] {
    color: #fff;
    background: var(--blu-squalo);
    border-color: var(--blu-squalo);
}

/* ---- contatori persone ---- */
.cfg-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e3dfd5;
}
.cfg-counter strong { display: block; font-size: 0.95rem; font-weight: 600; }
.cfg-counter small { font-size: 0.78rem; color: var(--text-secondary); }
.cfg-stepper { display: flex; align-items: center; gap: 6px; }
.cfg-stepper button {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--blu-squalo);
    background: #fff;
    border: 1.5px solid #d6d1c4;
    border-radius: 50%;
    cursor: pointer;
}
.cfg-stepper input[type="number"] {
    width: 64px;
    min-height: 44px;
    text-align: center;
    padding: 6px;
}

/* ---- interruttore totale / per persona ---- */
.cfg-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.cfg-toggle .cfg-chip { flex: 1; }

.cfg-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 6px 0 12px;
}
.cfg-check input { width: 22px; height: 22px; flex: 0 0 22px; margin-top: 1px; accent-color: var(--blu-squalo); }

/* ---- avvisi ---- */
.cfg-note {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #5b5440;
    background: #f6eed6;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 12px 0;
}
.cfg-error {
    font-size: 0.85rem;
    color: #a3322a;
    margin: 6px 0 0;
}
.cfg-msg { padding: 20px 0; }

/* ---- riepilogo ---- */
.cfg-summary { display: grid; gap: 10px; }
.cfg-summary section {
    background: #fff;
    border: 1.5px solid #e3dfd5;
    border-radius: 12px;
    padding: 12px 14px;
}
.cfg-summary header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    text-align: left;
    margin-bottom: 4px;
}
.cfg-summary h3 { font-size: 0.85rem; font-weight: 600; color: var(--blu-squalo); }
.cfg-summary p, .cfg-summary li { font-size: 0.9rem; line-height: 1.45; }
.cfg-summary ul { padding-left: 18px; }
.cfg-edit {
    min-height: 36px;
    padding: 4px 12px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blu-squalo);
    background: transparent;
    border: 1.5px solid var(--blu-squalo);
    border-radius: 18px;
    cursor: pointer;
}

/* ---- conferma ---- */
.cfg-done { text-align: center; padding-top: 10px; }
.cfg-ref {
    display: inline-block;
    margin: 10px 0 14px;
    padding: 10px 18px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--blu-squalo);
    background: #fff;
    border: 1.5px dashed var(--blu-squalo);
    border-radius: 10px;
}
.cfg-done p { font-size: 0.92rem; line-height: 1.5; margin-bottom: 10px; }
.cfg-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 22px;
    margin-top: 6px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: #25D366;
    border-radius: 26px;
}

/* ---- "Preferisci scriverci?": WhatsApp con le scelte fatte finora, sotto ogni passo ---- */
.cfg-talk {
    margin: 22px 0 8px;
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
    border-top: 1px solid #e3dfd5;
    text-align: center;
}
.cfg-talk p { margin: 0 0 8px; }
.cfg-talk strong { color: var(--text-primary); }
.cfg-talk-link {
    display: inline-block;
    padding: 8px 18px;
    font-weight: 600;
    color: #128C4A;
    text-decoration: none;
    border: 1.5px solid #25D366;
    border-radius: 22px;
}
.cfg-talk-link:hover { background: #effaf3; }

/* ---- avviso dopo "Aggiungi al tuo viaggio" da una scheda ---- */
.cfg-added {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: #e8f1f5;
    border-left: 3px solid var(--blu-squalo);
    border-radius: 8px;
}

/* ---- barra Indietro / Avanti ---- */
.cfg-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(246, 244, 239, 0.96);
    border-top: 1px solid #e3dfd5;
}
.cfg-nav-inner { display: flex; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; }
.cfg-nav button {
    flex: 1;
    min-height: 52px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 26px;
    cursor: pointer;
}
.cfg-back { color: var(--blu-squalo); background: #fff; border: 1.5px solid var(--blu-squalo); }
.cfg-next { flex: 2 !important; color: #fff; background: var(--blu-squalo); border: 1.5px solid var(--blu-squalo); }
.cfg-next[disabled] { opacity: .6; cursor: wait; }
.cfg-back[hidden] { display: none; }

@media (min-width: 769px) {
    .cfg-header { padding-top: 28px; }
    .cfg-header .logo-mark { width: 170px; height: 46px; }
    .cfg-title { font-size: 1.35rem; }
    .cfg-step h2 { font-size: 1.4rem; }
}

.cfg-check a { color: var(--blu-squalo); }

/* ---- prezzo pubblico di partenza sotto il nome della voce ---- */
.cfg-chip .cfg-from { display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 500; opacity: 0.8; }
.cfg-price-note { margin-top: 6px; }
.cfg-group { margin: 10px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #6b6b6b; }
.cfg-group:first-child { margin-top: 0; }

/* Tema del configuratore: nessuna modifica a calcoli o invio. */
body.page-viaggio .cfg-header{padding:24px 18px 16px}
body.page-viaggio .cfg-header .logo-mark{width:230px;height:64px}
body.page-viaggio .cfg-title{font-size:clamp(23px,3vw,32px);font-weight:700;color:var(--text-primary);margin-top:15px}
body.page-viaggio .cfg{max-width:680px;padding-top:14px}
body.page-viaggio :is(.cfg-choice,.cfg-chip){border-color:var(--lsq-border);border-radius:12px;background:#fff}
body.page-viaggio :is(.cfg-choice,.cfg-chip)[aria-pressed=true]{border-color:var(--blu-squalo);background:var(--lsq-cream);color:var(--blu-squalo)}
body.page-viaggio .cfg-progress-bar{background:var(--lsq-cream)}
body.page-viaggio .cfg-nav{background:#fff;border-top:1px solid var(--lsq-border)}
@media(max-width:520px){body.page-viaggio .cfg-header{padding-top:55px}body.page-viaggio .cfg-header .logo-mark{width:190px;height:53px}}
