/**
* Carrello e checkout - Restyling UX/CRO
* Layout a due colonne (contenuto + riepilogo) e box dei passi. La barra sticky del totale è in components.css.
*/

.tl-checkout {
    padding: var(--tl-space-6) 0 60px;
    font-family: var(--tl-font-family);
    color: var(--tl-text);
}

.tl-breadcrumb {
    margin-bottom: var(--tl-space-6);
    font-size: var(--tl-fs-base);
}

    .tl-breadcrumb a {
        color: inherit;
        text-decoration: none;
    }

        .tl-breadcrumb a:hover {
            text-decoration: underline;
        }

.tl-page-title {
    margin: 0 0 var(--tl-space-6);
    font-family: var(--tl-font-family);
    font-size: var(--tl-fs-h1);
    line-height: var(--tl-lh-h1);
    font-weight: var(--tl-font-weight-medium);
    color: var(--tl-text);
}

.tl-page-title:has(+ .tl-page-subtitle) {
    margin-bottom: var(--tl-space-2);
}

.tl-page-subtitle {
    margin: 0 0 var(--tl-space-6);
    font-size: var(--tl-fs-md);
    line-height: 1.4;
}

/* Contenuto a sinistra, riepilogo a destra (414px su 1280) */
.tl-checkout__layout {
    display: grid;
    gap: var(--tl-space-4);
}

.tl-checkout__main {
    display: flex;
    flex-direction: column;
    gap: var(--tl-space-4);
    min-width: 0;
}

.tl-checkout__aside {
    display: flex;
    flex-direction: column;
    gap: var(--tl-space-5);
}

/* Box bordato dei passi (esperienza nel carrello, dati acquirente, partecipanti) */
.tl-box {
    padding: var(--tl-space-4);
    border: 1px solid var(--tl-border-muted);
    border-radius: var(--tl-radius-card);
    background: var(--tl-surface);
}

.tl-box__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--tl-space-1) var(--tl-space-4);
    margin-bottom: var(--tl-space-4);
}

.tl-box__title {
    margin: 0;
    font-family: var(--tl-font-family);
    font-size: var(--tl-fs-h3);
    line-height: var(--tl-lh-h3);
    font-weight: var(--tl-font-weight-medium);
    color: var(--tl-text);
}

.tl-box__note {
    font-size: var(--tl-fs-xs);
    color: var(--tl-text);
}

/*--------------------------------------------------------------
# Carrello: esperienza
--------------------------------------------------------------*/
.tl-cart-item {
    display: grid;
    gap: var(--tl-space-4);
}

.tl-cart-item__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--tl-radius-md);
    object-fit: cover;
}

.tl-cart-item__title {
    margin: 0 0 var(--tl-space-4);
    font-family: var(--tl-font-family);
    font-size: var(--tl-fs-lg);
    line-height: var(--tl-lh-lg);
    font-weight: var(--tl-font-weight-medium);
    color: var(--tl-text);
}

.tl-cart-item__prices {
    margin-top: var(--tl-space-4);
    padding: var(--tl-space-4);
    border-radius: 6px;
    background: var(--tl-surface-subtle);
    font-size: var(--tl-fs-xs);
}

    .tl-cart-item__prices p {
        margin: 0 0 var(--tl-space-2);
        font-size: var(--tl-fs-sm);
    }

    .tl-cart-item__prices div {
        display: flex;
        justify-content: space-between;
        gap: var(--tl-space-2);
    }

        .tl-cart-item__prices div + div {
            margin-top: 4px;
        }

.tl-cart-item__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--tl-space-4);
    padding-top: var(--tl-space-4);
    border-top: 1px solid var(--tl-border);
}

/*--------------------------------------------------------------
# Riepilogo: totale e pulsante per proseguire
--------------------------------------------------------------*/
.tl-summary {
    overflow: hidden;
    border: 1px solid var(--tl-border-muted);
    border-radius: var(--tl-radius-card);
    background: var(--tl-surface);
}

.tl-summary__header {
    padding: var(--tl-space-4);
    border-bottom: 1px solid var(--tl-border-muted);
    background: var(--tl-surface-muted);
    font-size: var(--tl-fs-lg);
    font-weight: var(--tl-font-weight-medium);
}

.tl-summary__body {
    padding: var(--tl-space-4);
}

.tl-summary__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: var(--tl-space-2);
    border-bottom: 1px solid var(--tl-border-muted);
}

    .tl-summary__head h2 {
        margin: 0;
        font-family: var(--tl-font-family);
        font-size: var(--tl-fs-h3);
        font-weight: var(--tl-font-weight-medium);
        color: var(--tl-text);
    }

    .tl-summary__head a {
        font-size: var(--tl-fs-sm);
        font-weight: var(--tl-font-weight-medium);
        color: var(--tl-text);
    }

.tl-summary__coupon {
    margin-top: var(--tl-space-4);
}

.tl-summary__coupon-row {
    display: flex;
}

    .tl-summary__coupon-row .tl-input {
        border-radius: var(--tl-radius-sm) 0 0 var(--tl-radius-sm);
    }

    .tl-summary__coupon-row button {
        flex-shrink: 0;
        padding: 0 var(--tl-space-4);
        border: 0;
        border-radius: 0 var(--tl-radius-sm) var(--tl-radius-sm) 0;
        background: var(--tl-blue);
        color: var(--tl-text-inverse);
        font-size: var(--tl-fs-sm);
    }

.tl-summary__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tl-space-2);
    margin-top: var(--tl-space-4);
    font-size: var(--tl-fs-base);
}

.tl-summary__taxes {
    margin: 6px 0 var(--tl-space-5);
    font-size: var(--tl-fs-xxs);
    text-align: right;
}

/*--------------------------------------------------------------
# Checkout mobile: riepilogo ordine apribile sotto l'header
--------------------------------------------------------------*/
.tl-order-toggle {
    background: var(--tl-surface-alt);
}

.tl-order-toggle__button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: var(--tl-space-5) var(--tl-gutter-mobile);
    border: 0;
    background: none;
    color: var(--tl-navy);
    font-size: var(--tl-fs-base);
}

    .tl-order-toggle__button .bi {
        transition: transform 0.2s ease;
    }

    .tl-order-toggle__button[aria-expanded="true"] .bi {
        transform: rotate(180deg);
    }

.tl-order-toggle__total {
    margin-left: auto;
    font-weight: var(--tl-font-weight-medium);
}

/*--------------------------------------------------------------
# Checkout: campi dell'acquirente e dei partecipanti
--------------------------------------------------------------*/
.tl-form-grid {
    display: grid;
    gap: var(--tl-space-4);
}

.tl-phone {
    display: flex;
    gap: var(--tl-space-4);
}

    .tl-phone .tl-input:first-child {
        flex: 0 0 62px;
        padding: 0 8px;
        text-align: center;
    }

.tl-participants__experience {
    margin-top: var(--tl-space-5);
    padding-top: var(--tl-space-5);
    border-top: 1px solid var(--tl-border-muted);
}

    .tl-participants__experience h3 {
        margin: 0 0 var(--tl-space-2);
        font-family: var(--tl-font-family);
        font-size: var(--tl-fs-lg);
        line-height: var(--tl-lh-lg);
        font-weight: var(--tl-font-weight-medium);
        color: var(--tl-text);
    }

.tl-participant + .tl-participant {
    margin-top: var(--tl-space-4);
}

.tl-participant__label {
    margin: 0 0 var(--tl-space-2);
    font-size: var(--tl-fs-base);
}

/* bootstrap-select (Cittadinanza) con l'aspetto dei campi tl-input */
.tl-checkout .bootstrap-select > .dropdown-toggle.tl-input {
    display: flex;
    align-items: center;
    border-color: var(--tl-border-muted);
    background: var(--tl-surface);
}

@media (min-width: 768px) {
    .tl-box {
        padding: var(--tl-space-5) 28px;
    }

    .tl-cart-item {
        grid-template-columns: 220px 1fr;
        gap: 56px;
    }

    .tl-cart-item__image {
        aspect-ratio: 1;
    }

    .tl-form-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .tl-form-grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tl-participant .tl-form-grid {
        max-width: 505px;
    }
}

@media (min-width: 992px) {
    .tl-checkout__layout {
        grid-template-columns: minmax(0, 1fr) 414px;
        align-items: start;
    }
}
