/**
 * RehabCare WooCommerce Integration Stylesheet
 *
 * @package RehabCare
 * @since 1.0.0
 */

.rehabcare-woocommerce-container {
    padding: 80px 0;
    margin-top: 85px;
}

/* Shop and Product Grid (3 Columns CSS Grid) */
.woocommerce ul.products,
.woocommerce-page ul.products,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    margin: 0 0 40px 0 !important;
    padding: 0 !important;
}

/* Clear default WooCommerce float clearing since we use Grid */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
ul.products li.product {
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    text-align: center !important; /* Centered content like home page */
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important; /* Take full width of grid cell */
    float: none !important; /* Disable WooCommerce floats */
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(50, 188, 214, 0.2) !important;
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link img {
    width: 100% !important;
    height: 230px !important; /* Fixed height for consistent grids */
    object-fit: contain !important; /* Whole product photo, any upload size */
    background-color: #fff !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 12px !important; /* Room for the hover zoom without clipping */
    border-radius: 16px 16px 0 0 !important;
    transition: transform 0.5s ease !important;
}

.woocommerce ul.products li.product:hover a.woocommerce-LoopProduct-link img {
    transform: scale(1.06) !important;
}

/* Sale Badge styling */
.woocommerce ul.products li.product span.onsale {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    left: auto !important;
    background-color: #ef4444 !important; /* Premium Red */
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    z-index: 2 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    min-height: auto !important;
    min-width: auto !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Title and Price adjustments */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    padding: 10px 24px 5px 24px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    text-align: center !important; /* Centered like homepage */
    width: 100% !important;
}

.woocommerce ul.products li.product .price {
    font-size: 16px !important;
    color: #F18E29 !important; /* Orange price color */
    font-weight: 800 !important;
    margin: 5px 24px 15px 24px !important;
    text-align: center !important; /* Centered like homepage */
    display: block !important;
    width: 100% !important;
}

.woocommerce ul.products li.product .price del {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-left: 6px !important;
}

.woocommerce ul.products li.product .price ins {
    background: transparent !important;
    text-decoration: none !important;
    color: #F18E29 !important;
    font-weight: 800 !important;
}

/* Responsive Columns Overrides */
@media (max-width: 991px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products,
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 576px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products,
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 Columns on mobile! */
        gap: 12px !important;
    }
    
    .woocommerce ul.products li.product .product-card-actions {
        padding: 8px 10px !important;
        gap: 6px !important;
    }
    
    .woocommerce ul.products li.product .product-action-btn {
        padding: 8px 4px !important;
        font-size: 10.5px !important;
        gap: 4px !important;
        border-radius: 6px !important;
    }
    
    .woocommerce ul.products li.product .product-action-btn svg {
        width: 11px !important;
        height: 11px !important;
    }
    
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
        padding: 8px 10px 4px 10px !important;
    }
    
    .woocommerce ul.products li.product .price {
        font-size: 13px !important;
        margin: 4px 10px 10px 10px !important;
    }
    
    .woocommerce ul.products li.product a.woocommerce-LoopProduct-link img {
        height: 140px !important; /* Shorter image height on mobile */
    }
    
    .woocommerce ul.products li.product .product-card-category {
        font-size: 10px !important;
        margin: 8px 10px 2px 10px !important;
    }
}

/* Single Product Details */
.woocommerce div.product {
    margin-top: 30px;
}

.woocommerce div.product div.images img {
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04);
}

.woocommerce div.product .product_title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
}

/* Brand under the title: logo + name, links to the brand's products */
.product-brand-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -5px 0 18px;
}

.product-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #fff;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-brand-link:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(50, 188, 214, 0.15);
    color: var(--color-primary);
}

.product-brand-line {
    align-items: center;
}

.product-brand-label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.product-brand-logo {
    width: auto !important;
    max-width: calc(var(--brand-logo-size, 64px) * 3);
    height: var(--brand-logo-size, 64px) !important;
    object-fit: contain;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Style: compact = small logo + name inside one box (logo limited to half the size) */
.brand-style-compact .product-brand-logo {
    height: calc(var(--brand-logo-size, 64px) / 2) !important;
}

/* Style: square = logo in a square tile, name beside it */
.brand-style-square .product-brand-link {
    padding: 0;
    border: none;
    background: none;
    gap: 12px;
    font-size: 16px;
}

.brand-style-square .product-brand-link:hover {
    box-shadow: none;
}

.brand-style-square .product-brand-logo {
    width: var(--brand-logo-size, 64px) !important;
    max-width: none;
    padding: 6px;
    box-sizing: border-box;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand-style-square .product-brand-link:hover .product-brand-logo {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(50, 188, 214, 0.15) !important;
}

.brand-style-square .product-brand-link:hover .product-brand-name {
    text-decoration: underline;
}

/* Style: large = big logo alone (name only when there is no logo) */
.brand-style-large .product-brand-link.has-logo {
    padding: 8px 14px;
}

.brand-style-large .product-brand-link.has-logo .product-brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.woocommerce div.product .price {
    color: var(--color-secondary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    color: #64748B;
    line-height: 1.8;
    margin-bottom: 30px;
}

.woocommerce div.product form.cart .button {
    background-color: var(--color-primary);
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.woocommerce div.product form.cart .button:hover {
    background-color: var(--color-secondary);
}

.woocommerce div.product .quantity input {
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e2e8f0;
}

/* Tabs */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    border-bottom: 2px solid #e2e8f0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: none;
    border: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

/* Cart & Checkout page */
/* Cart Page Wrapper */
.woocommerce-cart .woocommerce {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    margin-top: 20px;
}

.woocommerce-cart-form {
    flex: 1 1 65%;
    min-width: 320px;
}

.woocommerce-cart .cart-collaterals {
    flex: 1 1 30%;
    min-width: 300px;
    width: 100%;
}

/* Shop Cart Table to Modern Cards */
.shop_table.cart {
    border-collapse: separate !important;
    border-spacing: 0 16px !important;
    border: none !important;
    background: transparent !important;
    width: 100% !important;
}

.shop_table.cart thead {
    display: none !important; /* Hide old tabular header */
}

.shop_table.cart tr.cart_item {
    background-color: #ffffff;
    border: 1px solid #f1f5f9 !important;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    flex-wrap: wrap;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shop_table.cart tr.cart_item:hover {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.04);
    border-color: rgba(50, 188, 214, 0.2) !important;
}

/* Cart Item cell columns */
.shop_table.cart td {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
}

.shop_table.cart td.product-remove {
    order: 6;
    margin-right: auto; /* push to left in RTL */
}

.shop_table.cart td.product-remove a.remove {
    font-size: 26px !important;
    color: #94a3b8 !important;
    background: transparent !important;
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.shop_table.cart td.product-remove a.remove:hover {
    background-color: #fef2f2 !important;
    color: #ef4444 !important;
}

.shop_table.cart td.product-thumbnail {
    width: 85px;
    height: 85px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.shop_table.cart td.product-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.shop_table.cart td.product-name {
    flex: 2;
    min-width: 180px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
}

.shop_table.cart td.product-name a {
    color: inherit;
    transition: color 0.2s ease;
}

.shop_table.cart td.product-name a:hover {
    color: var(--color-primary);
}

.shop_table.cart td.product-price,
.shop_table.cart td.product-subtotal {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    min-width: 100px;
}

.shop_table.cart td.product-price::before {
    content: "السعر الفردي:";
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.shop_table.cart td.product-subtotal::before {
    content: "الإجمالي الفرعي:";
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.shop_table.cart td.product-quantity {
    display: inline-flex;
    align-items: center;
    min-width: 110px;
}

.shop_table.cart td.product-quantity::before {
    content: "الكمية:";
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-left: 8px; /* RTL spacing */
    font-weight: 600;
}

.shop_table.cart .quantity input.qty {
    width: 54px !important;
    height: 38px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    background: #ffffff !important;
    color: #1e293b !important;
}

/* Coupon & Cart Actions */
.shop_table.cart td.actions {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100% !important;
    padding: 20px 0 !important;
    background: transparent !important;
    border: none !important;
}

.shop_table.cart .coupon {
    display: flex !important;
    gap: 10px;
    align-items: center;
}

.shop_table.cart .coupon input#coupon_code {
    height: 44px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0 16px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 13px !important;
    min-width: 160px;
    outline: none;
    transition: border-color 0.2s ease;
}

.shop_table.cart .coupon input#coupon_code:focus {
    border-color: var(--color-primary);
}

.shop_table.cart .coupon button.button,
.shop_table.cart button[name="update_cart"] {
    height: 44px !important;
    border-radius: 8px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 0 20px !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.shop_table.cart .coupon button.button {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.shop_table.cart .coupon button.button:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.shop_table.cart button[name="update_cart"] {
    background-color: #11323a !important;
    color: #ffffff !important;
}

.shop_table.cart button[name="update_cart"]:hover {
    background-color: var(--color-primary) !important;
    box-shadow: 0 6px 16px rgba(50, 188, 214, 0.2);
}

/* Cart Totals Box */
.cart_totals {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    padding: 24px !important;
    width: 100% !important;
}

.cart_totals h2 {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cart_totals table.shop_table_responsive {
    width: 100% !important;
    border: none !important;
    margin-bottom: 20px !important;
}

.cart_totals table.shop_table_responsive tr {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f8fafc;
}

.cart_totals table.shop_table_responsive tr.order-total {
    border-bottom: none;
    padding-top: 16px;
}

.cart_totals table.shop_table_responsive th {
    font-weight: 600;
    color: #64748b;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.cart_totals table.shop_table_responsive td {
    font-weight: 700;
    color: #0f172a;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
}

.cart_totals table.shop_table_responsive tr.order-total td {
    color: var(--color-secondary) !important;
    font-size: 18px;
}

.wc-proceed-to-checkout a.checkout-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 10px !important;
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(50, 188, 214, 0.25) !important;
    transition: all 0.3s ease !important;
}

.wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #02a8d4 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(50, 188, 214, 0.35) !important;
}

/* ==========================================
   Checkout Page Redesign
   ========================================== */
.woocommerce-checkout form.checkout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    margin-top: 20px;
}

#customer_details {
    flex: 1 1 60%;
    min-width: 320px;
}

#order_review_heading {
    display: none; /* Hide double heading */
}

#order_review {
    flex: 1 1 35%;
    min-width: 300px;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    padding: 24px !important;
}

/* Billing & Shipping Card Wrappers */
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
.woocommerce-additional-fields {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    padding: 24px;
    margin-bottom: 24px;
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* Form inputs & rows styling */
.woocommerce-checkout form .form-row {
    margin-bottom: 16px !important;
}

.woocommerce-checkout form .form-row label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}

.woocommerce-checkout form .form-row input.input-text,
.woocommerce-checkout form .form-row select,
.woocommerce-checkout form .form-row textarea {
    width: 100% !important;
    height: 46px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0 16px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 13.5px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
}

.woocommerce-checkout form .form-row textarea {
    height: 100px !important;
    padding: 12px 16px !important;
}

.woocommerce-checkout form .form-row input.input-text:focus,
.woocommerce-checkout form .form-row select:focus,
.woocommerce-checkout form .form-row textarea:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(50, 188, 214, 0.15) !important;
}

/* Order Review Table */
table.woocommerce-checkout-review-order-table {
    width: 100% !important;
    border: none !important;
    margin-bottom: 20px !important;
}

table.woocommerce-checkout-review-order-table tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8fafc;
}

table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
    font-weight: 600;
    color: #334155;
    font-size: 13.5px;
    text-align: right !important;
    border: none !important;
    padding: 0 !important;
}

table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
    font-weight: 700;
    color: #0f172a;
    text-align: left !important;
    border: none !important;
    padding: 0 !important;
}

table.woocommerce-checkout-review-order-table tr.cart-subtotal th,
table.woocommerce-checkout-review-order-table tr.order-total th {
    font-weight: 600;
    color: #64748b;
    border: none !important;
    padding: 0 !important;
}

table.woocommerce-checkout-review-order-table tr.cart-subtotal td,
table.woocommerce-checkout-review-order-table tr.order-total td {
    text-align: left !important;
    font-weight: 700;
    color: #0f172a;
    border: none !important;
    padding: 0 !important;
}

table.woocommerce-checkout-review-order-table tr.order-total td {
    color: var(--color-secondary) !important;
    font-size: 18px;
}

/* Payment details box */
.woocommerce-checkout-payment {
    background: #f8fafc !important;
    border-radius: 10px;
    padding: 16px !important;
    border: 1px solid #e2e8f0;
}

.woocommerce-checkout-payment ul.payment_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px 0 !important;
}

.woocommerce-checkout-payment ul.payment_methods li {
    margin-bottom: 10px !important;
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
}

.woocommerce-checkout-payment ul.payment_methods li input {
    margin-left: 8px !important;
}

.woocommerce-checkout-payment .payment_box {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    padding: 10px 14px !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    color: #64748b !important;
    margin-top: 6px !important;
    line-height: 1.6 !important;
}

/* Place order button */
.woocommerce-checkout #place_order {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 48px !important;
    border-radius: 10px !important;
    background-color: var(--color-secondary) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(241, 142, 41, 0.25) !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    margin-top: 15px;
}

.woocommerce-checkout #place_order:hover {
    background-color: #d67a1c !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(241, 142, 41, 0.35) !important;
}

/* WooCommerce Alerts styling */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    border-top: 3px solid var(--color-primary) !important;
    background-color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03) !important;
    border-radius: 10px !important;
    padding: 16px 20px !important;
    font-size: 13.5px !important;
    color: #334155 !important;
    list-style: none !important;
    margin-bottom: 24px !important;
    border-right: none !important;
    border-left: none !important;
    border-bottom: none !important;
}

.woocommerce-error {
    border-top-color: #ef4444 !important;
}

.woocommerce-info {
    border-top-color: var(--color-secondary) !important;
}

/* Force action buttons box background and border-top on WooCommerce product loops */
.woocommerce ul.products li.product .product-card-actions {
    background-color: #fafafa !important;
    border-top: 1px solid #f1f5f9 !important;
    padding: 16px 20px !important;
    gap: 12px !important;
    display: flex !important;
    flex-direction: row !important;
    margin-top: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Single Product Page Add to Cart and Quote Button Alignment */
.woocommerce div.product form.cart {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 30px 0 !important;
}

.woocommerce div.product form.cart .quantity {
    margin: 0 !important;
    display: inline-block !important;
}

.woocommerce div.product form.cart .button.single_add_to_cart_button {
    background-color: #32bcd6 !important; /* Teal color like homepage cart button */
    font-family: 'Cairo', sans-serif !important;
    font-weight: 800 !important;
    height: 44px !important;
    padding: 0 28px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.25s ease !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(50, 188, 214, 0.15) !important;
}

.woocommerce div.product form.cart .button.single_add_to_cart_button:hover {
    background-color: #279cb2 !important;
    box-shadow: 0 6px 16px rgba(50, 188, 214, 0.25) !important;
}

/* Quote button on single product page */
.woocommerce div.product form.cart .single-product-quote-btn {
    background-color: #F18E29 !important; /* Brand Orange */
    color: #ffffff !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 800 !important;
    height: 44px !important;
    padding: 0 28px !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.25s ease !important;
    margin: 0 !important; /* Reset margin */
    box-shadow: 0 4px 12px rgba(241, 142, 41, 0.15) !important;
}

.woocommerce div.product form.cart .single-product-quote-btn:hover {
    background-color: #df7f1e !important;
    box-shadow: 0 6px 16px rgba(241, 142, 41, 0.25) !important;
}

/* Mobile Optimizations for Buttons (No Text Wrapping & Large Tap Targets) */
@media (max-width: 576px) {
    /* 1. WooCommerce & Homepage grid card buttons stacked vertically */
    .woocommerce ul.products li.product .product-card-actions,
    .product-card .product-card-actions {
        flex-direction: column !important; /* Stack vertically on mobile grid card */
        padding: 10px 12px !important;
        gap: 8px !important;
    }
    
    .woocommerce ul.products li.product .product-action-btn,
    .product-card .product-action-btn {
        width: 100% !important; /* Take full width of the card */
        flex: none !important;
        padding: 8px 10px !important;
        font-size: 11.5px !important;
        justify-content: center !important;
        gap: 6px !important;
        height: 36px !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    .woocommerce ul.products li.product .product-action-btn svg,
    .product-card .product-action-btn svg {
        width: 13px !important;
        height: 13px !important;
    }
    
    /* 2. Single Product details page buttons alignment */
    .woocommerce div.product form.cart {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important; /* Wrap to row 2 */
        gap: 10px !important;
    }
    
    .woocommerce div.product form.cart .quantity {
        flex: 0 0 60px !important; /* Fixed width spinner on Row 1 */
        margin: 0 !important;
    }
    
    .woocommerce div.product form.cart .button.single_add_to_cart_button {
        flex: 1 !important; /* Spans Row 1 next to quantity */
        justify-content: center !important;
        height: 44px !important;
        font-size: 14px !important;
        padding: 0 !important;
    }
    
    .woocommerce div.product form.cart .single-product-quote-btn {
        flex: 0 0 100% !important; /* Spans full width on Row 2 */
        width: 100% !important;
        justify-content: center !important;
        height: 44px !important;
        font-size: 14px !important;
        margin: 5px 0 0 0 !important; /* Margin top */
        padding: 0 !important;
    }
}

/* Custom Single Product Meta & Tags Styling */
.woocommerce div.product .product_meta {
    display: none !important;
}

.product_meta_custom {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
}

.product_meta_custom .meta-item {
    margin-bottom: 0;
}

.product_meta_custom .tags a {
    display: inline-block;
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2px 0 2px 4px;
}

.product_meta_custom .tags a:hover {
    background-color: #32bcd6;
    color: #ffffff;
    border-color: #32bcd6;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(50, 188, 214, 0.15);
}

/* Folded tags (see "صفحة المنتج" settings) */
.product_meta_custom .tags a[hidden] {
    display: none !important;
}

.product_meta_custom .tags-toggle-btn {
    flex-basis: 100%;
    align-self: flex-start;
    width: auto;
    margin-top: 2px;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    cursor: pointer;
}

.product_meta_custom .tags-toggle-btn:hover {
    text-decoration: underline;
}

.product_meta_custom .tags-toggle-btn[hidden] {
    display: none;
}

/* Stack Billing details and Additional info columns into a single column */
#customer_details.col2-set {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    float: none !important;
    width: 100% !important;
}

#customer_details.col2-set .col-1,
#customer_details.col2-set .col-2 {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
}

/* ==========================================
   Order pages settings (لوحة الإدارة > صفحة الطلب)
   ========================================== */
.rc-order-notice {
    margin: 0 0 20px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
}

.rc-notice-brand {
    background-color: rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.3);
    color: var(--color-primary);
}

.rc-notice-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.rc-notice-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.rc-notice-warning {
    background-color: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.rc-notice-dark {
    background-color: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.rc-notice-custom {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

/* Free shipping progress */
.rc-free-shipping {
    margin: 0 0 20px;
    padding: 14px 18px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}

.rc-free-shipping.is-done {
    border-color: #bbf7d0;
    background-color: #f0fdf4;
    color: #15803d;
}

.rc-free-shipping-bar {
    height: 8px;
    margin-top: 10px;
    border-radius: 8px;
    background-color: #f1f5f9;
    overflow: hidden;
}

.rc-free-shipping-bar span {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--color-primary), #22c55e);
    transition: width 0.5s ease;
}

/* Checkout: one column layout, button width */
.rc-checkout-one-col.woocommerce-checkout form.checkout #customer_details,
.rc-checkout-one-col.woocommerce-checkout form.checkout #order_review {
    flex: 1 1 100%;
}

.rc-checkout-btn-auto.woocommerce-checkout #place_order {
    width: auto !important;
    padding: 0 40px !important;
    margin-inline: auto;
}

/* Thank-you page */
.rc-ty-whatsapp-wrap {
    margin: 10px 0 30px;
    text-align: center;
}

.rc-ty-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    border-radius: 50px;
    background-color: #25d366;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rc-ty-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 211, 102, 0.35);
}

.rc-ty-no-overview .woocommerce-order-overview,
.rc-ty-no-customer .woocommerce-customer-details {
    display: none !important;
}

/* ==========================================
   Product gallery layouts (لوحة الإدارة > صفحة المنتج > معرض صور المنتج)
   ========================================== */
body.single-product {
    --gal-gap: 12px;
    --gal-pad-left: 0px;
    --gal-pad-right: 0px;
}

body.rc-gal-right { --gal-pad-right: calc(var(--rc-thumb, 72px) + var(--gal-gap)); }
body.rc-gal-left { --gal-pad-left: calc(var(--rc-thumb, 72px) + var(--gal-gap)); }

/* Thumbnails: clean squares, whole photo, highlighted when active */
.woocommerce div.product div.images .flex-control-thumbs li {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px !important;
    box-shadow: none !important;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rc-gal-fit-cover.woocommerce div.product div.images .flex-control-thumbs li img {
    object-fit: cover;
    padding: 0;
}

.woocommerce div.product div.images .flex-control-thumbs li img.flex-active,
.woocommerce div.product div.images .flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2) !important;
}

/* Thumbnails in a column beside the main image */
.rc-gal-right .woocommerce-product-gallery.images,
.rc-gal-left .woocommerce-product-gallery.images {
    display: flex !important;
    gap: var(--gal-gap);
    align-items: stretch;
}

.rc-gal-right .woocommerce-product-gallery .flex-viewport,
.rc-gal-left .woocommerce-product-gallery .flex-viewport {
    flex: 1 1 auto;
    min-width: 0;
}

.rc-gal-right .woocommerce-product-gallery .flex-control-thumbs,
.rc-gal-left .woocommerce-product-gallery .flex-control-thumbs {
    flex: 0 0 var(--rc-thumb, 72px);
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    contain: size; /* Column is as tall as the main image and scrolls when there are more photos */
    scrollbar-width: thin;
}

[dir="rtl"] .rc-gal-right .woocommerce-product-gallery .flex-control-thumbs,
:not([dir="rtl"]) > .rc-gal-left .woocommerce-product-gallery .flex-control-thumbs {
    order: -1;
}

/* Thumbnails in a row under the main image */
.rc-gal-bottom .woocommerce-product-gallery .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(var(--rc-thumb-cols, 5), minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px !important;
}

.rc-gal-none .woocommerce-product-gallery .flex-control-thumbs {
    display: none !important;
}

/* Arrows on the main image */
.woocommerce-product-gallery .flex-direction-nav {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-product-gallery .flex-direction-nav a {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    font-size: 0;
    color: #0f172a;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.woocommerce-product-gallery .flex-direction-nav a::before {
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
}

.woocommerce-product-gallery .flex-direction-nav a:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

.woocommerce-product-gallery .flex-direction-nav a.flex-disabled {
    opacity: 0;
    pointer-events: none;
}

/* "Previous" sits on the reading start side */
.woocommerce-product-gallery .flex-direction-nav .flex-prev { left: calc(var(--gal-pad-left) + 12px); }
.woocommerce-product-gallery .flex-direction-nav .flex-next { right: calc(var(--gal-pad-right) + 12px); }
.woocommerce-product-gallery .flex-direction-nav .flex-prev::before { content: "\2039"; }
.woocommerce-product-gallery .flex-direction-nav .flex-next::before { content: "\203A"; }
[dir="rtl"] .woocommerce-product-gallery .flex-direction-nav .flex-prev { left: auto; right: calc(var(--gal-pad-right) + 12px); }
[dir="rtl"] .woocommerce-product-gallery .flex-direction-nav .flex-next { right: auto; left: calc(var(--gal-pad-left) + 12px); }
[dir="rtl"] .woocommerce-product-gallery .flex-direction-nav .flex-prev::before { content: "\203A"; }
[dir="rtl"] .woocommerce-product-gallery .flex-direction-nav .flex-next::before { content: "\2039"; }

/* Zoom (magnifier) button stays on the main image */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    top: 12px !important;
    left: calc(var(--gal-pad-left) + 12px) !important;
    right: auto !important;
}

/* Phones: thumbnails become a swipeable row under the image */
@media (max-width: 768px) {
    .rc-gal-right .woocommerce-product-gallery.images,
    .rc-gal-left .woocommerce-product-gallery.images {
        display: block !important;
    }

    body.rc-gal-right,
    body.rc-gal-left {
        --gal-pad-left: 0px;
        --gal-pad-right: 0px;
    }

    .rc-gal-right .woocommerce-product-gallery .flex-control-thumbs,
    .rc-gal-left .woocommerce-product-gallery .flex-control-thumbs,
    .rc-gal-bottom .woocommerce-product-gallery .flex-control-thumbs {
        display: flex !important;
        flex-direction: row;
        gap: 8px;
        margin-top: 10px !important;
        overflow-x: auto;
        overflow-y: hidden;
        contain: none;
    }

    .woocommerce div.product div.images .flex-control-thumbs li {
        flex: 0 0 64px;
    }

    .woocommerce-product-gallery .flex-direction-nav a {
        width: 34px;
        height: 34px;
        margin-top: -17px;
    }
}

/* Product video slide (box "فيديو المنتج" on the product edit screen) */
.rc-gallery-video .rc-video-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #0f172a;
    border-radius: 20px;
    overflow: hidden;
}

.rc-gallery-video .rc-video-box video,
.rc-gallery-video .rc-video-box iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
    background-color: #000;
}

.rc-video-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    background-color: #000;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

.rc-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.rc-play-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 13px 0 13px 22px;
    border-color: transparent transparent transparent #ffffff;
}

.rc-video-facade:hover .rc-play-icon {
    transform: scale(1.08);
    background-color: #ff0000;
}

/* YouTube thumbnail: play badge (uploaded videos get WooCommerce's own badge) */
.woocommerce div.product div.images .flex-control-thumbs li.rc-youtube-thumb {
    position: relative;
}

.woocommerce div.product div.images .flex-control-thumbs li.rc-youtube-thumb img {
    object-fit: cover;
    padding: 0;
}

/* ==========================================
   Related / upsell products (لوحة الإدارة > صفحة المنتج > المنتجات ذات الصلة)
   ========================================== */
.single-product section.related.products,
.single-product section.up-sells {
    position: relative;
    clear: both;
    border-radius: 20px;
}

.rc-related-subtitle {
    margin: -6px 0 22px;
    color: #64748b;
    font-size: 15px;
}

.rc-rel-center section.related.products > h2,
.rc-rel-center section.up-sells > h2,
.rc-rel-center .rc-related-subtitle {
    text-align: center;
}

/* Grid: chosen number of columns */
.single-product section.related.products ul.products,
.single-product section.up-sells ul.products {
    grid-template-columns: repeat(var(--rc-rel-cols, 3), minmax(0, 1fr)) !important;
}

/* Slider: one row that scrolls, with arrows */
.rc-rel-slider section.related.products ul.products,
.rc-rel-slider section.up-sells ul.products {
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--rc-rel-cols, 3) - 1) * 30px) / var(--rc-rel-cols, 3));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 6px !important;
}

.rc-rel-slider section.related.products ul.products::-webkit-scrollbar,
.rc-rel-slider section.up-sells ul.products::-webkit-scrollbar {
    display: none;
}

.rc-rel-slider section.related.products ul.products li.product,
.rc-rel-slider section.up-sells ul.products li.product {
    scroll-snap-align: start;
}

.rc-rel-nav {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    display: flex;
    gap: 8px;
}

.rc-rel-center .rc-rel-nav {
    position: static;
    justify-content: center;
    margin-bottom: 16px;
}

.rc-rel-nav button {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background-color: #ffffff;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.rc-rel-nav button:hover:not(:disabled) {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.rc-rel-nav button:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Card parts that can be hidden */
.rc-rel-no-cat section.related .product-card-category,
.rc-rel-no-cat section.up-sells .product-card-category,
.rc-rel-no-price section.related .price,
.rc-rel-no-price section.up-sells .price,
.rc-rel-no-btns section.related .product-card-actions,
.rc-rel-no-btns section.up-sells .product-card-actions {
    display: none !important;
}

@media (max-width: 768px) {
    .single-product section.related.products ul.products,
    .single-product section.up-sells ul.products {
        grid-template-columns: repeat(var(--rc-rel-cols-m, 2), minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    .rc-rel-slider section.related.products ul.products,
    .rc-rel-slider section.up-sells ul.products {
        grid-template-columns: none !important;
        grid-auto-columns: calc((100% - (var(--rc-rel-cols-m, 2) - 1) * 14px) / var(--rc-rel-cols-m, 2));
    }

    .rc-rel-nav {
        position: static;
        justify-content: flex-end;
        margin-bottom: 12px;
    }
}

/* Category description folding (لوحة الإدارة > المتجر > وصف التصنيف) */
.term-description {
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.term-description.rc-desc-clamped {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
}

.rc-desc-toggle {
    display: inline-block;
    margin: 6px 0 18px;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.rc-desc-toggle:hover {
    text-decoration: underline;
}

.rc-desc-toggle[hidden] {
    display: none;
}

/* Badges on the product image (sale + the product's own badge), stacked; on the main image, never on the thumbnails */
.woocommerce div.product > .rc-badges {
    position: absolute;
    top: 15px;
    right: calc(var(--gal-pad-right, 0px) + 15px);
    left: auto;
    z-index: 9;
}

html:not([dir="rtl"]) div.product > .rc-badges {
    right: auto;
    left: calc(var(--gal-pad-left, 0px) + 15px);
}

.woocommerce ul.products li.product .rc-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
}

.rc-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.rc-badges .onsale,
.rc-badges .rc-custom-badge,
.woocommerce ul.products li.product .rc-badges span.onsale {
    position: static !important;
    display: inline-block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    background-color: #ef4444 !important; /* Beats WooCommerce's olive ".woocommerce span.onsale" */
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15) !important;
}

.woocommerce ul.products li.product .rc-badges span {
    padding: 4px 12px !important;
    font-size: 11px !important;
}

.rc-badges .rc-custom-badge,
.product-badge.rc-custom-badge {
    background-color: var(--color-primary) !important;
}

/* Badge corner (setting "مكان الشارات") — physical left / right of the main image */
.rc-bdg-left .woocommerce div.product > .rc-badges,
body.rc-bdg-left div.product > .rc-badges {
    right: auto;
    left: calc(var(--gal-pad-left, 0px) + 15px);
    align-items: flex-end; /* RTL: stack aligned to the left edge */
}

body.rc-bdg-right div.product > .rc-badges {
    left: auto;
    right: calc(var(--gal-pad-right, 0px) + 15px);
}

/* Magnifier corner (setting "مكان علامة التكبير") */
body.rc-zoom-right.woocommerce div.product div.images .woocommerce-product-gallery__trigger,
body.rc-zoom-right div.product div.images .woocommerce-product-gallery__trigger {
    left: auto !important;
    right: calc(var(--gal-pad-right, 0px) + 12px) !important;
}

/* Badges moved inside the gallery by main.js: corners of the main image */
.woocommerce-product-gallery > .rc-badges.rc-badges-in-gallery {
    position: absolute;
    top: 15px;
    z-index: 9;
}

body.rc-bdg-left .woocommerce-product-gallery > .rc-badges.rc-badges-in-gallery {
    left: calc(var(--gal-pad-left, 0px) + 15px);
    right: auto;
    align-items: flex-end;
}

body.rc-bdg-right .woocommerce-product-gallery > .rc-badges.rc-badges-in-gallery {
    right: calc(var(--gal-pad-right, 0px) + 15px);
    left: auto;
    align-items: flex-start;
}

/* ==========================================
   Variable products: options (لوحة الإدارة > صفحة المنتج > اختيار المقاسات والأنواع)
   ========================================== */
.woocommerce div.product form.cart table.variations {
    width: 100%;
    margin-bottom: 16px;
    border: 0;
}

.woocommerce div.product form.cart table.variations tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td {
    display: block;
    padding: 0 !important;
    border: 0;
    text-align: start;
    line-height: 1.4;
}

.woocommerce div.product form.cart table.variations th label {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.woocommerce div.product form.cart table.variations td.value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Buttons */
/* Real select kept for WooCommerce, out of sight (WooCommerce gives selects min-width: 75%,
   which made it 870px wide and pushed RTL pages sideways) */
.rc-var-hidden-select {
    position: absolute !important;
    width: 1px !important;
    min-width: 0 !important;
    max-width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    inset-inline-start: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* The hover-zoom image (1024px) stays inside its slide */
.woocommerce div.product div.images .woocommerce-product-gallery__image {
    position: relative;
    overflow: hidden;
}

.rc-var-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rc-var-option {
    min-width: 64px;
    padding: 10px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.rc-var-option:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.rc-var-option.is-active {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(var(--color-primary-rgb), 0.25);
}

.rc-var-option.is-disabled {
    opacity: 0.4;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* Modern dropdown (when "قائمة منسدلة" is chosen) */
select.rc-var-modern-select {
    -webkit-appearance: none;
    appearance: none;
    min-width: 220px;
    max-width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    color: #0f172a;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.rc-var-modern-select:hover,
select.rc-var-modern-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
    outline: none;
}

/* "إزالة" (clear) link */
.woocommerce div.product form.cart .reset_variations {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: #f1f5f9;
    color: #64748b !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
}

.woocommerce div.product form.cart .reset_variations::before {
    content: "\00D7";
    font-size: 16px;
    line-height: 1;
}

.woocommerce div.product form.cart .reset_variations:hover {
    background-color: #fee2e2;
    color: #b91c1c !important;
}

/* The chosen option's price is shown at the top, so the copy under the options is hidden */
body.rc-var-price-top .woocommerce-variation-price {
    display: none !important;
}

.woocommerce div.product p.price.rc-price-chosen {
    animation: rc-tab-fade 0.3s ease;
}

/* ---- Option styles (main.js builds them; style per attribute or the default from the settings) ---- */
.rc-var-chosen {
    margin-inline-start: 2px;
    font-weight: 600;
    color: var(--color-primary);
}

/* Sizes */
.rc-var-size-s .rc-var-option { padding: 7px 13px; font-size: 13px; min-width: 52px; }
.rc-var-size-l .rc-var-option { padding: 13px 24px; font-size: 16px; min-width: 76px; }

/* Boxes (S / M / L) */
.rc-var-boxes .rc-var-option {
    min-width: 52px;
    height: 52px;
    padding: 0 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rc-var-size-s .rc-var-boxes .rc-var-option { min-width: 42px; height: 42px; }
.rc-var-size-l .rc-var-boxes .rc-var-option { min-width: 64px; height: 64px; }

/* Vertical list with price */
.rc-var-list {
    flex-direction: column;
    width: 100%;
    max-width: 460px;
}

.rc-var-list .rc-var-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: start;
}

.rc-var-list .rc-var-option.is-active {
    background-color: rgba(var(--color-primary-rgb), 0.08);
    color: #0f172a;
    box-shadow: none;
}

.rc-var-radio {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rc-var-list .is-active .rc-var-radio {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 4px #ffffff, inset 0 0 0 10px var(--color-primary);
}

.rc-var-name {
    flex: 1;
}

.rc-var-price {
    color: var(--color-secondary);
    font-weight: 800;
    white-space: nowrap;
}

.rc-var-price del {
    display: none;
}

/* Image cards */
.rc-var-images .rc-var-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 120px;
    padding: 8px 8px 10px;
}

.rc-var-size-s .rc-var-images .rc-var-option { width: 96px; }
.rc-var-size-l .rc-var-images .rc-var-option { width: 150px; }

.rc-var-images .rc-var-option.is-active {
    background-color: #ffffff;
    color: #0f172a;
}

.rc-var-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    background-color: #f8fafc;
}

.rc-var-images .rc-var-name {
    font-size: 13px;
    text-align: center;
}

.rc-var-images .rc-var-price {
    font-size: 12px;
}

/* Colour circles */
.rc-var-colors {
    gap: 10px;
}

.rc-var-colors .rc-var-option {
    min-width: 0;
    width: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 50%;
    background-color: #ffffff;
}

.rc-swatch-square .rc-var-colors .rc-var-option { border-radius: 10px; }
.rc-var-size-s .rc-var-colors .rc-var-option { width: 32px; height: 32px; }
.rc-var-size-l .rc-var-colors .rc-var-option { width: 50px; height: 50px; }

.rc-swatch-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.rc-var-colors .rc-var-option.is-active {
    background-color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.25);
}

.rc-var-colors .rc-var-option.is-disabled {
    text-decoration: none;
    opacity: 0.3;
}

/* "طلب عرض سعر فقط" (product edit > إخفاء السعر): no add-to-cart, quantity + quote button stay */
body.rc-price-hidden.woocommerce div.product form.cart .button.single_add_to_cart_button,
body.rc-price-hidden div.product .woocommerce-variation-price,
body.rc-price-hidden div.product .woocommerce-variation-availability {
    display: none !important;
}

body.rc-price-hidden.woocommerce div.product form.cart .single-product-quote-btn {
    flex: 1 1 auto;
    min-width: 220px;
    height: 52px !important;
    font-size: 16px !important;
}

.rc-price-hidden-text {
    display: inline-block;
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 800;
    direction: rtl;
}

.woocommerce ul.products li.product .price .rc-price-hidden-text,
.product-card-price-box .rc-price-hidden-text {
    font-size: 14px;
}

/* Option lists/cards never repeat the text as an option "price" */
.rc-var-price .rc-price-hidden-text {
    display: none;
}
