/* ===========================
   CHECKOUT PAGE STYLES
   Blocksy Child Theme
   =========================== */

/* Centra la sezione Customer Details */
.ct-customer-details {
    max-width: 80% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    padding: 20px;
    box-sizing: border-box;
}

@media screen and (max-width: 768px) {
    .ct-customer-details {
        max-width: 95% !important;
    }
}

/* ===========================
   VARIAZIONI PRODOTTO (order review)
   =========================== */

/* Desktop: Organizza le variazioni in due colonne */
.woocommerce-checkout-review-order-table .variation {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
}

.woocommerce-checkout-review-order-table .variation dt,
.woocommerce-checkout-review-order-table .variation dd {
    width: 50%;
    padding-right: 10px;
    padding-bottom: 5px;
    box-sizing: border-box;
}

.woocommerce-checkout-review-order-table .variation dt {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    padding-right: 15px;
    text-align: left;
}

.woocommerce-checkout-review-order-table .variation dd {
    font-size: 14px;
    color: #555;
    padding-left: 10px;
    text-align: left;
}

/* Mobile: variazioni in colonna */
@media screen and (max-width: 768px) {
    .woocommerce-checkout-review-order-table .variation {
        margin-top: 8px;
        margin-bottom: 8px;
        padding: 8px;
        display: block;
        border-top: none;
        border-bottom: 1px solid #ddd;
    }

    .woocommerce-checkout-review-order-table .variation dt {
        width: 100%;
        font-size: 16px;
        margin-bottom: 5px;
    }

    .woocommerce-checkout-review-order-table .variation dd {
        width: 100%;
        font-size: 14px;
        color: #555;
    }

    .woocommerce-checkout-review-order-table .variation dd p {
        margin-bottom: 5px;
        word-wrap: break-word;
    }
}

/* Spaziatura generale per la tabella */
.woocommerce-checkout-review-order-table td,
.woocommerce-checkout-review-order-table th {
    padding: 10px;
    text-align: left;
}

/* Nascondi testo "small" nel totale prodotto */
.product-total small {
    display: none !important;
}

/* ===========================
   B2B FIELDS STYLING
   =========================== */

/* Campi B2B nascosti di default */
#billing_codice_identificativo_field.hidden,
#billing_pec_field.hidden {
    display: none !important;
}

/* Stile per i campi B2B */
#billing_fattura_metodo_field,
#billing_codice_identificativo_field,
#billing_pec_field {
    margin-bottom: 15px;
}

#billing_fattura_metodo_field label,
#billing_codice_identificativo_field label,
#billing_pec_field label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

/* ===========================
   GUEST POPUP STYLES
   =========================== */

#guest-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    font-family: 'Nunito', 'Nunito Sans', sans-serif;
    backdrop-filter: blur(4px);
}

#guest-popup .box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeInPopup 0.4s ease;
}

@keyframes fadeInPopup {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

#guest-popup h2 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
    color: #0546C7;
    font-weight: 800;
    font-family: 'Nunito', 'Nunito Sans', sans-serif;
}

#guest-popup p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: #444;
    line-height: 1.6;
}

#guest-popup p strong {
    color: #0546C7;
}

#guest-popup .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #0546C7;
    color: #fff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 700;
    transition: background 0.3s ease;
}

#guest-popup .btn:hover {
    background: #0437a0;
}

#guest-popup .close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.5rem;
    color: #0546C7;
    font-weight: bold;
    text-decoration: none;
}

#guest-popup .close:hover {
    color: #0437a0;
}

/* ===========================
   CONTACT BUTTON (product page)
   =========================== */

.ct-contact-cta-wrapper {
    margin-bottom: 15px;
    max-width: 100%;
}

.ct-contact-cta {
    display: inline-block;
    padding: 10px 25px;
    font-family: var(--theme-font-family, 'Nunito Sans'), sans-serif;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--theme-palette-color-1, #0546C7);
    background-color: transparent;
    border-radius: var(--theme-button-border-radius, 3px);
    border: 2px solid var(--theme-palette-color-1, #0546C7);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
    width: fit-content;
}

.ct-contact-cta:hover {
    background-color: var(--theme-palette-color-1, #0546C7);
    color: #fff;
}

/* ===========================
   ORDER SALDO RESIDUO
   =========================== */

.wc-order-saldo-residuo {
    margin: 0.2em 0 0;
    font-size: 0.95em;
    color: #555;
}

.wc-order-saldo-residuo strong {
    color: #333;
}
