/* ==========================================================================
   RistoPizza — Checkout frontend
   @version 1.0.1 | 05/04/2026
   ========================================================================== */

/* ── Reset base ──────────────────────────────────────────────────────────── */
.rp-co-contenitore *,
.rp-co-contenitore *::before,
.rp-co-contenitore *::after {
    box-sizing: border-box;
}

/* ── Contenitore principale ──────────────────────────────────────────────── */
.rp-co-contenitore {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    font-family: inherit;
    color: #222;
}

/* ── Layout due colonne (desktop) ───────────────────────────────────────── */
.rp-co-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 900px) {
    .rp-co-form {
        grid-template-columns: 1fr 340px;
        gap: 2rem;
        align-items: start;
    }
}

/* ── Sezioni (steps) ────────────────────────────────────────────────────── */
.rp-co-sezione {
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color .2s;
}

.rp-co-sezione:last-child {
    margin-bottom: 0;
}

.rp-co-step--bloccato {
    opacity: .45;
    pointer-events: none;
    user-select: none;
}

.rp-co-step--nascosto {
    display: none;
}

.rp-co-step--attivo {
    border-color: #e84b16;
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.rp-co-step--completato {
    opacity: 1;
    pointer-events: auto;
    border-color: #d0d0d0;
}

/* ── Titoli sezione ─────────────────────────────────────────────────────── */
.rp-co-sezione-titolo {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #111;
}

.rp-co-sezione-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e84b16;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rp-co-step--completato .rp-co-sezione-numero {
    background: #4caf50;
}

/* ── Riepilogo prodotti ─────────────────────────────────────────────────── */
.rp-co-lista-prodotti {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .75rem;
}

.rp-co-prod-riga {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: .9rem;
    gap: .5rem;
}

.rp-co-prod-info { flex: 1; }

.rp-co-prod-nome {
    font-weight: 600;
    display: block;
}

.rp-co-prod-dettagli {
    font-size: .8rem;
    color: #666;
}

.rp-co-prod-prezzo {
    font-weight: 600;
    white-space: nowrap;
    color: #e84b16;
}

.rp-co-subtotale-riga {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    border-top: 1px solid #eee;
    padding-top: .5rem;
    margin-top: .5rem;
}

.rp-co-link-modifica {
    display: inline-block;
    font-size: .8rem;
    color: #999;
    margin-top: .5rem;
    text-decoration: underline;
}

/* ── Tipo ordine ────────────────────────────────────────────────────────── */
.rp-co-tipo-bottoni {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.rp-co-tipo-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1.25rem .75rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: center;
}

.rp-co-tipo-btn:hover {
    border-color: #e84b16;
    background: #fff8f6;
}

.rp-co-tipo-btn--selezionato {
    border-color: #e84b16;
    background: #fff3f0;
}

.rp-co-tipo-icona { font-size: 2rem; }

.rp-co-tipo-etichetta {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}

.rp-co-tipo-sub {
    font-size: .8rem;
    color: #777;
}

/* ── Campi form ─────────────────────────────────────────────────────────── */
.rp-co-campo-gruppo {
    margin-bottom: .9rem;
}

.rp-co-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: .3rem;
}

.rp-co-req { color: #e84b16; }

.rp-co-input {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #111;
    background: #fff;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
}

.rp-co-input:focus {
    outline: none;
    border-color: #e84b16;
}

.rp-co-input--errore {
    border-color: #d32f2f;
}

.rp-co-textarea {
    resize: vertical;
    min-height: 70px;
}

.rp-co-errore {
    display: block;
    font-size: .8rem;
    color: #d32f2f;
    margin-top: .25rem;
}

.rp-co-riga-2col {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: .75rem;
}

/* ── Verifica zona ──────────────────────────────────────────────────────── */
.rp-co-zona-risultato {
    margin-top: .75rem;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
}

.rp-co-zona-risultato--ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.rp-co-zona-risultato--errore {
    background: #fce4e4;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ── Slot orari ─────────────────────────────────────────────────────────── */
.rp-co-slot-griglia {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.rp-co-slot-btn {
    padding: .5rem .9rem;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    background: #fafafa;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    color: #111;
}

.rp-co-slot-btn:hover {
    border-color: #e84b16;
    background: #fff8f6;
}

.rp-co-slot-btn--selezionato {
    border-color: #e84b16;
    background: #e84b16;
    color: #fff;
}

.rp-co-slot-loading,
.rp-co-slot-vuoto {
    font-size: .9rem;
    color: #777;
    padding: .5rem 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.rp-co-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #e84b16;
    border-radius: 50%;
    animation: rp-spin .7s linear infinite;
}

@keyframes rp-spin { to { transform: rotate(360deg); } }

.rp-co-orario-avviso {
    margin-top: .75rem;
    font-size: .85rem;
    color: #555;
    background: #fffde7;
    border: 1px solid #fff176;
    border-radius: 8px;
    padding: .6rem .9rem;
    display: flex;
    align-items: flex-start;
    gap: .4rem;
}

/* ── Coupon ─────────────────────────────────────────────────────────────── */
.rp-co-coupon-wrap { margin-bottom: 1.25rem; }

.rp-co-coupon-riga {
    display: flex;
    gap: .5rem;
}

.rp-co-input--coupon {
    letter-spacing: .05em;
    font-weight: 700;
    flex: 1;
}

.rp-co-coupon-esito {
    margin-top: .5rem;
    font-size: .85rem;
    padding: .5rem .75rem;
    border-radius: 7px;
}

.rp-co-coupon-esito--ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.rp-co-coupon-esito--errore {
    background: #fce4e4;
    color: #c62828;
}

/* ── Importi ────────────────────────────────────────────────────────────── */
.rp-co-importi {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.rp-co-importo-riga {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    color: #444;
}

.rp-co-importo-riga--sconto { color: #2e7d32; }
.rp-co-importo-riga--consegna-gratis { color: #2e7d32; }

.rp-co-importo-totale {
    border-top: 1.5px solid #ddd;
    padding-top: .5rem;
    margin-top: .25rem;
    font-size: 1.1rem;
    color: #111;
}

/* ── Metodi di pagamento ─────────────────────────────────────────────────── */
.rp-co-pagamenti {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.rp-co-pagamento-opzione {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #fafafa;
}

.rp-co-pagamento-opzione:hover {
    border-color: #e84b16;
    background: #fff8f6;
}

.rp-co-pagamento-opzione--selezionato {
    border-color: #e84b16;
    background: #fff3f0;
}

.rp-co-pagamento-opzione input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #e84b16;
    flex-shrink: 0;
}

.rp-co-pagamento-nome {
    font-weight: 600;
    font-size: .95rem;
}

.rp-co-pagamento-note {
    font-size: .8rem;
    color: #777;
    margin-top: .15rem;
}

/* ── Pulsanti ────────────────────────────────────────────────────────────── */
.rp-co-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.4rem;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .15s, border-color .15s, opacity .15s;
    text-decoration: none;
    white-space: nowrap;
}

.rp-co-btn--primary {
    background: #e84b16;
    color: #fff;
    width: 100%;
    margin-top: .25rem;
}

.rp-co-btn--primary:hover:not(:disabled) {
    background: #c73e11;
}

.rp-co-btn--secondary {
    background: #fff;
    color: #e84b16;
    border-color: #e84b16;
}

.rp-co-btn--secondary:hover {
    background: #fff3f0;
}

.rp-co-btn--outline {
    background: #fff;
    color: #444;
    border-color: #d0d0d0;
    padding: .65rem 1rem;
}

.rp-co-btn--outline:hover {
    border-color: #e84b16;
    color: #e84b16;
}

.rp-co-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ── Invio ordine ────────────────────────────────────────────────────────── */
.rp-co-submit-wrap {
    text-align: center;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.rp-co-btn--invia {
    background: #e84b16;
    color: #fff;
    font-size: 1.1rem;
    padding: .9rem 2.5rem;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    border: none;
}

.rp-co-btn--invia:hover:not(:disabled) {
    background: #c73e11;
}

.rp-co-submit-nota {
    font-size: .8rem;
    color: #999;
    margin-top: .6rem;
}

/* ── Bottone PayPal redirect ─────────────────────────────────────────────── */
.rp-co-btn-paypal-redirect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .85rem 1.5rem;
    background: #ffc439;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #003087;
    cursor: pointer;
    transition: background .2s;
}

.rp-co-btn-paypal-redirect:hover:not(:disabled) {
    background: #f0b429;
}

.rp-co-btn-paypal-redirect:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.rp-co-btn-paypal-logo {
    font-size: 1.15rem;
    font-weight: 700;
    font-style: italic;
    color: #003087;
    font-family: Verdana, sans-serif;
}

/* ── Card fields (campi carta inline PayPal) ─────────────────────────────── */
.rp-co-card-field-host {
    height: 44px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0;
    background: #fff;
    overflow: hidden;
}

.rp-co-paypal-caricamento,
.rp-co-paypal-nota {
    font-size: .9rem;
    color: #666;
    margin-bottom: .75rem;
}

.rp-co-paypal-errore {
    color: #c0392b;
    font-size: .9rem;
    margin-bottom: .75rem;
}

/* ── Conferma ordine ─────────────────────────────────────────────────────── */
.rp-co-conferma {
    text-align: center;
    padding: 3rem 1rem;
    animation: rp-fadeIn .4s ease;
}

.rp-co-conferma-check {
    font-size: 4rem;
    color: #4caf50;
    margin-bottom: .75rem;
}

.rp-co-conferma h2 {
    font-size: 1.6rem;
    margin-bottom: .5rem;
    color: #111;
}

.rp-co-conferma-numero {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #555;
}

.rp-co-conferma-numero strong {
    color: #e84b16;
    font-size: 1.2rem;
}

@keyframes rp-fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Carrello vuoto ──────────────────────────────────────────────────────── */
.rp-co-carrello-vuoto {
    text-align: center;
    padding: 3rem 1rem;
    color: #777;
}

.rp-co-carrello-vuoto p { margin-bottom: 1rem; font-size: 1.1rem; }

/* ── Errore generico ─────────────────────────────────────────────────────── */
.rp-co-errore-generico {
    background: #fce4e4;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin: 1rem 0;
    font-size: .9rem;
}

/* ── Aside (sticky summary desktop) ─────────────────────────────────────── */
.rp-co-aside {
    display: none;
}

@media (min-width: 900px) {
    .rp-co-aside {
        display: block;
        position: sticky;
        top: 1.5rem;
    }

    .rp-co-aside-card {
        background: #fff;
        border: 1.5px solid #e8e8e8;
        border-radius: 12px;
        padding: 1.25rem 1.5rem;
    }

    .rp-co-aside-card h3 {
        font-size: 1rem;
        font-weight: 700;
        margin: 0 0 .75rem;
        color: #111;
    }

    .rp-co-aside-sep {
        border-top: 1px solid #eee;
        margin: .75rem 0;
    }

    .rp-co-aside-righe {
        display: flex;
        flex-direction: column;
        gap: .4rem;
    }

    .rp-co-aside-riga {
        display: flex;
        justify-content: space-between;
        font-size: .85rem;
        color: #555;
    }

    .rp-co-aside-totale {
        font-weight: 700;
        font-size: .95rem;
        color: #111;
        border-top: 1.5px solid #ddd;
        padding-top: .4rem;
        margin-top: .2rem;
    }
}
