/* Presentazione dei campi esistenti. */
form.checkout .fi-customer-guide,
.woocommerce .fi-final-customer-section {
    box-sizing: border-box;
    clear: both;
    margin: 0 0 24px;
    padding: 18px 20px;
    border: 1px solid #dedede;
    border-left: 4px solid #e4b400;
    border-radius: 4px;
    background: #fffdf5;
    color: #292929;
}

form.checkout .fi-customer-guide h3,
.woocommerce .fi-final-customer-section h3,
.woocommerce .fi-final-customer-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

form.checkout .fi-customer-guide p,
.woocommerce .fi-final-customer-section .fi-section-description {
    margin: 0 0 12px;
    line-height: 1.55;
}

form.checkout .fi-customer-guide p:last-child {
    margin-bottom: 0;
}

.woocommerce .fi-final-customer-section {
    margin-top: 24px;
    background: #fff;
}

.woocommerce .fi-final-customer-section::after {
    display: table;
    clear: both;
    content: "";
}

.fi-final-customer-summary ul {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.fi-final-customer-summary li {
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

#order_data .fi-admin-address-guide {
    padding: 0;
    border: 0;
    line-height: 1.5;
}

/* Tre gruppi distinti, senza cambiare la struttura dei campi WooCommerce. */
#order_data .order_data_column.fi-admin-address-group > h3,
#order_data .order_data_column.fi-admin-address-group > .fi-admin-address-guide,
#order_data .order_data_column.fi-admin-address-group > div.address,
#order_data .order_data_column.fi-admin-address-group > div.edit_address {
    box-sizing: border-box;
    margin: 0;
    border: 1px solid #dcdcde;
    background: #fff;
}

#order_data .order_data_column.fi-admin-address-group > h3 {
    padding: 14px 14px 8px;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}

#order_data .order_data_column.fi-admin-address-group > .fi-admin-address-guide {
    /* WooCommerce azzera il padding dei paragrafi con !important. */
    padding: 0 14px 14px !important;
    border-top: 0;
    border-bottom: 0;
    color: #646970;
}

#order_data .order_data_column.fi-admin-address-group > div.address,
#order_data .order_data_column.fi-admin-address-group > div.edit_address {
    padding: 0 14px 14px;
    border-top: 0;
    border-radius: 0 0 4px 4px;
}

#order_data .order_data_column.fi-admin-address-group > div.address > p:last-child {
    margin-bottom: 0;
}

#order_data #fi-final-customer-details {
    box-sizing: border-box;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fafafa;
}

#order_data #fi-final-customer-details > p:first-child {
    margin-top: 0;
    color: #23282d;
}

#fi-final-customer-details .fi-final-customer-summary {
    padding: 0;
}

form.checkout.fi-shipping-enhanced #ship-to-different-address {
    display: none;
}

.fi-shipping-same-control[hidden],
.fi-shipping-same-notice[hidden],
form.checkout.fi-shipping-enhanced .shipping_address[hidden],
.fi-edit-final-customer[hidden] {
    display: none !important;
}

form.checkout .fi-shipping-same-notice {
    padding: 12px;
    border: 1px solid #dedede;
    border-radius: 4px;
    background: #fff;
    font-weight: 600;
}

.fi-shipping-same-control label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
}

.fi-shipping-same-control input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
}

#fi-final-customer-details .fi-final-customer-edit-fields {
    max-width: 100%;
    padding: 0;
}

#fi-final-customer-details .fi-admin-final-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

#fi-final-customer-details .fi-admin-final-field input {
    box-sizing: border-box;
    width: 100%;
}

#fi-final-customer-details .fi-edit-final-customer {
    margin: 0 0 12px;
}

@media (max-width: 600px) {
    form.checkout .fi-customer-guide,
    .woocommerce .fi-final-customer-section {
        padding: 16px;
    }

    .woocommerce .fi-final-customer-section .form-row-first,
    .woocommerce .fi-final-customer-section .form-row-last {
        float: none;
        width: 100%;
    }
}
