/* ========================================================================
   THE KHATOON SHOP v4.0.3 — CHECKOUT WIDTH HOTFIX
   Presentation only. WooCommerce products, totals, shipping, payments,
   orders and customer data remain native and unchanged.
======================================================================== */

/* WooCommerce uses .wc-block-checkout on both the outer block and the inner
   sidebar layout. The outer element must never become a two-column grid. */
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wp-block-woocommerce-checkout.wc-block-checkout {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .tks-premium-checkout-page {
    width: min(1180px, calc(100% - 40px)) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: auto !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .tks-premium-checkout-page > .entry-content,
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wp-block-woocommerce-checkout.wc-block-checkout {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
}

/* Only the real inner sidebar layout is a two-column checkout. */
@media (min-width: 981px) {
    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wp-block-woocommerce-checkout.wc-block-checkout
        > .wc-block-components-sidebar-layout.wc-block-checkout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(370px, 430px) !important;
        gap: 30px !important;
        align-items: start !important;
        justify-content: stretch !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wp-block-woocommerce-checkout .wc-block-checkout__main {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wp-block-woocommerce-checkout .wc-block-checkout__sidebar {
        grid-column: 2 !important;
        position: sticky !important;
        top: 18px !important;
        align-self: start !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
}

/* Every live step owns the full flexible customer-details column. */
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-checkout__main > :where(
        .tks-checkout-step-note,
        .tks-checkout-step-node,
        .tks-checkout-step-navigation,
        .wc-block-components-checkout-step
    ),
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-checkout-step__container,
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-address-form,
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-radio-control,
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-payment-methods {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-checkout-step {
    overflow: visible !important;
}

/* Fields must shrink within their grid without being cut off. */
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    :where(
        .wc-block-components-address-form__first_name,
        .wc-block-components-address-form__last_name,
        .wc-block-components-address-form__address_1,
        .wc-block-components-address-form__address_2,
        .wc-block-components-address-form__city,
        .wc-block-components-address-form__state,
        .wc-block-components-address-form__postcode,
        .wc-block-components-address-form__phone,
        .wc-block-components-text-input,
        .wc-block-components-combobox,
        .wc-block-components-country-input
    ) {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    :where(input, select, textarea) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Shipping and payment rows remain readable single cards, not narrow strips. */
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    :where(
        .wc-block-checkout__shipping-method,
        .wc-block-checkout__pickup-options,
        .wc-block-checkout__payment-method,
        .wc-block-checkout__payment-methods,
        .wc-block-components-radio-control__option,
        .wc-block-components-radio-control__option-layout,
        .wc-block-components-radio-control__label-group,
        .wc-block-components-radio-control__label,
        .wc-block-components-payment-method-label
    ) {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    :where(
        .wc-block-components-radio-control__label,
        .wc-block-components-payment-method-label,
        .wc-block-components-radio-control__secondary-label
    ) {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.4 !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-radio-control__option-layout {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-components-radio-control__secondary-label {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    text-align: right !important;
}

/* Navigation and final order action stay inside the column at every width. */
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .tks-checkout-step-navigation {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    gap: 14px !important;
    overflow: visible !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .tks-checkout-step-navigation button {
    width: auto !important;
    max-width: 100% !important;
    min-width: 150px !important;
    white-space: normal !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .tks-checkout-step-navigation__next {
    min-width: 220px !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    :where(
        .wc-block-checkout__actions,
        .wc-block-checkout__actions_row,
        .wc-block-components-checkout-place-order-button,
        #place_order
    ) {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    overflow: visible !important;
    clip: auto !important;
}

body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    :where(.wc-block-components-checkout-place-order-button, #place_order) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 56px !important;
    padding: 13px 22px !important;
    white-space: normal !important;
}

/* Third-party review consent should be legible when it appears on Review. */
body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
    .wc-block-checkout__main label {
    max-width: 100% !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* Tablet and phone: one natural column, no sticky summary or horizontal crop. */
@media (max-width: 980px) {
    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-premium-checkout-page {
        width: calc(100% - 28px) !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-premium-checkout-page > .entry-content,
    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wp-block-woocommerce-checkout.wc-block-checkout {
        width: 100% !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wp-block-woocommerce-checkout.wc-block-checkout
        > .wc-block-components-sidebar-layout.wc-block-checkout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 18px !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        :where(.wc-block-checkout__main, .wc-block-checkout__sidebar) {
        grid-column: 1 !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wc-block-checkout__sidebar {
        margin-top: 0 !important;
    }
}

@media (max-width: 680px) {
    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-premium-checkout-page {
        width: calc(100% - 20px) !important;
    }


    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-premium-checkout-page > .entry-content,
    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .wp-block-woocommerce-checkout.wc-block-checkout {
        width: 100% !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-checkout-step-navigation {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-checkout-step-navigation button {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.tks-luxury-suite-v400.woocommerce-checkout:not(.woocommerce-order-received)
        .tks-checkout-step-navigation__next {
        grid-row: 1 !important;
    }
}
