/* --- HIDE UNWANTED BLOCKS & FIELDS --- */

/* Hide Email Block and its field */
#contact-fields,
.wc-block-checkout__contact-fields,
.wc-block-components-address-form__email,
#email {
    display: none !important;
}

/* Hide Billing Fields entirely */
#billing-fields,
.wc-block-checkout__billing-fields {
    display: none !important;
}

/* Hide specific fields inside the Shipping section */
.wc-block-components-address-form__last_name,
.wc-block-components-address-form__address_1,
.wc-block-components-address-form__address_2-toggle,
.wc-block-components-address-form__address_2-hidden-input,
.wc-block-components-address-form__postcode,
.wc-block-components-address-form__country,
#shipping-country,
#shipping-last_name,
#shipping-address_1,
#shipping-address_2,
#shipping-postcode,
.wc-block-checkout__use-address-for-billing,
#order-notes {
    display: none !important;
}

/* --- FORM LAYOUT & SECTION REORDERING --- */

/* Force the entire form to be a column */
.wc-block-checkout__form {
    display: flex !important;
    flex-direction: column !important;
}

/* Order the sections vertically */
#shipping-fields { order: 1 !important; }
#shipping-option { order: 2 !important; }
#payment-method { order: 3 !important; }
.wc-block-checkout__order-notes { order: 4 !important; }
.wc-block-checkout__terms { order: 5 !important; }
.wc-block-checkout__actions { order: 99 !important; } /* Order button at the very bottom */

/* --- ADDRESS FIELD REORDERING --- */

.wc-block-components-address-form {
    display: flex !important;
    flex-direction: column !important;
}

/* 1. Full Name */
.wc-block-components-address-form__first_name {
    order: 1 !important;
    width: 100% !important;
}

/* 2. Phone (Téléphone) */
.wc-block-components-address-form__phone {
    order: 2 !important;
    width: 100% !important;
}

/* 3. Wilaya and Commune */
.wc-block-components-address-form__state {
    order: 3 !important;
}

.wc-block-components-address-form__city {
    order: 4 !important;
}

/* --- STYLING --- */

.wc-block-components-address-form__city select {
    width: 100% !important;
    min-height: 48px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 24px 12px 4px !important;
    background-color: #fff !important;
}

.wc-block-components-address-form > div {
    margin-bottom: 15px !important;
}

.wc-block-components-address-form__city .wc-block-components-select__select {
    padding: 24px 12px 4px !important;
}

.wc-block-components-address-form__city .wc-block-components-label {
    z-index: 1;
    pointer-events: none;
    transition: all 0.2s ease-out !important;
}

.dz-has-value .wc-block-components-label,
.wc-block-components-address-form__city .wc-block-components-select__select:focus ~ .wc-block-components-label {
    transform: translateY(-16px) scale(0.75) !important;
}
