/* ================================
   WooCommerce System Pages - Phase 2.4
   Cart / Checkout / My Account
================================ */

.woocommerce-cart,
.woocommerce-checkout,
.woocommerce-account {
    background:
        radial-gradient(circle at top right, rgba(244, 114, 22, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(7, 19, 47, 0.03), rgba(255, 255, 255, 0) 420px),
        #ffffff;
}

.almajarrat-wc-system-page .page-content {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 80px;
}

.almajarrat-wc-system-page .page-content article {
    margin: 0;
}

.almajarrat-wc-system-page .page-content article > h1,
.almajarrat-wc-system-page .entry-title {
    margin: 0 0 24px;
    padding: 28px 32px;
    border: 1px solid rgba(198, 198, 206, 0.78);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(7, 19, 47, 0.96), rgba(15, 35, 80, 0.92)),
        var(--color-primary, #07132f);
    color: #ffffff;
    font-family: 'El Messiri', serif;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.25;
    box-shadow: 0 18px 48px rgba(7, 19, 47, 0.14);
}

.almajarrat-wc-system-page .entry-content > .woocommerce {
    display: block;
}

.almajarrat-wc-system-page .woocommerce-notices-wrapper {
    margin-bottom: 18px;
}

.almajarrat-wc-system-page .woocommerce-message,
.almajarrat-wc-system-page .woocommerce-info,
.almajarrat-wc-system-page .woocommerce-error {
    display: block;
    width: 100%;
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid rgba(198, 198, 206, 0.85);
    border-right: 5px solid var(--color-secondary-container, #ff7a20);
    border-radius: 18px;
    background: #ffffff;
    color: var(--color-on-surface, #1a1c1c);
    font-family: 'Cairo', sans-serif;
    line-height: 1.8;
    box-shadow: 0 14px 38px rgba(7, 19, 47, 0.07);
}

.almajarrat-wc-system-page .woocommerce-error {
    border-right-color: #b42318;
}

.almajarrat-wc-system-page .woocommerce-message::before,
.almajarrat-wc-system-page .woocommerce-info::before,
.almajarrat-wc-system-page .woocommerce-error::before {
    display: none;
}

.almajarrat-wc-system-page .woocommerce-message .button,
.almajarrat-wc-system-page .woocommerce-info .button,
.almajarrat-wc-system-page .woocommerce-error .button {
    float: left;
    margin: 0 12px 0 0;
}

.almajarrat-wc-system-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    align-items: center;
    gap: 24px;
    margin: 0 0 26px;
    padding: 28px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(198, 198, 206, 0.75);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(244, 114, 22, 0.18), transparent 34%),
        #ffffff;
    box-shadow: 0 16px 46px rgba(7, 19, 47, 0.08);
}

.almajarrat-wc-system-intro::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 7px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-secondary-container, #ff7a20), var(--color-secondary, #9d4400));
}

.almajarrat-wc-system-intro__content,
.almajarrat-wc-system-intro__aside {
    position: relative;
    z-index: 1;
}

.almajarrat-wc-system-intro__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(244, 114, 22, 0.12);
    color: var(--color-secondary, #9d4400);
    font-size: 13px;
    font-weight: 800;
}

.almajarrat-wc-system-intro__title {
    margin: 0;
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', serif;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.35;
}

.almajarrat-wc-system-intro__text {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--color-on-surface-variant, #45464d);
    font-size: 16px;
    line-height: 1.9;
}

.almajarrat-wc-system-intro__aside {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.almajarrat-wc-system-intro__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 86px;
    height: 86px;
    border-radius: 22px;
    background: var(--color-primary, #07132f);
    color: #ffffff;
    font-size: 42px;
    box-shadow: 0 16px 36px rgba(7, 19, 47, 0.18);
}

.almajarrat-wc-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(198, 198, 206, 0.75);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
}


/* Checkout shortcode intro layout fix */
.woocommerce-checkout .almajarrat-wc-system-intro {
    grid-template-columns: 1fr;
    text-align: center;
}

.woocommerce-checkout .almajarrat-wc-system-intro__content {
    max-width: 100%;
    width: 100%;
}

.woocommerce-checkout .almajarrat-wc-system-intro__title {
    max-width: 100%;
    margin: 0 auto;
}

.woocommerce-checkout .almajarrat-wc-system-intro__text {
    max-width: 100%;
    margin: 12px auto 0;
}

.woocommerce-checkout .almajarrat-wc-system-intro__aside {
    width: 100%;
    justify-content: center;
}

.woocommerce-checkout .almajarrat-wc-system-intro__icon {
    display: none;
}

.woocommerce-checkout .almajarrat-wc-steps {
    max-width: 100%;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .woocommerce-checkout .almajarrat-wc-system-intro {
        padding: 22px 16px;
    }

    .woocommerce-checkout .almajarrat-wc-system-intro__aside {
        flex-direction: column;
        align-items: stretch;
    }

    .woocommerce-checkout .almajarrat-wc-system-intro__icon {
       display: none;
    }

    .woocommerce-checkout .almajarrat-wc-steps {
        justify-content: center;
    }
}


.almajarrat-wc-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 14px;
    color: var(--color-on-surface-variant, #45464d);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.almajarrat-wc-step.is-active {
    background: var(--color-secondary-container, #ff7a20);
    color: var(--color-on-secondary-container, #ffffff);
}

.almajarrat-wc-step__icon {
    font-size: 20px;
}

/* Common controls */
.almajarrat-wc-system-page .woocommerce a.button,
.almajarrat-wc-system-page .woocommerce button.button,
.almajarrat-wc-system-page .woocommerce input.button,
.almajarrat-wc-system-page .woocommerce #respond input#submit,
.almajarrat-wc-system-page .woocommerce .button,
.almajarrat-wc-system-page .wc-block-components-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--color-secondary-container, #ff7a20);
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(157, 68, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.almajarrat-wc-system-page .woocommerce a.button:hover,
.almajarrat-wc-system-page .woocommerce button.button:hover,
.almajarrat-wc-system-page .woocommerce input.button:hover,
.almajarrat-wc-system-page .woocommerce .button:hover,
.almajarrat-wc-system-page .wc-block-components-button:hover {
    background: var(--color-secondary, #9d4400);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(157, 68, 0, 0.27);
}

.almajarrat-wc-system-page .woocommerce button.button:disabled,
.almajarrat-wc-system-page .woocommerce button.button:disabled[disabled],
.almajarrat-wc-system-page .woocommerce input.button:disabled,
.almajarrat-wc-system-page .woocommerce input.button:disabled[disabled] {
    padding: 12px 20px;
    background: #d7d7de;
    color: #6b6b74;
    opacity: 1;
    box-shadow: none;
    transform: none;
}

.almajarrat-wc-system-page .woocommerce a.remove {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(180, 35, 24, 0.08);
    color: #b42318 !important;
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

.almajarrat-wc-system-page .woocommerce a.remove:hover {
    background: #b42318;
    color: #ffffff !important;
}

.almajarrat-wc-system-page .woocommerce input.input-text,
.almajarrat-wc-system-page .woocommerce textarea,
.almajarrat-wc-system-page .woocommerce select,
.almajarrat-wc-system-page .select2-container--default .select2-selection--single {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(198, 198, 206, 0.95);
    border-radius: 14px;
    background: #ffffff;
    color: var(--color-on-surface, #1a1c1c);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    outline: none;
}

.almajarrat-wc-system-page .woocommerce input.input-text,
.almajarrat-wc-system-page .woocommerce textarea,
.almajarrat-wc-system-page .woocommerce select {
    padding: 11px 14px;
}

.almajarrat-wc-system-page .select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
    padding: 0 14px;
}

.almajarrat-wc-system-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    color: var(--color-on-surface, #1a1c1c);
    line-height: 48px;
}

.almajarrat-wc-system-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50%;
    left: 12px;
    right: auto;
    transform: translateY(-50%);
}

.almajarrat-wc-system-page .woocommerce input.input-text:focus,
.almajarrat-wc-system-page .woocommerce textarea:focus,
.almajarrat-wc-system-page .woocommerce select:focus,
.almajarrat-wc-system-page .select2-container--open .select2-selection--single {
    border-color: var(--color-secondary-container, #ff7a20);
    box-shadow: 0 0 0 4px rgba(244, 114, 22, 0.12);
}

.almajarrat-wc-system-page .woocommerce form .form-row {
    margin: 0 0 16px;
    padding: 0;
}

.almajarrat-wc-system-page .woocommerce form .form-row label {
    margin-bottom: 7px;
    color: var(--color-primary, #07132f);
    font-weight: 800;
    line-height: 1.7;
}

.almajarrat-wc-system-page .woocommerce form .form-row .required {
    color: var(--color-secondary-container, #ff7a20);
}

/* Cart */
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-cart .cross-sells,
.almajarrat-wc-support-box,
.woocommerce-checkout .woocommerce-form-coupon,
.woocommerce-checkout .woocommerce-form-login,
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout #order_review,
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register {
    border: 1px solid rgba(198, 198, 206, 0.82);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 16px 44px rgba(7, 19, 47, 0.08);
}

.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-cart .cross-sells {
    padding: 22px;
}

.woocommerce-cart table.shop_table,
.woocommerce-checkout table.shop_table,
.woocommerce-account table.shop_table {
    overflow: hidden;
    width: 100%;
    margin: 0 0 22px;
    border: 1px solid rgba(198, 198, 206, 0.85);
    border-collapse: separate;
    border-radius: 18px;
    background: #ffffff;
}

.woocommerce-cart table.shop_table th,
.woocommerce-checkout table.shop_table th,
.woocommerce-account table.shop_table th {
    padding: 16px 14px;
    border: 0;
    background: rgba(7, 19, 47, 0.04);
    color: var(--color-primary, #07132f);
    font-size: 14px;
    font-weight: 900;
    text-align: right;
}

.woocommerce-cart table.shop_table td,
.woocommerce-checkout table.shop_table td,
.woocommerce-account table.shop_table td {
    padding: 16px 14px;
    border-top: 1px solid rgba(198, 198, 206, 0.65);
    color: var(--color-on-surface, #1a1c1c);
    vertical-align: middle;
}

.woocommerce-cart table.cart img {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--color-surface-container, #eeeeee);
}

.woocommerce-cart table.cart td.product-name a,
.woocommerce-account table.shop_table a,
.woocommerce-checkout table.shop_table a {
    color: var(--color-primary, #07132f);
    font-weight: 800;
    text-decoration: none;
}

.woocommerce-cart table.cart td.product-name a:hover,
.woocommerce-account table.shop_table a:hover,
.woocommerce-checkout table.shop_table a:hover {
    color: var(--color-secondary, #9d4400);
}

.woocommerce-cart .quantity .qty,
.woocommerce-checkout .quantity .qty {
    max-width: 92px;
    min-height: 42px;
    text-align: center;
    border-radius: 12px;
}

.woocommerce-cart table.cart td.actions {
    padding: 18px;
    background: rgba(7, 19, 47, 0.025);
}

.woocommerce-cart table.cart td.actions .coupon {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
}

.woocommerce-cart table.cart td.actions .coupon .input-text {
    width: 260px;
    margin: 0;
}

.woocommerce-cart .cart-collaterals {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    align-items: start;
    gap: 24px;
    margin-top: 26px;
}

.woocommerce-cart .cart-collaterals::before,
.woocommerce-cart .cart-collaterals::after {
    display: none;
}

.woocommerce-cart .cart-collaterals .cart_totals {
    float: none;
    width: 100%;
}

.woocommerce-cart .cart_totals h2,
.woocommerce-cart .cross-sells h2,
.woocommerce-checkout h3,
.woocommerce-checkout #order_review_heading,
.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3 {
    margin: 0 0 18px;
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
}

.woocommerce-cart .wc-proceed-to-checkout {
    padding: 12px 0 0;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    width: 100%;
    margin: 0;
    padding: 16px 22px;
    font-size: 16px;
}

.almajarrat-wc-support-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(7, 19, 47, 0.06);
}

.almajarrat-wc-support-box__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: rgba(244, 114, 22, 0.12);
    color: var(--color-secondary, #9d4400);
    font-size: 24px;
}

.almajarrat-wc-support-box strong {
    display: block;
    margin-bottom: 3px;
    color: var(--color-primary, #07132f);
    font-weight: 900;
}

.almajarrat-wc-support-box p {
    margin: 0;
    color: var(--color-on-surface-variant, #45464d);
    font-size: 14px;
    line-height: 1.8;
}

/* Empty cart */
.woocommerce-cart .cart-empty,
.woocommerce-cart .return-to-shop {
    text-align: center;
}

.woocommerce-cart .cart-empty {
    margin: 0 0 18px;
    padding: 42px 24px;
    border: 1px dashed rgba(198, 198, 206, 0.95);
    border-radius: 24px;
    background: #ffffff;
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', serif;
    font-size: 26px;
    font-weight: 700;
}

/* Checkout */
.woocommerce-checkout form.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 450px);
    align-items: start;
    gap: 26px;
}

.woocommerce-checkout form.checkout::before,
.woocommerce-checkout form.checkout::after {
    display: none;
}

.woocommerce-checkout #customer_details {
    display: grid;
    gap: 22px;
}

.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
    float: none;
    width: 100%;
}

.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout #order_review {
    padding: 22px;
}

.woocommerce-checkout #order_review_heading {
    grid-column: 2;
    grid-row: 1;
    margin: 0 0 -8px;
}

.woocommerce-checkout #order_review {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 108px;
    margin-top: 44px;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table {
    margin-bottom: 18px;
}

.woocommerce-checkout .woocommerce-checkout-payment {
    border-radius: 18px;
    background: rgba(7, 19, 47, 0.035) !important;
}

.woocommerce-checkout #payment ul.payment_methods {
    padding: 16px;
    border-bottom: 1px solid rgba(198, 198, 206, 0.68);
}

.woocommerce-checkout #payment div.form-row {
    padding: 16px;
}

.woocommerce-checkout #place_order {
    width: 100%;
    padding: 16px 22px;
    font-size: 16px;
}

.almajarrat-wc-checkout-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(7, 19, 47, 0.06);
    color: var(--color-on-surface-variant, #45464d);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
}

.almajarrat-wc-checkout-note .material-symbols-outlined {
    color: var(--color-secondary, #9d4400);
    font-size: 22px;
}

.woocommerce-checkout .woocommerce-form-coupon,
.woocommerce-checkout .woocommerce-form-login {
    margin: 0 0 18px;
    padding: 18px;
}

.woocommerce-checkout .woocommerce-privacy-policy-text {
    color: var(--color-on-surface-variant, #45464d);
    font-size: 13px;
    line-height: 1.8;
}

.woocommerce-checkout .woocommerce-order {
    padding: 28px;
    border: 1px solid rgba(198, 198, 206, 0.82);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 16px 44px rgba(7, 19, 47, 0.08);
}

.woocommerce-checkout .woocommerce-order-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
    padding: 0;
}

.woocommerce-checkout .woocommerce-order-overview li {
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(198, 198, 206, 0.72);
    border-radius: 16px;
    background: rgba(7, 19, 47, 0.035);
    color: var(--color-on-surface-variant, #45464d);
    font-size: 13px;
    line-height: 1.7;
}

.woocommerce-checkout .woocommerce-order-overview strong {
    display: block;
    margin-top: 6px;
    color: var(--color-primary, #07132f);
    font-size: 15px;
}

/* My Account */
.woocommerce-account .woocommerce {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.woocommerce-account .almajarrat-wc-system-intro,
.woocommerce-account .woocommerce-notices-wrapper,
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register {
    grid-column: 1 / -1;
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
}

.woocommerce-account .woocommerce-MyAccount-navigation {
    padding: 14px;
    position: sticky;
    top: 108px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
    margin: 0 0 8px;
}

.woocommerce-account .woocommerce-MyAccount-navigation li:last-child {
    margin-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--color-primary, #07132f);
    font-weight: 800;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation a::after {
    content: 'chevron_left';
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
    background: var(--color-secondary-container, #ff7a20);
    color: #ffffff;
    transform: translateX(-2px);
}

.woocommerce-account .woocommerce-MyAccount-content {
    padding: 24px;
    color: var(--color-on-surface, #1a1c1c);
    line-height: 1.9;
}

.woocommerce-account .woocommerce-MyAccount-content p {
    margin-top: 0;
}

.woocommerce-account .woocommerce-MyAccount-content a {
    color: var(--color-secondary, #9d4400);
    font-weight: 800;
    text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-content a:hover {
    text-decoration: underline;
}

.woocommerce-account .addresses .title h3 {
    float: none;
}

.woocommerce-account .addresses .title .edit {
    float: none;
    display: inline-flex;
    margin-bottom: 14px;
}

.woocommerce-account address {
    padding: 16px;
    border: 1px solid rgba(198, 198, 206, 0.75);
    border-radius: 16px;
    background: rgba(7, 19, 47, 0.035);
    font-style: normal;
    line-height: 1.9;
}

.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px;
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__submit,
.woocommerce-account .woocommerce-form-register .woocommerce-form-register__submit {
    width: 100%;
    margin-top: 8px;
}

.woocommerce-account .woocommerce-form-login .woocommerce-LostPassword {
    margin: 14px 0 0;
    text-align: center;
}

/* WooCommerce Blocks fallback */
.almajarrat-wc-system-page .wc-block-cart,
.almajarrat-wc-system-page .wc-block-checkout,
.almajarrat-wc-system-page .wc-block-components-sidebar,
.almajarrat-wc-system-page .wc-block-components-main {
    font-family: 'Cairo', sans-serif;
}

.almajarrat-wc-system-page .wc-block-components-sidebar,
.almajarrat-wc-system-page .wc-block-components-main {
    border-radius: 22px;
}

.almajarrat-wc-system-page .wc-block-components-title {
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', serif;
}

@media (max-width: 1100px) {
    .almajarrat-wc-system-intro,
    .woocommerce-checkout form.checkout,
    .woocommerce-cart .cart-collaterals,
    .woocommerce-account .woocommerce {
        grid-template-columns: 1fr;
    }

    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review {
        grid-column: auto;
        grid-row: auto;
        margin-top: 0;
    }

    .woocommerce-checkout #order_review,
    .woocommerce-account .woocommerce-MyAccount-navigation {
        position: static;
    }

    .almajarrat-wc-system-intro__aside {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .almajarrat-wc-system-page .page-content {
        width: min(100% - 24px, 1280px);
        padding: 36px 0 60px;
    }

    .almajarrat-wc-system-page .page-content article > h1,
    .almajarrat-wc-system-page .entry-title {
        padding: 22px;
        border-radius: 20px;
    }

    .almajarrat-wc-system-intro {
        padding: 22px;
        border-radius: 20px;
    }

    .almajarrat-wc-system-intro__aside {
        align-items: flex-start;
        flex-direction: column;
    }

    .almajarrat-wc-system-intro__icon {
        width: 68px;
        height: 68px;
        border-radius: 18px;
        font-size: 34px;
    }

    .almajarrat-wc-steps {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .woocommerce-cart .woocommerce-cart-form,
    .woocommerce-cart .cart-collaterals .cart_totals,
    .woocommerce-cart .cross-sells,
    .woocommerce-checkout .woocommerce-billing-fields,
    .woocommerce-checkout .woocommerce-shipping-fields,
    .woocommerce-checkout .woocommerce-additional-fields,
    .woocommerce-checkout #order_review,
    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        padding: 18px;
        border-radius: 18px;
    }

    .woocommerce-cart table.cart td.actions .coupon {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-bottom: 10px;
    }

    .woocommerce-cart table.cart td.actions .coupon .input-text,
    .woocommerce-cart table.cart td.actions .coupon .button,
    .woocommerce-cart table.cart td.actions > .button {
        width: 100%;
    }

    .woocommerce-checkout .woocommerce-order-overview {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .woocommerce-cart table.shop_table_responsive tr,
    .woocommerce-page table.shop_table_responsive tr {
        display: block;
        margin-bottom: 14px;
        border: 1px solid rgba(198, 198, 206, 0.78);
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(7, 19, 47, 0.05);
    }

    .woocommerce-cart table.shop_table_responsive tr td,
    .woocommerce-page table.shop_table_responsive tr td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top: 1px solid rgba(198, 198, 206, 0.58);
        text-align: left !important;
    }

    .woocommerce-cart table.shop_table_responsive tr td:first-child,
    .woocommerce-page table.shop_table_responsive tr td:first-child {
        border-top: 0;
    }

    .woocommerce-cart table.shop_table_responsive tr td::before,
    .woocommerce-page table.shop_table_responsive tr td::before {
        margin-left: 16px;
        color: var(--color-primary, #07132f);
        font-weight: 900;
    }

    .woocommerce-cart table.cart img {
        width: 58px;
        height: 58px;
    }

    .woocommerce-checkout .woocommerce-order-overview {
        grid-template-columns: 1fr;
    }
}


/* ================================
   Phase 2.4.1 Review Fixes
================================ */

.almajarrat-wc-system-page .almajarrat-wc-system-entry > h1,
.almajarrat-wc-system-page .entry-title {
    display: none;
}

.almajarrat-wc-order-received-page .almajarrat-wc-step.is-active {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
}

.almajarrat-wc-order-received-page .almajarrat-wc-system-intro__icon {
    color: #15803d;
}

/* WooCommerce Cart / Checkout Blocks fallback */
.almajarrat-wc-system-page .wc-block-cart,
.almajarrat-wc-system-page .wc-block-checkout,
.almajarrat-wc-system-page .wc-block-components-sidebar-layout,
.almajarrat-wc-system-page .wp-block-woocommerce-cart,
.almajarrat-wc-system-page .wp-block-woocommerce-checkout,
.almajarrat-wc-system-page .wp-block-woocommerce-customer-account {
    font-family: 'Cairo', sans-serif;
}

.almajarrat-wc-system-page .wc-block-cart__main,
.almajarrat-wc-system-page .wc-block-cart__sidebar,
.almajarrat-wc-system-page .wc-block-checkout__main,
.almajarrat-wc-system-page .wc-block-checkout__sidebar,
.almajarrat-wc-system-page .wc-block-components-main,
.almajarrat-wc-system-page .wc-block-components-sidebar,
.almajarrat-wc-system-page .wc-block-components-totals-wrapper,
.almajarrat-wc-system-page .wc-block-components-panel,
.almajarrat-wc-system-page .wc-block-components-order-summary,
.almajarrat-wc-system-page .wc-block-components-address-form,
.almajarrat-wc-system-page .wc-block-components-checkout-step {
    border: 1px solid rgba(198, 198, 206, 0.78);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 38px rgba(7, 19, 47, 0.07);
}

.almajarrat-wc-system-page .wc-block-cart__main,
.almajarrat-wc-system-page .wc-block-cart__sidebar,
.almajarrat-wc-system-page .wc-block-checkout__main,
.almajarrat-wc-system-page .wc-block-checkout__sidebar,
.almajarrat-wc-system-page .wc-block-components-panel,
.almajarrat-wc-system-page .wc-block-components-order-summary,
.almajarrat-wc-system-page .wc-block-components-address-form,
.almajarrat-wc-system-page .wc-block-components-checkout-step {
    padding: 22px;
}

.almajarrat-wc-system-page .wc-block-components-button,
.almajarrat-wc-system-page .wc-block-cart__submit-button,
.almajarrat-wc-system-page .wc-block-components-checkout-place-order-button {
    min-height: 48px;
    border-radius: 999px;
    background: var(--color-secondary-container, #ff7a20);
    color: var(--color-on-secondary-container, #ffffff);
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.almajarrat-wc-system-page .wc-block-components-button:hover,
.almajarrat-wc-system-page .wc-block-cart__submit-button:hover,
.almajarrat-wc-system-page .wc-block-components-checkout-place-order-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(244, 114, 22, 0.25);
}

.almajarrat-wc-system-page .wc-block-components-text-input input,
.almajarrat-wc-system-page .wc-block-components-textarea,
.almajarrat-wc-system-page .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,
.almajarrat-wc-system-page .wc-block-components-form .wc-block-components-text-input input[type='email'],
.almajarrat-wc-system-page .wc-block-components-form .wc-block-components-text-input input[type='tel'],
.almajarrat-wc-system-page .wc-block-components-form .wc-block-components-text-input input[type='text'] {
    min-height: 48px;
    border: 1px solid rgba(198, 198, 206, 0.88);
    border-radius: 14px;
    background: #ffffff;
    color: var(--color-on-surface, #1a1c1c);
    font-family: 'Cairo', sans-serif;
}

.almajarrat-wc-system-page .wc-block-components-title,
.almajarrat-wc-system-page .wc-block-components-checkout-step__title,
.almajarrat-wc-system-page .wc-block-cart-items__header,
.almajarrat-wc-system-page .wc-block-components-totals-wrapper {
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', serif;
    font-weight: 800;
}

.almajarrat-wc-system-page .wc-block-components-notice-banner {
    border-radius: 18px;
    font-family: 'Cairo', sans-serif;
}

@media (max-width: 782px) {
    .almajarrat-wc-system-page .wc-block-cart__main,
    .almajarrat-wc-system-page .wc-block-cart__sidebar,
    .almajarrat-wc-system-page .wc-block-checkout__main,
    .almajarrat-wc-system-page .wc-block-checkout__sidebar,
    .almajarrat-wc-system-page .wc-block-components-panel,
    .almajarrat-wc-system-page .wc-block-components-order-summary,
    .almajarrat-wc-system-page .wc-block-components-address-form,
    .almajarrat-wc-system-page .wc-block-components-checkout-step {
        padding: 16px;
        border-radius: 18px;
    }
}

/* ================================
   Phase 2.5 WooCommerce UX Polish
================================ */

.almajarrat-wc-added-message {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.almajarrat-wc-added-message__icon {
    flex: 0 0 auto;
    color: #15803d;
}

.almajarrat-wc-added-message__text {
    flex: 1 1 auto;
    color: var(--color-on-surface, #1a1c1c);
}

.almajarrat-wc-added-message__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--color-primary, #07132f);
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.almajarrat-wc-empty-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 22px;
    align-items: center;
    margin-top: 24px;
    padding: 28px;
    border: 1px solid rgba(198, 198, 206, 0.72);
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(244, 114, 22, 0.08) 100%);
    box-shadow: 0 18px 45px rgba(7, 19, 47, 0.08);
}

.almajarrat-wc-empty-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border-radius: 24px;
    background: rgba(244, 114, 22, 0.12);
    color: var(--color-secondary-container, #f47216);
    font-size: 38px;
}

.almajarrat-wc-empty-panel__content h2 {
    margin: 0 0 8px;
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', serif;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
}

.almajarrat-wc-empty-panel__content p {
    max-width: 680px;
    margin: 0;
    color: var(--color-on-surface-variant, #4f5357);
    line-height: 1.9;
}

.almajarrat-wc-empty-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.almajarrat-wc-empty-panel__primary,
.almajarrat-wc-empty-panel__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.almajarrat-wc-empty-panel__primary {
    background: var(--color-primary, #07132f);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(7, 19, 47, 0.18);
}

.almajarrat-wc-empty-panel__secondary {
    border: 1px solid rgba(7, 19, 47, 0.18);
    background: #ffffff;
    color: var(--color-primary, #07132f);
}

.almajarrat-wc-empty-panel__primary:hover,
.almajarrat-wc-empty-panel__secondary:hover {
    transform: translateY(-1px);
}

.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--dashboard a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--orders a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--downloads a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--edit-address a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--payment-methods a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--edit-account a::before,
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a::before {
    display: inline-flex;
    margin-inline-end: 8px;
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
    vertical-align: middle;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--dashboard a::before { content: 'dashboard'; }
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--orders a::before { content: 'receipt_long'; }
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--downloads a::before { content: 'download'; }
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--edit-address a::before { content: 'location_on'; }
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--payment-methods a::before { content: 'payments'; }
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--edit-account a::before { content: 'manage_accounts'; }
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a::before { content: 'logout'; }

.almajarrat-wc-system-page .woocommerce-NoticeGroup,
.almajarrat-wc-system-page .woocommerce-notices-wrapper {
    scroll-margin-top: 110px;
}

@media (max-width: 640px) {
    .almajarrat-wc-added-message {
        align-items: flex-start;
        flex-direction: column;
    }

    .almajarrat-wc-added-message__button {
        width: 100%;
    }

    .almajarrat-wc-empty-panel {
        grid-template-columns: 1fr;
        padding: 22px;
        text-align: center;
    }

    .almajarrat-wc-empty-panel__icon {
        margin: 0 auto;
    }

    .almajarrat-wc-empty-panel__actions {
        flex-direction: column;
    }

    .almajarrat-wc-empty-panel__primary,
    .almajarrat-wc-empty-panel__secondary {
        width: 100%;
    }
}
/* ================================
   Phase 4.0.4 - Cart Page CSS Fix
================================ */

body.woocommerce-cart .almajarrat-woocommerce-page,
body.woocommerce-cart .woocommerce {
    max-width: 1180px;
    margin: 0 auto;
}

body.woocommerce-cart .almajarrat-woocommerce-intro {
    margin-bottom: 28px;
}

body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart-collaterals {
    background: #ffffff;
    border: 1px solid rgba(7, 19, 47, 0.12);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(7, 19, 47, 0.07);
}

body.woocommerce-cart .woocommerce-cart-form {
    padding: 24px;
}

body.woocommerce-cart .cart-collaterals {
    padding: 22px;
}

body.woocommerce-cart .woocommerce-cart-form__contents {
    width: 100%;
    border: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

body.woocommerce-cart table.shop_table th {
    padding: 14px 12px;
    color: #07132f;
    font-size: 15px;
    font-weight: 800;
    border-bottom: 1px solid rgba(7, 19, 47, 0.12);
}

body.woocommerce-cart table.shop_table td {
    padding: 18px 12px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(7, 19, 47, 0.08);
}

body.woocommerce-cart .product-thumbnail img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid rgba(7, 19, 47, 0.08);
    border-radius: 14px;
    background: #ffffff;
}

body.woocommerce-cart .product-name a {
    color: #07132f;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: none;
}

body.woocommerce-cart .product-price,
body.woocommerce-cart .product-subtotal,
body.woocommerce-cart .woocommerce-Price-amount {
    color: #f97316;
    font-weight: 800;
}

body.woocommerce-cart .quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.woocommerce-cart .quantity input.qty {
    width: 72px;
    height: 42px;
    padding: 0 8px;
    border: 1px solid rgba(7, 19, 47, 0.16);
    border-radius: 12px;
    color: #07132f;
    font-weight: 800;
    text-align: center;
}

body.woocommerce-cart a.remove {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff3ed;
    color: #f97316 !important;
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

body.woocommerce-cart a.remove:hover {
    background: #f97316;
    color: #ffffff !important;
}

body.woocommerce-cart .cart_totals h2 {
    margin: 0 0 18px;
    color: #07132f;
    font-size: 22px;
    font-weight: 900;
}

body.woocommerce-cart .cart_totals table {
    width: 100%;
    border: 0 !important;
}

body.woocommerce-cart .cart_totals th,
body.woocommerce-cart .cart_totals td {
    padding: 14px 0;
    border-bottom: 1px solid rgba(7, 19, 47, 0.08);
}

body.woocommerce-cart .order-total th,
body.woocommerce-cart .order-total td,
body.woocommerce-cart .order-total .woocommerce-Price-amount {
    color: #07132f;
    font-size: 22px;
    font-weight: 900;
}

body.woocommerce-cart .wc-proceed-to-checkout {
    padding: 18px 0 0;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-cart button[name="update_cart"],
body.woocommerce-cart .coupon button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    background: #f97316 !important;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.24);
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    width: 100%;
}

body.woocommerce-cart .coupon {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

body.woocommerce-cart .coupon input.input-text {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(7, 19, 47, 0.16);
    border-radius: 14px;
}

/* Prevent footer from sticking too close */
body.woocommerce-cart .site-footer,
body.woocommerce-cart footer {
    margin-top: 70px;
}

/* Mobile */
@media (max-width: 767px) {
    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart .cart-collaterals {
        padding: 16px;
        border-radius: 18px;
    }

    body.woocommerce-cart table.shop_table td {
        padding: 14px 8px;
    }

    body.woocommerce-cart .product-thumbnail img {
        width: 58px;
        height: 58px;
    }

    body.woocommerce-cart .coupon {
        flex-direction: column;
        align-items: stretch;
    }

    body.woocommerce-cart .coupon input.input-text,
    body.woocommerce-cart .coupon button {
        width: 100%;
    }
}
/* ================================
   Cart Summary Frame Fix
================================ */

body.woocommerce-cart .cart-collaterals {
    padding: 26px !important;
    border: 1px solid rgba(7, 19, 47, 0.12) !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 45px rgba(7, 19, 47, 0.07) !important;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-cart .cart_totals h2 {
    margin: 0 0 20px !important;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(7, 19, 47, 0.1);
    color: #07132f;
    font-size: 20px;
    font-weight: 900;
}

body.woocommerce-cart .cart_totals table,
body.woocommerce-cart .cart_totals table.shop_table {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-cart .cart_totals table th,
body.woocommerce-cart .cart_totals table td {
    padding: 14px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(7, 19, 47, 0.08) !important;
    background: transparent !important;
}

body.woocommerce-cart .cart_totals .order-total th,
body.woocommerce-cart .cart_totals .order-total td {
    border-bottom: 0 !important;
}

body.woocommerce-cart .cart_totals .woocommerce-Price-amount {
    color: #f97316 !important;
    font-weight: 900;
}

/* Coupon inside same visual frame */
body.woocommerce-cart .coupon,
body.woocommerce-cart .woocommerce-cart-form .actions {
    margin: 0 0 18px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-cart .coupon {
    display: grid !important;
    gap: 10px;
}

body.woocommerce-cart .coupon input.input-text {
    width: 100% !important;
    min-height: 48px;
    padding: 0 14px !important;
    border: 1px solid rgba(7, 19, 47, 0.14) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
}

body.woocommerce-cart .coupon button {
    width: 100% !important;
    min-height: 48px;
    border-radius: 999px !important;
    background: #07132f !important;
    color: #ffffff !important;
    font-weight: 900 !important;
}

body.woocommerce-cart .wc-proceed-to-checkout {
    padding-top: 20px !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: #f97316 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
}
/* ================================
   Cart Blocks Summary Unified Frame
================================ */

body.woocommerce-cart .wc-block-cart__sidebar,
body.woocommerce-cart .wc-block-components-sidebar {
    padding: 26px !important;
    border: 1px solid rgba(7, 19, 47, 0.14) !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 45px rgba(7, 19, 47, 0.07) !important;
}

body.woocommerce-cart .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block,
body.woocommerce-cart .wc-block-components-sidebar .wp-block-woocommerce-cart-order-summary-block {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-cart .wc-block-components-totals-wrapper,
body.woocommerce-cart .wc-block-components-panel,
body.woocommerce-cart .wc-block-components-panel__button,
body.woocommerce-cart .wc-block-components-totals-footer-item {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-cart .wc-block-components-totals-wrapper {
    padding: 16px 0 !important;
    border-bottom: 1px solid rgba(7, 19, 47, 0.1) !important;
}

body.woocommerce-cart .wc-block-components-totals-wrapper:last-child,
body.woocommerce-cart .wc-block-components-totals-footer-item {
    border-bottom: 0 !important;
}

body.woocommerce-cart .wc-block-components-panel__button {
    width: 100% !important;
    padding: 0 !important;
    color: #07132f !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    text-align: right !important;
}

body.woocommerce-cart .wc-block-components-totals-footer-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px !important;
}

body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    color: #07132f !important;
    font-size: 20px !important;
    font-weight: 900 !important;
}

body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-formatted-money-amount {
    color: #f97316 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
}

body.woocommerce-cart .wc-block-cart__submit-container {
    margin-top: 22px !important;
}

body.woocommerce-cart .wc-block-cart__submit-button {
    width: 100% !important;
    min-height: 52px !important;
    border-radius: 999px !important;
    background: #f97316 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}
/* Coupon Apply Button - White Text */
body.woocommerce-cart .wc-block-components-totals-coupon__button,
body.woocommerce-cart .wc-block-components-button,
body.woocommerce-cart button[name="apply_coupon"],
body.woocommerce-cart .coupon button {
    color: #ffffff !important;
}

body.woocommerce-cart .wc-block-components-totals-coupon__button span,
body.woocommerce-cart .wc-block-components-button span {
    color: #ffffff !important;
}
/* ================================
   Checkout Order Summary Fix
================================ */

body.woocommerce-checkout .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-checkout__sidebar {
    padding: 26px !important;
    border: 1px solid rgba(7, 19, 47, 0.14) !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 45px rgba(7, 19, 47, 0.07) !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block,
body.woocommerce-checkout .wc-block-components-order-summary {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-order-summary__button-text {
    color: #07132f !important;
    font-size: 22px !important;
    font-weight: 900 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary__content {
    padding: 18px 0 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item {
    display: grid !important;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 16px 0 !important;
    border-bottom: 1px solid rgba(7, 19, 47, 0.08) !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
    width: 58px !important;
    height: 58px !important;
    object-fit: contain;
    border: 1px solid rgba(7, 19, 47, 0.1);
    border-radius: 12px;
    background: #fff;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description {
    color: #07132f !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__quantity {
    background: #07132f !important;
    color: #ffffff !important;
    border: 0 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price {
    color: #f97316 !important;
    font-weight: 900 !important;
}

body.woocommerce-checkout .wc-block-components-totals-wrapper,
body.woocommerce-checkout .wc-block-components-panel {
    margin: 0 !important;
    padding: 16px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(7, 19, 47, 0.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-panel__button {
    padding: 0 !important;
    color: #07132f !important;
    font-weight: 900 !important;
    background: transparent !important;
}

body.woocommerce-checkout .wc-block-components-totals-item__label {
    color: #07132f !important;
    font-weight: 800 !important;
}

body.woocommerce-checkout .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-formatted-money-amount {
    color: #f97316 !important;
    font-weight: 900 !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item {
    padding-top: 18px !important;
    border-bottom: 0 !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    font-size: 22px !important;
    font-weight: 900 !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 22px !important;
}

body.woocommerce-checkout .wc-block-components-totals-coupon__input input {
    min-height: 46px !important;
    border-radius: 12px !important;
}

body.woocommerce-checkout .wc-block-components-totals-coupon__button {
    min-height: 46px !important;
    border-radius: 999px !important;
    background: #07132f !important;
    color: #ffffff !important;
    font-weight: 900 !important;
}

body.woocommerce-checkout .wc-block-components-totals-coupon__button span {
    color: #ffffff !important;
}
/* ================================
   Safe Checkout Summary Spacing Fix
   Does not hide shipping/tax/discount/coupon
================================ */

body.woocommerce-checkout .wc-block-components-totals-wrapper {
    margin: 0 !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(7, 19, 47, 0.08) !important;
}

body.woocommerce-checkout .wc-block-components-totals-item {
    min-height: auto !important;
    padding: 4px 0 !important;
}

body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__value {
    line-height: 1.5 !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item {
    margin-top: 10px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(7, 19, 47, 0.14) !important;
    border-bottom: 0 !important;
}

/* Only hide truly empty block wrappers */
body.woocommerce-checkout .wc-block-components-totals-wrapper:empty {
    display: none !important;
}
/* ================================
   WooCommerce Pages Footer Color Reset
   Keep footer identical to main site
================================ */

body.woocommerce-cart .footer-reference,
body.woocommerce-checkout .footer-reference,
body.woocommerce-account .footer-reference,
body.single-product .footer-reference,
body.tax-product_cat .footer-reference,
body.post-type-archive-product .footer-reference {
    color: #ffffff !important;
}

body.woocommerce-cart .footer-reference h1,
body.woocommerce-cart .footer-reference h2,
body.woocommerce-cart .footer-reference h3,
body.woocommerce-cart .footer-reference h4,
body.woocommerce-cart .footer-reference p,
body.woocommerce-cart .footer-reference a,
body.woocommerce-cart .footer-reference li,
body.woocommerce-checkout .footer-reference h1,
body.woocommerce-checkout .footer-reference h2,
body.woocommerce-checkout .footer-reference h3,
body.woocommerce-checkout .footer-reference h4,
body.woocommerce-checkout .footer-reference p,
body.woocommerce-checkout .footer-reference a,
body.woocommerce-checkout .footer-reference li,
body.woocommerce-account .footer-reference h1,
body.woocommerce-account .footer-reference h2,
body.woocommerce-account .footer-reference h3,
body.woocommerce-account .footer-reference h4,
body.woocommerce-account .footer-reference p,
body.woocommerce-account .footer-reference a,
body.woocommerce-account .footer-reference li,
body.single-product .footer-reference h1,
body.single-product .footer-reference h2,
body.single-product .footer-reference h3,
body.single-product .footer-reference h4,
body.single-product .footer-reference p,
body.single-product .footer-reference a,
body.single-product .footer-reference li,
body.tax-product_cat .footer-reference h1,
body.tax-product_cat .footer-reference h2,
body.tax-product_cat .footer-reference h3,
body.tax-product_cat .footer-reference h4,
body.tax-product_cat .footer-reference p,
body.tax-product_cat .footer-reference a,
body.tax-product_cat .footer-reference li,
body.post-type-archive-product .footer-reference h1,
body.post-type-archive-product .footer-reference h2,
body.post-type-archive-product .footer-reference h3,
body.post-type-archive-product .footer-reference h4,
body.post-type-archive-product .footer-reference p,
body.post-type-archive-product .footer-reference a,
body.post-type-archive-product .footer-reference li {
    color: inherit !important;
}

body.woocommerce-cart .footer-reference__title,
body.woocommerce-checkout .footer-reference__title,
body.woocommerce-account .footer-reference__title,
body.single-product .footer-reference__title,
body.tax-product_cat .footer-reference__title,
body.post-type-archive-product .footer-reference__title {
    color: #ffffff !important;
}

body.woocommerce-cart .footer-reference__description,
body.woocommerce-checkout .footer-reference__description,
body.woocommerce-account .footer-reference__description,
body.single-product .footer-reference__description,
body.tax-product_cat .footer-reference__description,
body.post-type-archive-product .footer-reference__description {
    color: rgba(255, 255, 255, 0.82) !important;
}

body.woocommerce-cart .footer-reference a,
body.woocommerce-checkout .footer-reference a,
body.woocommerce-account .footer-reference a,
body.single-product .footer-reference a,
body.tax-product_cat .footer-reference a,
body.post-type-archive-product .footer-reference a {
    color: #ffffff !important;
}

body.woocommerce-cart .footer-reference a:hover,
body.woocommerce-checkout .footer-reference a:hover,
body.woocommerce-account .footer-reference a:hover,
body.single-product .footer-reference a:hover,
body.tax-product_cat .footer-reference a:hover,
body.post-type-archive-product .footer-reference a:hover {
    color: #f97316 !important;
}
/* ================================
   WooCommerce Inputs Focus - Safe
   Orange border appears only while typing/focusing
================================ */

body.woocommerce-cart input:focus,
body.woocommerce-cart select:focus,
body.woocommerce-cart textarea:focus,
body.woocommerce-checkout input:focus,
body.woocommerce-checkout select:focus,
body.woocommerce-checkout textarea:focus,
body.woocommerce-account input:focus,
body.woocommerce-account select:focus,
body.woocommerce-account textarea:focus,
body.woocommerce-cart .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input:focus,
body.woocommerce-checkout .wc-block-components-address-form input:focus {
    border-color: #f97316 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16) !important;
}

/* Reset filled/active WooCommerce Blocks fields after leaving focus */
body.woocommerce-cart input:not(:focus):not([aria-invalid="true"]),
body.woocommerce-cart select:not(:focus):not([aria-invalid="true"]),
body.woocommerce-cart textarea:not(:focus):not([aria-invalid="true"]),
body.woocommerce-checkout input:not(:focus):not([aria-invalid="true"]),
body.woocommerce-checkout select:not(:focus):not([aria-invalid="true"]),
body.woocommerce-checkout textarea:not(:focus):not([aria-invalid="true"]),
body.woocommerce-account input:not(:focus):not([aria-invalid="true"]),
body.woocommerce-account select:not(:focus):not([aria-invalid="true"]),
body.woocommerce-account textarea:not(:focus):not([aria-invalid="true"]) {
    box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input:not(.has-error) input:not(:focus):not([aria-invalid="true"]),
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input:not(:focus):not([aria-invalid="true"]),
body.woocommerce-checkout .wc-block-components-address-form input:not(:focus):not([aria-invalid="true"]) {
    border-color: rgba(198, 198, 206, 0.88) !important;
    box-shadow: none !important;
}

/* Keep validation errors visible */
body.woocommerce-checkout input[aria-invalid="true"],
body.woocommerce-checkout .wc-block-components-text-input.has-error input {
    border-color: #dc2626 !important;
}
/* ================================
   Order Received Summary Cards Fix
================================ */

body.woocommerce-order-received .woocommerce-order {
    max-width: 1180px;
    margin: 0 auto 70px;
    padding: 34px;
    border: 1px solid rgba(7, 19, 47, 0.12);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(7, 19, 47, 0.08);
}

body.woocommerce-order-received .woocommerce-notice--success,
body.woocommerce-order-received .woocommerce-thankyou-order-received {
    margin: 0 0 24px;
    color: #07132f;
    font-family: 'El Messiri', serif;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.4;
    text-align: right;
}

body.woocommerce-order-received .woocommerce-order-overview {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 32px !important;
    padding: 0 !important;
    list-style: none;
}

body.woocommerce-order-received .woocommerce-order-overview li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 96px;
    margin: 0 !important;
    padding: 18px 20px !important;
    border: 1px solid rgba(7, 19, 47, 0.12) !important;
    border-radius: 18px;
    background: #f8fafc;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
}

body.woocommerce-order-received .woocommerce-order-overview li strong {
    display: block;
    margin: 0;
    color: #07132f;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.5;
    word-break: break-word;
}

body.woocommerce-order-received .woocommerce-order-overview .woocommerce-Price-amount,
body.woocommerce-order-received .woocommerce-order-overview .woocommerce-Price-currencySymbol {
    color: #f97316 !important;
    font-weight: 900;
}

/* Order details sections */
body.woocommerce-order-received .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-customer-details {
    margin-top: 26px;
    padding: 26px;
    border: 1px solid rgba(7, 19, 47, 0.12);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(7, 19, 47, 0.06);
}

/* Responsive */
@media (max-width: 1100px) {
    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.woocommerce-order-received .woocommerce-order {
        padding: 22px;
        border-radius: 22px;
    }

    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    body.woocommerce-order-received .woocommerce-order-overview {
        grid-template-columns: 1fr;
    }
}
/* ================================
   Force Order Received Cards in One Row
================================ */

body.woocommerce-order-received .woocommerce-order-overview,
body.woocommerce-order-received ul.order_details,
body.woocommerce-order-received .woocommerce-thankyou-order-details {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 0 32px !important;
    padding: 0 !important;
    list-style: none !important;
}

body.woocommerce-order-received .woocommerce-order-overview li,
body.woocommerce-order-received ul.order_details li,
body.woocommerce-order-received .woocommerce-thankyou-order-details li {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 104px;
    margin: 0 !important;
    padding: 16px 12px !important;
    float: none !important;
    border: 1px solid rgba(7, 19, 47, 0.12) !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    color: #6b7280 !important;
    text-align: center !important;
    line-height: 1.5 !important;
}

body.woocommerce-order-received .woocommerce-order-overview li strong,
body.woocommerce-order-received ul.order_details li strong,
body.woocommerce-order-received .woocommerce-thankyou-order-details li strong {
    display: block !important;
    margin-top: 8px !important;
    color: #07132f !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1.45 !important;
    word-break: break-word;
}

body.woocommerce-order-received .woocommerce-order-overview li.email strong,
body.woocommerce-order-received ul.order_details li.email strong {
    font-size: 13px !important;
}

/* Mobile */
@media (max-width: 991px) {
    body.woocommerce-order-received .woocommerce-order-overview,
    body.woocommerce-order-received ul.order_details,
    body.woocommerce-order-received .woocommerce-thankyou-order-details {
        flex-wrap: wrap !important;
    }

    body.woocommerce-order-received .woocommerce-order-overview li,
    body.woocommerce-order-received ul.order_details li,
    body.woocommerce-order-received .woocommerce-thankyou-order-details li {
        flex: 1 1 calc(50% - 12px) !important;
    }
}

@media (max-width: 520px) {
    body.woocommerce-order-received .woocommerce-order-overview li,
    body.woocommerce-order-received ul.order_details li,
    body.woocommerce-order-received .woocommerce-thankyou-order-details li {
        flex: 1 1 100% !important;
    }
}
/* ================================
   Order Received Home Button
================================ */

body.woocommerce-order-received .almajarrat-order-home-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 34px 0 0;
}

body.woocommerce-order-received .almajarrat-order-home-button,
body.woocommerce-order-received .almajarrat-order-account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.35;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.woocommerce-order-received .almajarrat-order-home-button {
    background: #f97316;
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.24);
}

body.woocommerce-order-received .almajarrat-order-account-button {
    background: #071633;
    box-shadow: 0 14px 28px rgba(7, 22, 51, 0.2);
}

body.woocommerce-order-received .almajarrat-order-home-button:hover,
body.woocommerce-order-received .almajarrat-order-account-button:hover {
    transform: translateY(-2px);
}

body.woocommerce-order-received .almajarrat-order-home-button:hover {
    box-shadow: 0 18px 34px rgba(249, 115, 22, 0.32);
}

body.woocommerce-order-received .almajarrat-order-account-button:hover {
    box-shadow: 0 18px 34px rgba(7, 22, 51, 0.3);
}

body.woocommerce-order-received .almajarrat-order-home-button .material-symbols-outlined,
body.woocommerce-order-received .almajarrat-order-account-button .material-symbols-outlined {
    flex: 0 0 auto;
    font-size: 21px;
}

@media (max-width: 520px) {
    body.woocommerce-order-received .almajarrat-order-home-action {
        flex-direction: column;
        align-items: stretch;
    }

    body.woocommerce-order-received .almajarrat-order-home-button,
    body.woocommerce-order-received .almajarrat-order-account-button {
        width: 100%;
        max-width: 340px;
        margin-inline: auto;
        padding-inline: 20px;
    }
}

/* ================================
   Final scoped QA fix - Checkout order summary block only
   Scope: WooCommerce Checkout Block sidebar product rows
   Prevents product title/price from collapsing in the narrow summary column.
================================ */
body.woocommerce-checkout .wc-block-components-order-summary-item {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    grid-template-areas:
        "image description"
        "image total" !important;
    column-gap: 12px !important;
    row-gap: 4px !important;
    align-items: center !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image {
    grid-area: image !important;
    align-self: center !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description {
    grid-area: description !important;
    min-width: 0 !important;
    width: auto !important;
    color: #07132f !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    text-align: right !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description a,
body.woocommerce-checkout .wc-block-components-order-summary-item__description span,
body.woocommerce-checkout .wc-block-components-product-name {
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price {
    grid-area: total !important;
    justify-self: start !important;
    align-self: start !important;
    white-space: nowrap !important;
    color: #f97316 !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__quantity {
    z-index: 2 !important;
}

@media (max-width: 782px) {
    body.woocommerce-checkout .wc-block-components-order-summary-item {
        grid-template-columns: 52px minmax(0, 1fr) !important;
        column-gap: 10px !important;
    }
}




/* English cart page fixes only */
html[lang="en"] body.woocommerce-cart .quantity,
html[lang="en-US"] body.woocommerce-cart .quantity,
body.ltr.woocommerce-cart .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html[lang="en"] body.woocommerce-cart .quantity input.qty,
html[lang="en-US"] body.woocommerce-cart .quantity input.qty,
body.ltr.woocommerce-cart .quantity input.qty,
html[lang="en"] body.woocommerce-cart input[type="number"],
html[lang="en-US"] body.woocommerce-cart input[type="number"],
body.ltr.woocommerce-cart input[type="number"] {
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    direction: ltr !important;
}

/* WooCommerce Cart Block quantity selector */
html[lang="en"] body.woocommerce-cart .wc-block-components-quantity-selector,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-quantity-selector,
body.ltr.woocommerce-cart .wc-block-components-quantity-selector {
    display: inline-grid !important;
    grid-template-columns: 36px 52px 36px !important;
    align-items: center !important;
}

html[lang="en"] body.woocommerce-cart .wc-block-components-quantity-selector__input,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-quantity-selector__input,
body.ltr.woocommerce-cart .wc-block-components-quantity-selector__input {
    width: 52px !important;
    min-width: 52px !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    direction: ltr !important;
    justify-self: center !important;
}

/* Move Add coupons title to the left in English only */
html[lang="en"] body.woocommerce-cart .wc-block-components-panel__button,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-panel__button,
body.ltr.woocommerce-cart .wc-block-components-panel__button {
    text-align: left !important;
    justify-content: flex-start !important;
    direction: ltr !important;
}

html[lang="en"] body.woocommerce-cart .wc-block-components-panel__button span,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-panel__button span,
body.ltr.woocommerce-cart .wc-block-components-panel__button span {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Coupon block content alignment in English */
html[lang="en"] body.woocommerce-cart .wc-block-components-totals-coupon,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-totals-coupon,
body.ltr.woocommerce-cart .wc-block-components-totals-coupon {
    text-align: left !important;
    direction: ltr !important;
}



/* English cart quantity number exact center */
html[lang="en"] body.woocommerce-cart .wc-block-components-quantity-selector,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-quantity-selector,
body.ltr.woocommerce-cart .wc-block-components-quantity-selector {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 118px !important;
    height: 38px !important;
    direction: ltr !important;
}

html[lang="en"] body.woocommerce-cart .wc-block-components-quantity-selector__button,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-quantity-selector__button,
body.ltr.woocommerce-cart .wc-block-components-quantity-selector__button {
    width: 34px !important;
    height: 38px !important;
    flex: 0 0 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

html[lang="en"] body.woocommerce-cart .wc-block-components-quantity-selector__input,
html[lang="en-US"] body.woocommerce-cart .wc-block-components-quantity-selector__input,
body.ltr.woocommerce-cart .wc-block-components-quantity-selector__input {
    width: 50px !important;
    height: 38px !important;
    flex: 0 0 50px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    text-align: center !important;
    direction: ltr !important;
    line-height: 38px !important;
    transform: translateX(-5px) !important;
}


/* ================================
   Phase 2.4.2 - My Account Width & Authentication Layout
   Scope: WooCommerce My Account only
================================ */

/* Use the full desktop canvas instead of the narrow default-page container. */
body.woocommerce-account .almajarrat-default-page-content {
    width: min(1320px, calc(100% - 40px));
    max-width: none;
}

body.woocommerce-account .almajarrat-default-page-card {
    padding: clamp(22px, 2.4vw, 34px);
}

body.woocommerce-account .almajarrat-default-page-card__content,
body.woocommerce-account .almajarrat-default-page-card__content > .woocommerce {
    width: 100%;
    max-width: none;
    min-width: 0;
}

/* Logged-in account: compact navigation and a genuinely wide content area. */
body.logged-in.woocommerce-account .woocommerce {
    grid-template-columns: minmax(240px, 270px) minmax(0, 1fr);
    gap: 28px;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-navigation,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content {
    min-width: 0;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content {
    padding: clamp(22px, 2.4vw, 32px);
    overflow: hidden;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content table.shop_table {
    min-width: 0;
    table-layout: auto;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content table.shop_table th,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content table.shop_table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Keep billing and shipping details balanced on wide screens. */
body.logged-in.woocommerce-account .woocommerce-customer-details .col2-set,
body.logged-in.woocommerce-account .woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

body.logged-in.woocommerce-account .woocommerce-customer-details .col-1,
body.logged-in.woocommerce-account .woocommerce-customer-details .col-2,
body.logged-in.woocommerce-account .woocommerce-Addresses .col-1,
body.logged-in.woocommerce-account .woocommerce-Addresses .col-2 {
    float: none;
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* Logged-out account: prevent WooCommerce login/register wrapper from falling
   into the first 300px grid column. */
body.woocommerce-account:not(.logged-in) .woocommerce {
    grid-template-columns: minmax(0, 1fr);
}

body.woocommerce-account:not(.logged-in) #customer_login,
body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword,
body.woocommerce-account:not(.logged-in) form.lost_reset_password {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    min-width: 0;
}

body.woocommerce-account:not(.logged-in) #customer_login {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
    margin: 0;
}

body.woocommerce-account:not(.logged-in) #customer_login::before,
body.woocommerce-account:not(.logged-in) #customer_login::after {
    display: none;
}

body.woocommerce-account:not(.logged-in) #customer_login .u-column1,
body.woocommerce-account:not(.logged-in) #customer_login .u-column2 {
    float: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    margin: 0;
}

body.woocommerce-account:not(.logged-in) #customer_login h2 {
    margin: 0 0 16px;
    color: var(--color-primary, #07132f);
    font-family: 'El Messiri', 'Cairo', serif;
    font-size: clamp(25px, 2.4vw, 32px);
    font-weight: 800;
    line-height: 1.35;
}

body.woocommerce-account:not(.logged-in) .woocommerce-form-login,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(22px, 2.4vw, 30px);
}

body.woocommerce-account:not(.logged-in) .woocommerce-form-login .form-row,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register .form-row,
body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword .form-row,
body.woocommerce-account:not(.logged-in) form.lost_reset_password .form-row {
    width: 100%;
    min-width: 0;
}

body.woocommerce-account:not(.logged-in) .woocommerce-form-login input.input-text,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register input.input-text,
body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword input.input-text,
body.woocommerce-account:not(.logged-in) form.lost_reset_password input.input-text {
    width: 100%;
    min-width: 0;
}

body.woocommerce-account:not(.logged-in) .woocommerce-form-login p,
body.woocommerce-account:not(.logged-in) .woocommerce-form-register p,
body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword p,
body.woocommerce-account:not(.logged-in) form.lost_reset_password p {
    overflow-wrap: anywhere;
}

/* Lost-password and set-new-password screens use the same centered card. */
body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword,
body.woocommerce-account:not(.logged-in) form.lost_reset_password {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid rgba(198, 198, 206, 0.82);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 16px 44px rgba(7, 19, 47, 0.08);
}

body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword .woocommerce-Button,
body.woocommerce-account:not(.logged-in) form.lost_reset_password .woocommerce-Button {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 1100px) {
    body.woocommerce-account .almajarrat-default-page-content {
        width: min(100% - 28px, 980px);
    }

    body.logged-in.woocommerce-account .woocommerce {
        grid-template-columns: minmax(0, 1fr);
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-navigation {
        position: static;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-navigation ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-navigation li {
        margin: 0;
    }
}

@media (max-width: 820px) {
    body.woocommerce-account:not(.logged-in) #customer_login {
        grid-template-columns: minmax(0, 1fr);
    }

    body.logged-in.woocommerce-account .woocommerce-customer-details .col2-set,
    body.logged-in.woocommerce-account .woocommerce-Addresses {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    body.woocommerce-account .almajarrat-default-page-content {
        width: min(100% - 20px, 980px);
    }

    body.woocommerce-account .almajarrat-default-page-card {
        padding: 14px;
        border-radius: 20px;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-navigation ul {
        grid-template-columns: minmax(0, 1fr);
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content,
    body.woocommerce-account:not(.logged-in) .woocommerce-form-login,
    body.woocommerce-account:not(.logged-in) .woocommerce-form-register,
    body.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword,
    body.woocommerce-account:not(.logged-in) form.lost_reset_password {
        padding: 18px;
        border-radius: 18px;
    }

    body.woocommerce-account:not(.logged-in) #customer_login {
        gap: 18px;
    }
}

/* ================================
   Phase 2.4.3 - My Account Order Details Address Layout
   Scope: View-order customer details only
================================ */

/* WooCommerce versions/themes do not always expose the same col2-set wrapper.
   Target both the standard wrapper and direct address columns so billing and
   shipping always stay in one balanced desktop row. */
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .woocommerce-columns--addresses,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .col2-set,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-columns--addresses,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .col2-set {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column--billing-address,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column--shipping-address,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .col-1,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .col-2 {
    float: none !important;
    clear: none !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column__title {
    margin: 0 0 14px !important;
    line-height: 1.35 !important;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details address {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100%;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;
}

/* Some WooCommerce templates output the two address columns directly below
   the customer-details section without a shared wrapper. The parent grid also
   covers that markup, while a normal wrapper spans the full row. */
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 20px !important;
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .woocommerce-columns--addresses,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .col2-set,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .woocommerce-column__title,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > h2,
body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > h3 {
    grid-column: 1 / -1;
}

@media (max-width: 820px) {
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .woocommerce-columns--addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .col2-set,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-columns--addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .col2-set,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* ================================
   Phase 2.4.4 - My Account Navigation Label Width
   Scope: logged-in My Account navigation only
================================ */

/* Give long English labels such as "Account Dashboard" enough horizontal
   room, while preserving the wide account-content area. */
@media (min-width: 1101px) {
    body.logged-in.woocommerce-account .woocommerce {
        grid-template-columns: minmax(310px, 330px) minmax(0, 1fr);
    }
}

body.logged-in.woocommerce-account .woocommerce-MyAccount-navigation a {
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 10px;
    white-space: nowrap;
}

/* ================================
   Phase 2.4.5 - My Account Address Columns Hard Fix
   Scope: Addresses endpoint + View order customer addresses
================================ */

/* Desktop: force both WooCommerce address cards into one real two-column row.
   The broader selectors cover old and new WooCommerce template class names. */
@media (min-width: 821px) {
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .col2-set.addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .woocommerce-columns,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .col2-set,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-columns--addresses {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 24px !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .woocommerce-Address,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .u-column1,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .u-column2,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .col-1,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses > .col-2,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column--billing-address,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column--shipping-address,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .col-1,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .col-2 {
        float: none !important;
        clear: none !important;
        display: flex !important;
        flex-direction: column !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses .woocommerce-Address-title,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses .title,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-column__title {
        width: 100% !important;
        margin: 0 0 14px !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses address,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details address {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-height: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Fallback for older/custom templates that print heading/address pairs
       directly inside .woocommerce-customer-details without column wrappers. */
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: auto 1fr !important;
        align-items: stretch !important;
        gap: 14px 24px !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) > h2:first-of-type,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) > h3:first-of-type {
        grid-column: 1 !important;
        grid-row: 1 !important;
        margin: 0 !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) > address:first-of-type {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) > h2:last-of-type,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) > h3:last-of-type {
        grid-column: 2 !important;
        grid-row: 1 !important;
        margin: 0 !important;
    }

    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) > address:last-of-type {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }
}

/* Tablet/mobile: keep every address card on its own row. */
@media (max-width: 820px) {
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .col2-set.addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .woocommerce-columns,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .col2-set,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details > .addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details .woocommerce-columns--addresses,
    body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> address:nth-of-type(2)) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 20px !important;
    }
}

/* ================================
   Phase 2.4.6 - My Account Address Row Structural Fix
   Scope: Addresses endpoint + View order customer details
================================ */

/* The live WooCommerce markup can use different wrapper class combinations.
   Match the wrapper by its actual address children, then force one non-wrapping
   desktop row. This avoids the float/clear staircase seen on the live site. */
@media (min-width: 821px) {
    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content :is(
        .woocommerce-Addresses,
        .u-columns,
        .col2-set,
        .addresses,
        .woocommerce-columns,
        .woocommerce-columns--addresses
    ):has(> :is(
        .woocommerce-Address,
        .woocommerce-column--billing-address,
        .woocommerce-column--shipping-address,
        .u-column1,
        .u-column2,
        .col-1,
        .col-2
    )) {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 24px !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content .woocommerce-customer-details:has(> .woocommerce-column--billing-address):has(> .woocommerce-column--shipping-address) {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: stretch !important;
        gap: 24px !important;
        width: 100% !important;
    }

    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content :is(
        .woocommerce-Addresses,
        .u-columns,
        .col2-set,
        .addresses,
        .woocommerce-columns,
        .woocommerce-columns--addresses,
        .woocommerce-customer-details
    ) > :is(
        .woocommerce-Address,
        .woocommerce-column,
        .woocommerce-column--billing-address,
        .woocommerce-column--shipping-address,
        .u-column1,
        .u-column2,
        .col-1,
        .col-2
    ) {
        float: none !important;
        clear: none !important;
        position: static !important;
        display: flex !important;
        flex: 1 1 0 !important;
        flex-direction: column !important;
        width: 0 !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content :is(
        .woocommerce-Address,
        .woocommerce-column--billing-address,
        .woocommerce-column--shipping-address,
        .u-column1,
        .u-column2,
        .col-1,
        .col-2
    ) > :is(.title, .woocommerce-Address-title, .woocommerce-column__title, h2, h3) {
        float: none !important;
        clear: none !important;
        width: 100% !important;
        margin-top: 0 !important;
    }

    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content :is(
        .woocommerce-Address,
        .woocommerce-column--billing-address,
        .woocommerce-column--shipping-address,
        .u-column1,
        .u-column2,
        .col-1,
        .col-2
    ) > address {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 820px) {
    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content :is(
        .woocommerce-Addresses,
        .u-columns,
        .col2-set,
        .addresses,
        .woocommerce-columns,
        .woocommerce-columns--addresses,
        .woocommerce-customer-details
    ):has(> :is(
        .woocommerce-Address,
        .woocommerce-column--billing-address,
        .woocommerce-column--shipping-address,
        .u-column1,
        .u-column2,
        .col-1,
        .col-2
    )) {
        display: flex !important;
        flex-flow: column nowrap !important;
        gap: 20px !important;
    }

    html body.logged-in.woocommerce-account .woocommerce-MyAccount-content :is(
        .woocommerce-Addresses,
        .u-columns,
        .col2-set,
        .addresses,
        .woocommerce-columns,
        .woocommerce-columns--addresses,
        .woocommerce-customer-details
    ) > :is(
        .woocommerce-Address,
        .woocommerce-column,
        .woocommerce-column--billing-address,
        .woocommerce-column--shipping-address,
        .u-column1,
        .u-column2,
        .col-1,
        .col-2
    ) {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }
}
