/* ==================================================
 *  ASFAR WooCommerce & Checkout Custom Stylesheet
 *  ------------------------------------------------
 *  Maintained in plugin: asfar-custom-styles
 * ==================================================*/

/* ---------- 1. Modern Quantity Stepper Controls ---------- */

/* Hide native browser spin buttons */
.woocommerce .quantity input[type="number"]::-webkit-inner-spin-button,
.woocommerce .quantity input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.woocommerce .quantity input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Quantity Container Box */
.woocommerce .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    position: relative !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 3px !important;
    gap: 2px !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: 48px !important;
    direction: inherit !important; /* Respects page direction (RTL / LTR) */
    transition: border-color 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s cubic-bezier(0.25, 1, 0.5, 1) !important;
    user-select: none !important;
}

/* Explicit RTL visual ordering for Arabic pages */
html[dir="rtl"] .woocommerce .quantity,
body.rtl .woocommerce .quantity {
    direction: rtl !important; /* [-] on right, [value] in middle, [+] on left */
}

html[dir="ltr"] .woocommerce .quantity,
body.ltr .woocommerce .quantity {
    direction: ltr !important; /* [-] on left, [value] in middle, [+] on right */
}

.woocommerce .quantity:hover {
    border-color: #cbd5e1 !important;
}

.woocommerce .quantity:focus-within {
    border-color: #009245 !important;
    box-shadow: 0 0 0 3px rgba(0, 146, 69, 0.15) !important;
    background-color: #ffffff !important;
}

/* Stepper Buttons (Minus & Plus) */
.woocommerce .quantity .asfar-qty-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.woocommerce .quantity .asfar-qty-btn svg {
    width: 12px !important;
    height: 12px !important;
    pointer-events: none !important;
}

.woocommerce .quantity .asfar-qty-btn svg path {
    stroke: #1e293b !important;
    transition: stroke 0.22s ease !important;
}

.woocommerce .quantity .asfar-qty-btn:hover:not(:disabled) {
    background-color: #009245 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(0, 146, 69, 0.28) !important;
}

.woocommerce .quantity .asfar-qty-btn:hover:not(:disabled) svg path {
    stroke: #ffffff !important;
}

.woocommerce .quantity .asfar-qty-btn:active:not(:disabled) {
    background-color: #007a37 !important;
    box-shadow: 0 1px 3px rgba(0, 146, 69, 0.2) !important;
}

.woocommerce .quantity .asfar-qty-btn:disabled,
.woocommerce .quantity .asfar-qty-btn.is-disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
}

.woocommerce .quantity .asfar-qty-btn:disabled svg path,
.woocommerce .quantity .asfar-qty-btn.is-disabled svg path {
    stroke: #94a3b8 !important;
}

/* Quantity Input Field */
.woocommerce .quantity input.qty,
.woocommerce .quantity input[type="number"].qty {
    width: 52px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 4px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: 40px !important;
}

.woocommerce .quantity input.qty:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.woocommerce .quantity .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- 2. Add-to-Cart Original Gradient Buttons ---------- */
.woocommerce div.product form.cart,
.elementor-widget-woocommerce-product-add-to-cart form.cart {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.woocommerce div.product form.cart .quantity,
.elementor-widget-woocommerce-product-add-to-cart form.cart .quantity {
    margin: 0 !important;
    float: none !important;
}

/* Single Product Original Gradient Button */
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce div.product form.cart .button,
.elementor-widget-woocommerce-product-add-to-cart .single_add_to_cart_button {
    vertical-align: middle !important;
    background-image: linear-gradient(to right, #009245, #fcee21, #00a8c5, #d9e021 160%) !important;
    background-size: 250% auto !important;
    background-position: left center !important;
    padding: 15px 35px !important;
    text-align: center !important;
    font-size: 18px !important;
    color: white !important;
    border-radius: 10px !important;
    display: inline-block !important;
    transition: 0.5s !important;
    border: none !important;
    cursor: pointer !important;
    outline: none !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.woocommerce div.product form.cart .button:hover,
.elementor-widget-woocommerce-product-add-to-cart .single_add_to_cart_button:hover {
    background-position: right center !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* Shop Loop & Category Product Grid Original Gradient Buttons */
.woocommerce ul.products li.product .button,
.woocommerce .products li.product .button,
.woocommerce a.button.add_to_cart_button {
    background-image: linear-gradient(to right, #009245, #fcee21, #00a8c5, #d9e021 450%) !important;
    background-size: 250% auto !important;
    background-position: left center !important;
    text-align: center !important;
    color: white !important;
    border-radius: 10px !important;
    display: block !important;
    transition: 0.5s !important;
    border: none !important;
    padding: 12px 20px !important;
    margin: 8px 12px 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    outline: none !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce .products li.product .button:hover,
.woocommerce a.button.add_to_cart_button:hover {
    background-position: right center !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* ---------- 3. Stripe Payment Card Element ---------- */
div#stripe-card-element.wc-stripe-elements-field.StripeElement {
    padding-right: 45px !important;
}

.wc-stripe-elements-field {
    padding: 12px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 4px !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.wc-stripe-elements-field:hover,
.wc-stripe-elements-field:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2) !important;
}

/* ---------- 4. Alerts & Notifications ---------- */
.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
    padding: 8px;
    margin: 16px 0 10px;
    border-radius: 4px;
}

.alert-success {
    color: black;
    background-color: #ccf2ff;
    border-color: #c3e6cb;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* ---------- 5. Product Details & Additional Information Table Polish ---------- */

/* Heading "معلومات إضافية" */
.elementor-widget-woocommerce-product-additional-information h2,
.woocommerce-product-attributes-item h2,
.woocommerce div.product .shop_attributes + h2,
.woocommerce #tab-additional_information h2 {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 28px 0 16px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Clean Card Container for Table */
.woocommerce table.shop_attributes,
table.woocommerce-product-attributes.shop_attributes {
    width: 100% !important;
    max-width: 800px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    margin-bottom: 28px !important;
    background-color: #ffffff !important;
}

/* Alternating Row Tints */
.woocommerce table.shop_attributes tr,
table.woocommerce-product-attributes.shop_attributes tr {
    transition: background-color 0.15s ease !important;
}

.woocommerce table.shop_attributes tr:nth-child(even),
table.woocommerce-product-attributes.shop_attributes tr:nth-child(even) {
    background-color: #f8fafc !important;
}

.woocommerce table.shop_attributes tr:hover,
table.woocommerce-product-attributes.shop_attributes tr:hover {
    background-color: #f1f5f9 !important;
}

/* Table Attribute Labels (الوزن، مقاس الكتاب، اللغة، الحالة، الناشر) */
.woocommerce table.shop_attributes th,
table.woocommerce-product-attributes.shop_attributes th,
.woocommerce table.shop_attributes th.woocommerce-product-attributes-item__label {
    width: 180px !important;
    min-width: 140px !important;
    background-color: #f8fafc !important;
    color: #334155 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 13px 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-left: 1px solid #f1f5f9 !important; /* Soft vertical divider in RTL */
    border-top: none !important;
    border-right: none !important;
    text-align: right !important;
    vertical-align: middle !important;
    font-style: normal !important;
}

/* Table Attribute Values */
.woocommerce table.shop_attributes td,
table.woocommerce-product-attributes.shop_attributes td,
.woocommerce table.shop_attributes td.woocommerce-product-attributes-item__value {
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-style: normal !important;
    padding: 13px 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    text-align: right !important;
    vertical-align: middle !important;
}

/* Remove bottom border on final row */
.woocommerce table.shop_attributes tr:last-child th,
.woocommerce table.shop_attributes tr:last-child td,
table.woocommerce-product-attributes.shop_attributes tr:last-child th,
table.woocommerce-product-attributes.shop_attributes tr:last-child td {
    border-bottom: none !important;
}

.woocommerce table.shop_attributes td p,
table.woocommerce-product-attributes.shop_attributes td p {
    margin: 0 !important;
    line-height: 1.5 !important;
    font-style: normal !important;
}

/* Attribute Links (الناشر، اللغة) */
.woocommerce table.shop_attributes td a,
table.woocommerce-product-attributes.shop_attributes td a {
    color: #009245 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.woocommerce table.shop_attributes td a:hover,
table.woocommerce-product-attributes.shop_attributes td a:hover {
    color: #007a37 !important;
    text-decoration: underline !important;
}

/* Rating Stars / Condition Accent Color */
.woocommerce table.shop_attributes td a[href*="status"],
table.woocommerce-product-attributes.shop_attributes td a[href*="status"] {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.woocommerce .woocommerce-breadcrumb {
    padding-top: 24px;
}

.woocommerce div.product form.cart .variations td.label {
    padding-right: 16px;
}

/* Overriding Elementor negative margins on product price widget */
.elementor-widget-woocommerce-product-price > .elementor-widget-container,
.elementor-element-c6bcfb5 > .elementor-widget-container {
    margin: 8px 0 !important;
    padding: 0 !important;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    margin: 8px 0 !important;
}

.wcpv-sold-by-loop,
.woocommerce a.added_to_cart {
    display: none;
}

.fa {
    font-family: FontAwesome;
}

/* ---------- 6. Mobile Single Product Layout Fixes ---------- */
@media (max-width: 767px) {
    /* Stack containers cleanly on mobile without side-by-side squishing */
    .elementor-35959 .elementor-element.elementor-element-1b3e137,
    .elementor-35959 .elementor-element.elementor-element-5976670,
    .woocommerce div.product div.images,
    .woocommerce div.product div.summary {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .elementor-35959 .elementor-element.elementor-element-5976670 {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 16px !important;
    }

    /* Product Title Spacing */
    .product_title,
    .elementor-widget-woocommerce-product-title .elementor-heading-title,
    .elementor-35959 .elementor-element.elementor-element-4d94b8c .elementor-heading-title {
        font-size: 22px !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
    }

    /* Price Spacing */
    .woocommerce .elementor-widget-woocommerce-product-price .price,
    .woocommerce div.product p.price {
        font-size: 20px !important;
        margin: 8px 0 !important;
    }

    /* Shipping & Availability Messages */
    .shipping-info,
    .product-availability,
    .old-books-info {
        font-size: 14px !important;
        padding: 10px 14px !important;
        margin-bottom: 10px !important;
        border-radius: 6px !important;
    }

    /* Stock Status */
    p.stock {
        margin: 10px 0 !important;
        font-size: 15px !important;
        font-weight: 700 !important;
    }

    /* Table adjustments for smaller screens */
    .woocommerce table.shop_attributes th,
    table.woocommerce-product-attributes.shop_attributes th {
        width: 120px !important;
        padding: 10px 12px !important;
        font-size: 13px !important;
    }

    .woocommerce table.shop_attributes td,
    table.woocommerce-product-attributes.shop_attributes td {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
}

/* ---------- 7. Order Tracking & Checkout ---------- */
.woocommerce-account a.track-button {
    background: bisque;
    line-height: 5;
}

.elementor-widget-woocommerce-checkout-page .woocommerce-checkout #payment .place-order {
    margin-top: 32px;
}

.elementor-widget-woocommerce-cart .woocommerce .wc-proceed-to-checkout .checkout-button {
    font-size: 22px;
    background-color: #5bde87;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.elementor-widget-woocommerce-cart .woocommerce .wc-proceed-to-checkout .checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(91, 222, 135, 0.35);
}

.woocommerce form .form-row.woocommerce-validated .select2-container,
.woocommerce form .form-row.woocommerce-validated input.input-text,
.woocommerce form .form-row.woocommerce-validated select {
    direction: ltr;
}

.intl-tel-input .country-list {
    position: relative;
    text-align: right;
    direction: ltr;
    padding: 0;
    margin: 0 24px 0 0;
}

.woocommerce-checkout {
    color: #333;
    line-height: 1.6;
}

form.checkout.woocommerce-checkout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

#customer_details {
    width: 100%;
    flex-direction: column;
    padding-right: 2%;
}

.woocommerce-additional-fields {
    margin-top: 20px;
}

#order_review {
    width: 100%;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

#payment {
    width: 100%;
    background: transparent !important;
    border-radius: 4px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
}

.woocommerce-checkout h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2c3e50;
}

.woocommerce form .form-row {
    margin-bottom: 20px;
}

.woocommerce form .form-row label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.woocommerce form .form-row .select2-container--default .select2-selection--single {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
    background-color: #fff;
    color: #333;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box;
}

.woocommerce form .form-row .select2-container--default .select2-selection--arrow {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.woocommerce form .form-row .select2-container--default .select2-selection--single:hover,
.woocommerce form .form-row .select2-container--default .select2-selection--single:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

.woocommerce form .form-row .select2-container--default .select2-results__option {
    padding: 8px 12px;
    font-size: 16px;
    color: #333;
}

.woocommerce form .form-row .select2-container--default .select2-results__option--highlighted {
    background-color: #f0f8ff;
    color: #333;
}

.woocommerce form .form-row .select2-container--default .select2-selection__rendered {
    direction: rtl;
    text-align: right;
}

#payment ul.payment_methods {
    padding: 0;
    border: none;
}

#payment ul.payment_methods li {
    line-height: 2;
    margin-bottom: 10px;
}

#payment div.payment_box {
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.woocommerce-shipping-methods li {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.woocommerce-shipping-methods li .amount {
    font-weight: bold;
}

.woocommerce form .form-row.place-order {
    display: block;
    width: 100%;
    direction: rtl;
    text-align: right;
    margin: 30px 0 0;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-sizing: border-box;
}

.woocommerce form .form-row.place-order noscript {
    display: block;
    margin-bottom: 20px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5em;
}

.woocommerce form .form-row.place-order noscript button.button {
    display: inline-block;
    margin-top: 8px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.woocommerce form .form-row.place-order noscript button.button:hover {
    background-color: #c82333;
}

.woocommerce form .form-row.place-order .woocommerce-privacy-policy-text {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    color: #333;
}

.woocommerce-privacy-policy-text p {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 10px;
}

.woocommerce-terms-and-conditions-wrapper {
    margin-bottom: 20px;
    padding: 0;
}

.woocommerce-terms-and-conditions {
    display: none;
    max-height: 200px;
    overflow: auto;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    direction: rtl;
    text-align: right;
}

.woocommerce form .form-row.place-order .form-row.validate-required {
    display: inline-block;
    margin: 0 0 20px;
    padding: 0;
    font-size: 14px;
    direction: rtl;
    text-align: right;
}

.woocommerce form .form-row.place-order .form-row.validate-required p {
    margin: 0;
    padding: 0;
}

.woocommerce form .form-row.place-order .form-row.validate-required input.woocommerce-form__input-checkbox {
    float: left;
    margin: 0 8px 0 0;
    width: 18px;
    height: 18px;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.woocommerce form .form-row.place-order .form-row.validate-required input.woocommerce-form__input-checkbox:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.woocommerce form .form-row.place-order .form-row.validate-required span.woocommerce-terms-and-conditions-checkbox-text {
    display: inline-block;
    line-height: 1.4;
}

.woocommerce-terms-and-conditions-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    margin-left: 2px;
}

.woocommerce-terms-and-conditions-link:hover {
    text-decoration: underline;
}

.woocommerce form .form-row.place-order .form-row.validate-required abbr.required {
    margin-left: 4px;
    font-size: 14px;
    color: #bf0000;
}

#place_order {
    display: block !important;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background-image: linear-gradient(to right, #009245, #fcee21, #00a8c5, #d9e021 160%) !important;
    background-size: 250% auto !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: 0.5s !important;
    box-sizing: border-box;
    direction: rtl;
}

#place_order:hover {
    background-position: right center !important;
    text-decoration: none;
}

#ppc-button-ppcp-applepay,
#ppc-button-ppcp-googlepay {
    margin-top: 15px;
    width: 100%;
}

@media (max-width: 768px) {
    form.checkout.woocommerce-checkout {
        flex-direction: column;
    }
    
    #customer_details,
    #order_review,
    #payment {
        width: 100%;
    }
    
    #order_review {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .woocommerce-terms-and-conditions-text,
    #place_order,
    #ppc-button-ppcp-applepay,
    #ppc-button-ppcp-googlepay {
        font-size: 16px;
    }
}

/* ---------- 8. Related Products Grid & Cards ---------- */

/* Desktop Grid: 4 columns */
@media (min-width: 992px) {
    .woocommerce ul.products,
    .woocommerce .products ul.products,
    .woocommerce section.products ul.products,
    .woocommerce section.related-products ul.products,
    .woocommerce .related-products ul.products,
    .woocommerce ul.products.columns-3,
    .woocommerce ul.products.columns-4 {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
    }

    .woocommerce ul.products::before,
    .woocommerce ul.products::after,
    .woocommerce .products ul.products::before,
    .woocommerce .products ul.products::after {
        display: none !important;
    }

    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        float: none !important;
        clear: none !important;
    }
}

/* Tablet Grid: 3 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .woocommerce ul.products,
    .woocommerce section.products ul.products,
    .woocommerce section.related-products ul.products {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .woocommerce ul.products li.product {
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
    }
}

/* Mobile Grid: 2 columns */
@media (max-width: 767px) {
    .woocommerce ul.products,
    .woocommerce section.products ul.products,
    .woocommerce section.related-products ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .woocommerce ul.products li.product {
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
    }
}

/* Product Loop Card Structure - Stationary (No wobbly jump/translate) */
.woocommerce ul.products li.product,
.woocommerce .products li.product {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    overflow: hidden !important;
    transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
    box-sizing: border-box !important;
    position: relative !important;
    transform: none !important;
}

.woocommerce ul.products li.product:hover,
.woocommerce .products li.product:hover {
    transform: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    border-color: #cbd5e1 !important;
}

/* Product Card Thumbnail Link & 2:3 Aspect Ratio Image */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.woocommerce .products li.product a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
    flex-grow: 1 !important;
    width: 100% !important;
}

.woocommerce ul.products li.product a img,
.woocommerce .products li.product a img {
    width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    height: auto !important;
    object-fit: cover !important;
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    margin: 0 !important;
    transition: none !important;
    transform: none !important;
    box-sizing: border-box !important;
    display: block !important;
}

.woocommerce ul.products li.product:hover a img {
    transform: none !important;
}

/* Product Title - Clean 2-Line Clamping */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce .products li.product .woocommerce-loop-product__title,
.woocommerce .products li h3 {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    color: #0f172a !important;
    text-align: center !important;
    padding: 10px 10px 4px !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: auto !important;
    min-height: 58px !important;
    max-height: 58px !important;
    box-sizing: border-box !important;
}

/* Product Card Price */
.woocommerce ul.products li.product .price,
.woocommerce .products li.product .price {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #009245 !important;
    text-align: center !important;
    padding: 4px 12px 10px !important;
    margin: 0 !important;
}

/* Related Products Section Header */
.asfar-enhanced-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    padding-bottom: 12px !important;
}

.asfar-enhanced-header h2 {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

.asfar-profile-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background-color: #f8fafc !important;
    color: #334155 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
}

.asfar-profile-btn:hover {
    background-color: #009245 !important;
    color: #ffffff !important;
    border-color: #009245 !important;
    box-shadow: 0 3px 8px rgba(0, 146, 69, 0.2) !important;
}

.asfar-profile-btn:hover .asfar-profile-icon {
    fill: #ffffff !important;
}
