/* ============================================================
   Pagina carrello
   ============================================================ */

.cl-cart {
    padding-bottom: 24px;
}

.cl-cart__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-bottom: 28px;
}

.cl-site h1.cl-cart__title,
.cl-site h1.cl-cart-empty__title {
    margin: 0;
    font-family: var(--font-baloo), sans-serif;
    font-size: clamp(30px, 3.4vw, 42px);
    font-weight: 700;
    line-height: 1.1;
    text-transform: none;
    color: var(--cl-ink);
}

.cl-cart__count {
    font-size: 15px;
    font-weight: 600;
    color: var(--cl-muted);
}

.cl-cart__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 32px;
    align-items: start;
}

/* ── Righe ── */
.cl-cart__items {
    display: grid;
    gap: 14px;
}

.cl-cart-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--cl-line);
    border-radius: 18px;
    background: #fff;
}

.cl-cart-item__thumb {
    width: 120px;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--cl-paper);
}

.cl-cart-item__thumb a {
    display: block;
    height: 100%;
}

.cl-cart-item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cl-cart-item__thumb .cl-cart-thumb--preview {
    object-fit: contain;
    background: #fff;
}

.cl-cart-item__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.cl-cart-item__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.cl-cart-item__name a,
.cl-cart-item__name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--cl-ink);
    text-decoration: none;
}

.cl-cart-item__name a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cl-cart-item__unit {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cl-muted);
}

.cl-cart-item__subtotal {
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
}

.cl-cart-item .cl-cart-meta:empty {
    display: none;
}

.cl-cart-item .cl-cart-meta dl.variation {
    font-size: 13px;
}

.cl-cart-item__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

/* Stepper sul quantity input di WC */
.cl-cart-item__qty .quantity.cl-stepper {
    height: 40px;
}

.cl-cart-item__qty .cl-stepper__btn {
    width: 38px;
    height: 38px;
}

.cl-site .woocommerce .cl-cart-item__qty input.qty {
    width: 42px;
    min-height: 0;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: center;
    font-weight: 700;
    box-shadow: none;
    -moz-appearance: textfield;
}

.cl-cart-item__qty input.qty::-webkit-outer-spin-button,
.cl-cart-item__qty input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cl-cart-item__remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cl-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.cl-cart-item__remove:hover {
    color: var(--cl-danger);
}

.cl-cart__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.cl-cart__continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cl-ink);
    text-decoration: none;
}

.cl-cart__continue:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Con JS l'aggiornamento è automatico */
.woocommerce-js .cl-cart__update {
    display: none !important;
}

/* ── Riepilogo ── */
.cl-cart__side {
    position: sticky;
    top: 140px;
}

.cl-cart-totals {
    padding: 24px;
    border: 1px solid var(--cl-line);
    border-radius: 18px;
    background: #fff;
}

.cl-site h2.cl-cart-totals__title {
    margin: 0 0 14px;
    font-family: var(--font-baloo), sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-transform: none;
    color: var(--cl-ink);
}

.cl-cart-totals__table {
    width: 100%;
    border-collapse: collapse;
}

.cl-cart-totals__table th,
.cl-cart-totals__table td {
    padding: 12px 0;
    border-top: 1px solid var(--cl-line);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    vertical-align: top;
}

.cl-cart-totals__table tr:first-child th,
.cl-cart-totals__table tr:first-child td {
    border-top: 0;
}

.cl-cart-totals__table td {
    text-align: right;
}

.cl-cart-totals__table th {
    color: var(--cl-text);
}

.cl-cart-totals__muted {
    color: var(--cl-muted);
    font-weight: 500 !important;
}

.cl-cart-totals__table .cart-discount td {
    color: var(--cl-success);
}

.cl-cart-totals__table .order-total th,
.cl-cart-totals__table .order-total td {
    padding-top: 16px;
    font-size: 20px;
    font-weight: 800;
    color: var(--cl-ink);
}

.cl-cart-totals__table .order-total .includes_tax {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--cl-muted);
}

.cl-cart-coupon-row td {
    text-align: left !important;
}

.cl-site .woocommerce .wc-proceed-to-checkout {
    margin-top: 8px;
}

.cl-site .woocommerce .wc-proceed-to-checkout .checkout-button {
    width: 100%;
    min-height: 56px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(255, 210, 51, .35);
}

.cl-cart-totals__trust {
    display: grid;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--cl-muted);
}

.cl-cart-totals__trust li {
    list-style: none;
}

.cl-cart-totals__trust li::before {
    content: "✓";
    margin-right: 8px;
    font-weight: 800;
    color: var(--cl-ink);
}

/* Calcolatore spedizione */
.cl-site .woocommerce .shipping-calculator-button {
    font-size: 13px;
    font-weight: 700;
    color: var(--cl-ink);
}

.cl-site .woocommerce .shipping-calculator-form {
    margin-top: 12px;
}

/* ── Cross-sell ── */
.cl-cart ~ .cross-sells,
.woocommerce .cross-sells {
    margin-top: 48px;
}

.cl-site .cross-sells > h2 {
    margin: 0 0 20px;
    font-family: var(--font-baloo), sans-serif;
    font-size: 26px;
    text-transform: none;
}

.cl-site .cross-sells ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ── Carrello vuoto ── */
.cl-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 20px auto;
    padding: 48px 28px;
    border: 1px solid var(--cl-line);
    border-radius: 24px;
    background: #fff;
    text-align: center;
}

.cl-cart-empty__icon {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--cl-yellow);
    color: var(--cl-ink);
}

.cl-cart-empty p {
    margin: 0;
    color: var(--cl-text);
}

.cl-cart-empty .return-to-shop {
    margin-top: 14px;
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .cl-cart__grid {
        grid-template-columns: 1fr;
    }

    .cl-cart__side {
        position: static;
    }
}

@media (max-width: 639px) {
    .cl-wc-page.cl-container {
        width: calc(100% - 32px);
        padding-block: 24px 40px !important;
    }

    .cl-cart__head {
        margin-bottom: 18px;
    }

    .cl-cart-item {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 14px;
        padding: 14px;
        border-radius: 16px;
    }

    .cl-cart-item__thumb {
        width: 84px;
        border-radius: 12px;
    }

    .cl-cart-item__top {
        flex-direction: column;
        gap: 4px;
    }

    .cl-cart-item__name a,
    .cl-cart-item__name {
        font-size: 15px;
    }

    .cl-cart-item__subtotal {
        font-size: 15px;
    }

    .cl-cart-totals {
        padding: 20px;
    }

}

/* Messaggio rate Klarna (WooPayments) sopra «Procedi con l'ordine» */
.cl-site #payment-method-message {
    margin-bottom: 10px;
}
