/* ==========================================================================
   MASTER MY ACCOUNT STYLESHEET (css-myaccount.css)
   Organized: Login Vault, WhatsApp Modal, Dashboard UI, & Order Receipts
   ========================================================================== */

/* ==========================================================================
   MODULE 1: SOCIAL LOGIN BUTTONS BASE
   ========================================================================== */

.nsl-container {
    margin-top: 20px !important;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
    clear: both;
}

.nsl-container .nsl-button-google {
    border-radius: 50px !important;
    width: 100% !important;
}


/* ==========================================================================
   MODULE 2: LOGIN CORE LAYOUT & THE VAULT BOX
   ========================================================================== */

/* Forcefully Hide WooCommerce Register Column */
#customer_login .u-column2, 
#customer_login .col-2,
.woocommerce-page .col-2,
.woocommerce-form-register {
    display: none !important;
}

/* The Branded Vault Box (Base setup) */
#customer_login .u-column1, 
#customer_login .col-1 {
    width: 100% !important;
    max-width: 440px;
    margin: 40px auto !important;
    float: none !important;
    padding: 35px !important;
    background: #ffffff;
    border-radius: 24px;
    border: 2px solid #8db73b !important;
    box-shadow: 0 15px 45px rgba(0,0,0,0.06);
}

/* Vault Box Padding Overrides (Trims top/bottom fat for compact look) */
#customer_login .u-column1, 
#customer_login .col-1 {
    padding: 25px 30px !important; 
}
#customer_login .u-column1, 
#customer_login .col-1 {
    padding: 20px 30px !important; 
}


/* ==========================================================================
   MODULE 3: GENERAL FORM SPACING & HEIGHTS
   ========================================================================== */

/* Base Form Spacing */
.woocommerce-form-login .form-row,
.woocommerce-LostPassword,
.khs-equal-space {
    margin-bottom: 16px !important;
    margin-top: 0 !important;
    padding: 0 !important;
}

/* Tightened Spacing (Reduces overall form length) */
.woocommerce-form-login .form-row,
.woocommerce-form-login p,
.khs-equal-space {
    margin-bottom: 12px !important; 
    margin-top: 0 !important;
}

/* Trim Input Heights */
.woocommerce-form-login input.input-text {
    height: 44px !important; /* Slimmer inputs */
}

/* Trim Divider Margins */
.keyhub-social-divider {
    margin: 15px 0 15px 0 !important; 
}


/* ==========================================================================
   MODULE 4: LOGIN BUTTONS & SOCIAL AUTH STACK
   ========================================================================== */

/* Modern Full-Width Button Stack (Prevents text cut-offs) */
.khs-modern-social-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}
.khs-modern-social-stack {
    gap: 16px !important; /* Forces perfect gap match */
}

/* Base Button Styling */
.khs-modern-social-stack .nsl-container, 
.khs-modern-social-stack .nsl-button,
#khs-wa-trigger,
#customer_login .button {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 50px !important;
    height: 48px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    border: none !important;
    cursor: pointer;
    transition: 0.3s ease;
}

/* Slim Button Override (Reduces height) */
.khs-modern-social-stack .nsl-button, 
#khs-wa-trigger, 
#customer_login .button {
    height: 44px !important; /* Slimmer buttons (down from 48px) */
    margin: 0 !important;
}

/* Specific Button Spacing (Gap between Google and WhatsApp) */
.khs-stack-btn {
    margin-bottom: 12px !important;
}

/* Button Brand Colors */
#khs-wa-trigger { background: #25D366 !important; color: #fff !important; }
#khs-wa-trigger:hover { background: #1ebe57 !important; transform: translateY(-2px); }

#customer_login .button { background: #8db73b !important; color: #fff !important; }
#customer_login .button:hover { opacity: 0.9; transform: translateY(-2px); }


/* ==========================================================================
   MODULE 5: WHATSAPP POPUP MODAL (BASE & STRUCTURE)
   ========================================================================== */

/* True Dark Overlay */
#khs-wa-overlay {
    position: fixed;
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.65); /* Darkens the rest of the site */
    z-index: 99999;
    /* display is handled by javascript */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

/* The Modal Box */
.khs-wa-modal {
    background: #fff;
    padding: 40px 30px;
    border-radius: 20px;
    position: relative;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 2px solid #8db73b;
    text-align: center;
}

/* Curves Lock & Scroll Protection */
.khs-wa-modal {
    border-radius: 20px !important;
    overflow: hidden !important; /* MAGIC FIX: Clips injected square elements to the curves */
    max-height: 85vh !important; /* Prevents stretching to the edges of the screen */
    overflow-y: auto !important; /* Enables scrolling inside if the QR code step is tall */
    position: relative;
}
.khs-wa-modal {
    max-height: 95vh !important; /* Increased from 85vh to fit the QR code better */
}

/* Ensure dynamically loaded square containers inherit the curves */
.khs-wa-modal > div,
.khs-wa-modal form,
div[id^="lwro_login_otp_form"] {
    border-radius: inherit !important;
}

/* Invisible Scrollbar Fixes */
.khs-wa-modal::-webkit-scrollbar,
.khs-wa-modal form::-webkit-scrollbar,
div[id^="lwro_login_otp_form"]::-webkit-scrollbar {
    display: none !important;
}

/* Hide scrollbar for Firefox, IE, and Edge */
.khs-wa-modal,
.khs-wa-modal form,
div[id^="lwro_login_otp_form"] {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* Modal Close Button & Cleanup */
#khs-wa-close {
    position: absolute;
    top: 10px; right: 20px;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    color: #999;
}
#khs-wa-close:hover { color: #ff0000; }

/* Hide Plugin Clutter inside Modal */
.khs-wa-modal a[href*="whatsiplus"], 
.khs-wa-modal span[style*="font-size: 10px"] { display: none !important; }


/* ==========================================================================
   MODULE 6: WHATSAPP STEP 2 (QR CODE & OTP)
   ========================================================================== */

/* Inner Button Spacing */
#khs-wa-overlay .button,
#khs-wa-overlay input[type="submit"],
#khs-wa-overlay button {
    margin-bottom: 12px !important; /* Adds the missing gap between buttons */
    width: 100% !important;
    height: 46px !important;
    border-radius: 50px !important;
}

/* Ensure the very last button doesn't create extra blank space at the bottom */
#khs-wa-overlay .button:last-child,
#khs-wa-overlay input[type="submit"]:last-child,
#khs-wa-overlay button:last-child {
    margin-bottom: 0 !important;
}

/* QR Code Breathing Room */
#khs-wa-overlay img {
    margin: 20px auto !important;
    display: block !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
}

/* Modern Pin Code Box */
#khs-wa-overlay span[style*="border"], 
#khs-wa-overlay span[style*="dashed"] {
    display: inline-block !important;
    border: 2px dashed #8db73b !important; /* Matches your brand green */
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    letter-spacing: 2px !important;
    margin: 10px auto 20px !important;
}

/* General Text Spacing */
#khs-wa-overlay p {
    margin-bottom: 15px !important;
    line-height: 1.5 !important;
}


/* ==========================================================================
   MODULE 7: LOGIN & WHATSAPP (MOBILE & RTL)
   ========================================================================== */

/* Mobile & Tablet Responsiveness */
@media (max-width: 768px) {
    /* Shrink the main vault box padding for smaller screens */
    #customer_login .u-column1, 
    #customer_login .col-1 {
        padding: 25px 15px !important;
        margin: 20px auto !important;
        border-radius: 18px !important;
    }

    /* Shrink the popup so it doesn't touch the edges of a phone */
    .khs-wa-modal {
        padding: 30px 15px !important;
        width: 95% !important;
    }

    /* Ensure the QR code scales down on tiny screens */
    #khs-wa-overlay img {
        max-width: 75% !important;
        height: auto !important;
        margin: 15px auto !important;
    }
}

/* Arabic (RTL) Fixes */
/* Moves the 'X' close button to the left side when viewing the Arabic site */
html[dir="rtl"] #khs-wa-close,
body.rtl #khs-wa-close {
    right: auto !important;
    left: 20px !important;
}

/* Ensures proper font rendering and alignment for Arabic text */
html[dir="rtl"] .khs-equal-space,
html[dir="rtl"] .khs-modern-social-stack,
body.rtl .khs-equal-space,
body.rtl .khs-modern-social-stack {
    direction: rtl !important;
    font-family: inherit; /* Inherits your Arabic site font */
}


/* ==========================================================================
   MODULE 8: MODERN MY ACCOUNT DASHBOARD (CORE LAYOUT)
   ========================================================================== */

/* Main Layout: Split into Sidebar and Content Card - ONLY FOR LOGGED IN USERS */
.logged-in.woocommerce-account .woocommerce {
    display: flex !important; 
    gap: 40px !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    margin-top: 20px;
}

/* Re-centering rule for logged-out users (Login/Register forms) */
.woocommerce-account:not(.logged-in) .woocommerce {
    display: block !important;
    max-width: 100% !important;
}

/* The Navigation Sidebar */
.woocommerce-MyAccount-navigation {
    width: 28% !important;
    float: none !important;
    background: #ffffff;
    padding: 30px 20px !important;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
}

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

.woocommerce-MyAccount-navigation ul li {
    margin-bottom: 10px !important;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block !important;
    padding: 15px 25px !important;
    border-radius: 50px !important; /* Brand pill shape */
    color: #555555 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    text-decoration: none !important;
    background: #f9f9f9 !important;
    transition: all 0.3s ease !important;
}

/* Hover & Active States (Key Hub Green) */
.woocommerce-MyAccount-navigation ul li:hover a {
    background: #f0f0f0 !important;
    transform: translateX(5px);
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    background: #8db73b !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(141, 183, 59, 0.3) !important;
    transform: translateX(5px);
}

/* The Content Area (The Vault Card) */
.woocommerce-MyAccount-content {
    width: 72% !important;
    float: none !important;
    background: #ffffff;
    padding: 40px !important;
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.05);
    border: 2px solid #8db73b !important; /* Matches the login vault border */
}

/* Orders Table Modernization */
.woocommerce-MyAccount-content table.shop_table {
    border-collapse: collapse !important;
    width: 100% !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    border: 1px solid #eee !important;
}

.woocommerce-MyAccount-content table th {
    background: #f9f9f9 !important;
    color: #333 !important;
    padding: 18px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    border-bottom: 2px solid #eee !important;
}

.woocommerce-MyAccount-content table td {
    padding: 18px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    vertical-align: middle !important;
}

/* Format the "View Order" Buttons */
.woocommerce-MyAccount-content .button {
    border-radius: 50px !important;
    background: #8db73b !important;
    color: #fff !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    padding: 12px 25px !important;
    border: none !important;
}

/* Forms (Addresses & Account Details) */
.woocommerce-MyAccount-content input.input-text {
    height: 48px !important;
    border-radius: 12px !important;
    border: 1px solid #ddd !important;
    padding: 0 15px !important;
    background: #fcfcfc !important;
}

.woocommerce-MyAccount-content input.input-text:focus {
    border-color: #8db73b !important;
    background: #fff !important;
}

/* Delete Account Zone */
.khs-delete-account-wrap {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px dashed #eee;
}

.khs-delete-account-wrap h3 {
    color: #e74c3c !important; /* Red for danger */
    margin-bottom: 10px;
}

.khs-delete-btn {
    background-color: #e74c3c !important;
    margin-top: 15px !important;
}
.khs-delete-btn:hover {
    background-color: #c0392b !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column !important;
    }
    .woocommerce-MyAccount-navigation,
    .woocommerce-MyAccount-content {
        width: 100% !important;
    }
    .woocommerce-MyAccount-content {
        padding: 25px 20px !important;
    }
}


/* ==========================================================================
   MODULE 9: DASHBOARD INTERNAL POLISH & MENU ALIGNMENT
   ========================================================================== */

/* Sidebar Menu Fixes */
.woocommerce-MyAccount-navigation ul,
.woocommerce-MyAccount-navigation ul li {
    border: none !important; /* Removes the ugly grey top line */
}
.woocommerce-MyAccount-navigation ul li {
    margin-bottom: 15px !important; /* Adds breathing room between tabs */
}

/* Dashboard Typography */
.woocommerce-MyAccount-content > p,
.woocommerce-MyAccount-content > div > p {
    font-size: 15px !important;
    line-height: 1.8 !important;
    color: #666 !important;
    margin-bottom: 20px !important;
}
.woocommerce-MyAccount-content p a {
    color: #8db73b !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: 0.3s ease;
}
.woocommerce-MyAccount-content p a:hover {
    border-color: #8db73b !important;
}


/* ==========================================================================
   MODULE 10: REFINED ADDRESSES CARD (FULL WIDTH)
   ========================================================================== */

/* The Container (Stacks cards neatly at 100% width) */
.woocommerce-MyAccount-content .woocommerce-Addresses {
    display: flex !important;
    flex-direction: column !important; /* Forces 100% width stacking */
    gap: 30px !important;
    margin-top: 20px !important;
}

/* Remove default WooCommerce floats */
.woocommerce-MyAccount-content .woocommerce-Addresses::before,
.woocommerce-MyAccount-content .woocommerce-Addresses::after {
    display: none !important; 
}

/* The Main Card Body (Now Full Width) */
.woocommerce-MyAccount-content .u-columns .woocommerce-Address,
.woocommerce-MyAccount-content .woocommerce-Address {
    width: 100% !important;
    max-width: 100% !important; /* Overrides the previous 450px restriction */
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    padding: 30px !important;
    border-radius: 20px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02) !important;
    margin: 0 !important;
    text-align: left !important; 
}

/* Header & Flex layout */
.woocommerce-MyAccount-content .woocommerce-Address-title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #eeeeee !important;
    padding-bottom: 15px !important;
    flex-wrap: nowrap !important; 
    gap: 20px !important;
}

/* The Title (Fixes the massive wrapping text) */
.woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    font-size: 22px !important; /* Forces a normal size over the theme default */
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: #333 !important;
    margin: 0 !important;
    text-align: left !important; 
    white-space: nowrap !important; /* Forces "Billing address" onto one line */
}

/* The Edit Badge */
.woocommerce-MyAccount-content .woocommerce-Address-title .edit {
    white-space: nowrap !important; 
    flex-shrink: 0 !important; 
    overflow: visible !important; 
    max-width: none !important; 
    width: auto !important; 
    min-width: 0 !important; 
    height: auto !important; 
    background: #8db73b !important;
    color: #ffffff !important;
    padding: 8px 18px !important; 
    border-radius: 50px !important;
    font-size: 11px !important; 
    font-weight: 800 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-MyAccount-content .woocommerce-Address-title .edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(141, 183, 59, 0.2);
}

/* The Address Text */
.woocommerce-MyAccount-content .woocommerce-Address address {
    font-style: normal !important;
    line-height: 1.8 !important;
    color: #555 !important;
    font-size: 15px !important;
}


/* ==========================================================================
   MODULE 11: ACCOUNT DETAILS FORM & PERFECT BUTTON ROW
   ========================================================================== */

/* Account Details Form Polish */
.woocommerce-MyAccount-content fieldset {
    border: 1px solid #eeeeee !important;
    border-radius: 20px !important;
    padding: 25px 30px !important;
    margin-top: 30px !important;
    background: #fdfdfd !important;
}
.woocommerce-MyAccount-content fieldset legend {
    font-weight: 800 !important;
    font-size: 16px !important;
    padding: 0 15px !important;
    color: #333 !important;
}

/* Perfect Button Row (Save & Delete) */
.woocommerce-EditAccountForm .button,
.khs-delete-btn {
    border-radius: 50px !important;
    height: 48px !important;
    min-width: 180px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    transition: 0.3s ease !important;
    margin: 0 !important;
    cursor: pointer;
}

/* Save Button Branding */
.woocommerce-EditAccountForm button[name="save_account_details"] {
    background: #8db73b !important;
    color: #ffffff !important;
}
.woocommerce-EditAccountForm button[name="save_account_details"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(141, 183, 59, 0.3);
}

/* Delete Button Branding (Red Outline Style) */
.khs-delete-btn {
    background: transparent !important;
    color: #e74c3c !important;
    border: 2px solid #e74c3c !important;
}
.khs-delete-btn:hover {
    background: #e74c3c !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}


/* ==========================================================================
   MODULE 12: DASHBOARD MOBILE, TABLET & ARABIC (RTL) OPTIMIZATION
   ========================================================================== */

/* Mobile & Tablet Responsiveness */
@media (max-width: 992px) {
    /* Stack the Sidebar and Content */
    .woocommerce-account .woocommerce {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    /* Expand Sidebar to full width */
    .woocommerce-MyAccount-navigation {
        width: 100% !important;
        padding: 20px !important;
    }
    
    /* Expand Content to full width and reduce padding */
    .woocommerce-MyAccount-content {
        width: 100% !important;
        padding: 25px 20px !important;
    }

    /* Stack the Save and Delete Buttons on small screens */
    .woocommerce-EditAccountForm p:has(.khs-delete-btn) {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .woocommerce-EditAccountForm .button,
    .khs-delete-btn {
        width: 100% !important; /* Full width buttons for easy tapping */
        margin-top: 10px !important;
    }
}

/* Arabic (RTL) Alignments & Animations */

/* Fix Address alignments for Arabic */
html[dir="rtl"] .woocommerce-MyAccount-content .woocommerce-Address,
body.rtl .woocommerce-MyAccount-content .woocommerce-Address,
html[dir="rtl"] .woocommerce-MyAccount-content .woocommerce-Address-title h3,
body.rtl .woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    text-align: right !important; /* Flips the forced left-alignment */
}

/* Flip the Sidebar Menu hover animations */
html[dir="rtl"] .woocommerce-MyAccount-navigation ul li:hover a,
body.rtl .woocommerce-MyAccount-navigation ul li:hover a {
    transform: translateX(-5px) !important; /* Slide left instead of right */
}

html[dir="rtl"] .woocommerce-MyAccount-navigation ul li.is-active a,
body.rtl .woocommerce-MyAccount-navigation ul li.is-active a {
    transform: translateX(-5px) !important;
}

/* Ensure proper font rendering for Arabic */
html[dir="rtl"] .woocommerce-MyAccount-navigation ul li a,
html[dir="rtl"] .woocommerce-MyAccount-content,
body.rtl .woocommerce-MyAccount-navigation ul li a,
body.rtl .woocommerce-MyAccount-content {
    direction: rtl !important;
    font-family: inherit; /* Matches your Arabic site font */
}


/* ==========================================================================
   MODULE 13: EDIT ADDRESS FORM POLISH & SELECT2 DROPDOWNS
   ========================================================================== */

/* The Main Form Container */
.woocommerce-address-fields {
    border: 1px solid #eeeeee !important;
    border-radius: 20px !important;
    padding: 30px !important;
    margin-top: 20px !important;
    background: #fdfdfd !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02) !important;
}

/* Form Heading */
.woocommerce-MyAccount-content > h3 {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #333 !important;
    margin-bottom: 20px !important;
    margin-top: 0 !important;
}

/* Modern Form Labels */
.woocommerce-address-fields label {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #555 !important;
    margin-bottom: 8px !important;
    display: inline-block !important;
    text-transform: capitalize !important;
}

/* Textareas (Order Notes / Street Address 2) */
.woocommerce-address-fields textarea.input-text {
    border-radius: 12px !important;
    border: 1px solid #ddd !important;
    padding: 15px !important;
    background: #fcfcfc !important;
    min-height: 100px !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
}

.woocommerce-address-fields textarea.input-text:focus {
    border-color: #8db73b !important;
    background: #fff !important;
    outline: none !important;
}

/* Select2 Dropdowns (Country & State Selectors) */
.select2-container--default .select2-selection--single {
    height: 48px !important;
    border-radius: 12px !important;
    border: 1px solid #ddd !important;
    background: #fcfcfc !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
}

/* Fix dropdown text alignment */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px !important;
    padding-left: 15px !important;
    color: #555 !important;
    font-size: 14px !important;
}

/* Fix dropdown arrow height */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    right: 10px !important;
}

/* Dropdown Focus State */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #8db73b !important;
    background: #fff !important;
}

/* The "Save Address" Button */
.woocommerce-address-fields .button {
    border-radius: 50px !important;
    height: 48px !important;
    min-width: 180px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    background: #8db73b !important;
    color: #ffffff !important;
    border: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    margin-top: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

.woocommerce-address-fields .button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(141, 183, 59, 0.3) !important;
}

/* Arabic (RTL) Dropdown Fixes */
html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered,
body.rtl .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 15px !important;
    padding-left: 30px !important;
}

html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow,
body.rtl .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 10px !important;
    right: auto !important;
}


/* ==========================================================================
   MODULE 14: PREMIUM ORDERS TABLE & MOBILE STACKING
   ========================================================================== */

/* The Table Container Card */
.woocommerce-MyAccount-content table.shop_table {
    border-collapse: separate !important; 
    border-spacing: 0 !important;
    width: 100% !important;
    border-radius: 20px !important; 
    overflow: hidden !important;
    border: 1px solid #eeeeee !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02) !important;
    background: #ffffff !important;
    margin-top: 10px !important;
}

/* Table Headers */
.woocommerce-MyAccount-content table.shop_table thead th {
    background: #fdfdfd !important;
    color: #333 !important;
    padding: 20px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
    border-bottom: 2px solid #eeeeee !important;
    border-top: none !important;
    text-align: left !important;
}

/* Table Rows & Cells */
.woocommerce-MyAccount-content table.shop_table tbody td {
    padding: 20px !important;
    border-bottom: 1px solid #f5f5f5 !important;
    vertical-align: middle !important;
    color: #555 !important;
    font-size: 14px !important;
    background: #ffffff !important;
    transition: background 0.3s ease !important;
}

/* Remove bottom border from the very last row */
.woocommerce-MyAccount-content table.shop_table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Smooth Row Hover Effect */
.woocommerce-MyAccount-content table.shop_table tbody tr:hover td {
    background: #fafafa !important; 
}

/* Order Number Links */
.woocommerce-MyAccount-content table.shop_table td.woocommerce-orders-table__cell-order-number a {
    color: #8db73b !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    font-size: 15px !important;
}
.woocommerce-MyAccount-content table.shop_table td.woocommerce-orders-table__cell-order-number a:hover {
    text-decoration: underline !important;
}

/* The "VIEW" Button Badge */
.woocommerce-MyAccount-content table.shop_table .button.view {
    border-radius: 50px !important;
    background: #8db73b !important;
    color: #fff !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    padding: 8px 18px !important; 
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    display: inline-block !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.woocommerce-MyAccount-content table.shop_table .button.view:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(141, 183, 59, 0.2) !important;
}

/* Mobile & Arabic (RTL) Table Optimization */
@media (max-width: 768px) {
    /* Hide the top header row on mobile */
    .woocommerce-MyAccount-content table.shop_table_responsive thead {
        display: none !important; 
    }
    
    /* Turn each row into its own standalone block */
    .woocommerce-MyAccount-content table.shop_table_responsive tr {
        display: block !important;
        border-bottom: 4px solid #f5f5f5 !important;
        padding: 10px 0 !important;
    }
    
    /* Make cells sit side-by-side with their data labels */
    .woocommerce-MyAccount-content table.shop_table_responsive td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important; 
        border-bottom: 1px solid #f9f9f9 !important;
        padding: 12px 20px !important;
    }
    
    /* Use WooCommerce's data-title attribute to create mobile labels */
    .woocommerce-MyAccount-content table.shop_table_responsive td::before {
        content: attr(data-title) !important;
        font-weight: 800 !important;
        color: #333 !important;
        text-transform: uppercase !important;
        font-size: 11px !important;
        text-align: left !important; 
    }
    
    /* ARABIC FLIP: Swap text alignment on mobile for RTL */
    html[dir="rtl"] .woocommerce-MyAccount-content table.shop_table_responsive td,
    body.rtl .woocommerce-MyAccount-content table.shop_table_responsive td {
        text-align: left !important;
    }
    html[dir="rtl"] .woocommerce-MyAccount-content table.shop_table_responsive td::before,
    body.rtl .woocommerce-MyAccount-content table.shop_table_responsive td::before {
        text-align: right !important;
    }
}

/* ARABIC FLIP: Header alignment on Desktop */
html[dir="rtl"] .woocommerce-MyAccount-content table.shop_table thead th,
body.rtl .woocommerce-MyAccount-content table.shop_table thead th {
    text-align: right !important;
}


/* ==========================================================================
   MODULE 15: ORDERS TABLE GREY COLUMN FIX
   ========================================================================== */

/* Force the first column (Order Number) to be pure white */
.woocommerce-MyAccount-content table.shop_table tbody td:first-child,
.woocommerce-MyAccount-content table.shop_table tbody th {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Ensure the smooth hover effect still applies to the first column */
.woocommerce-MyAccount-content table.shop_table tbody tr:hover td:first-child,
.woocommerce-MyAccount-content table.shop_table tbody tr:hover th {
    background: #fafafa !important;
    background-color: #fafafa !important;
}


/* ==========================================================================
   MODULE 16: ORDERS TABLE BORDERS & DASHBOARD ANIMATIONS
   ========================================================================== */

/* Seamless Row Borders (Kills the hidden vertical gaps) */
.woocommerce-MyAccount-content table.shop_table tbody th,
.woocommerce-MyAccount-content table.shop_table tbody td {
    border-bottom: 1px solid #eeeeee !important; 
    border-left: none !important; 
    border-right: none !important; 
}

/* Ensure the very last row stays clean with no bottom border */
.woocommerce-MyAccount-content table.shop_table tbody tr:last-child th,
.woocommerce-MyAccount-content table.shop_table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Premium "App" Load Animation Keyframes */
@keyframes khsVaultFade {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply the animation to the main content area whenever a tab loads */
.woocommerce-MyAccount-content {
    animation: khsVaultFade 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

/* Add a slight stagger to the sidebar so it feels dynamic */
.woocommerce-MyAccount-navigation {
    animation: khsVaultFade 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}


/* ==========================================================================
   MODULE 17: THE ULTIMATE TABLE BORDER FIX (BOX-SHADOW TRICK)
   ========================================================================== */

/* The Table Container (Collapse & Shadow Trick) */
.woocommerce-MyAccount-content table.shop_table {
    border-collapse: collapse !important; 
    border-spacing: 0 !important;
    width: 100% !important;
    border-radius: 20px !important; 
    overflow: hidden !important;
    border: none !important; 
    box-shadow: 0 0 0 1px #eeeeee, 0 5px 20px rgba(0,0,0,0.02) !important; 
    background: #ffffff !important;
    margin-top: 10px !important;
}

/* Force the internal rows to merge seamlessly */
.woocommerce-MyAccount-content table.shop_table tbody th,
.woocommerce-MyAccount-content table.shop_table tbody td,
.woocommerce-MyAccount-content table.shop_table thead th {
    border-bottom: 1px solid #eeeeee !important; 
    border-left: none !important; 
    border-right: none !important; 
    border-top: none !important;
}

/* Keep the bottom clean for the last row */
.woocommerce-MyAccount-content table.shop_table tbody tr:last-child th,
.woocommerce-MyAccount-content table.shop_table tbody tr:last-child td {
    border-bottom: none !important;
}


/* ==========================================================================
   MODULE 18: "VIEW ORDER" DIGITAL RECEIPT & APP LAYOUT
   ========================================================================== */

/* The Order Status Banner (Replaces the plain text) */
.woocommerce-order > p.woocommerce-notice {
    background: #fdfdfd !important;
    padding: 20px 25px !important;
    border-radius: 15px !important;
    border: 1px solid #eeeeee !important;
    font-size: 15px !important;
    color: #555 !important;
    line-height: 1.6 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02) !important;
    margin-bottom: 30px !important;
}

.woocommerce-order > p.woocommerce-notice mark {
    background: transparent !important;
    color: #8db73b !important; 
    font-weight: 800 !important;
}

/* Order Details Heading */
.woocommerce-order-details__title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #333 !important;
    margin-bottom: 20px !important;
}

/* The Itemized Receipt Table */
.woocommerce-table--order-details {
    border-collapse: collapse !important;
    width: 100% !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: 0 0 0 1px #eeeeee, 0 5px 20px rgba(0,0,0,0.02) !important;
    background: #ffffff !important;
    margin-bottom: 40px !important;
}

/* Receipt Table Headers */
.woocommerce-table--order-details th {
    background: #fdfdfd !important;
    color: #333 !important;
    padding: 20px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    border-bottom: 1px solid #eeeeee !important;
    text-align: left !important;
}

/* Receipt Table Rows */
.woocommerce-table--order-details td {
    padding: 20px !important;
    border-bottom: 1px solid #eeeeee !important;
    color: #555 !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}

/* Remove bottom border from the final total row */
.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td {
    border-bottom: none !important;
}

/* Bold the totals for emphasis */
.woocommerce-table--order-details tfoot th {
    text-align: right !important;
    background: #ffffff !important;
}

.woocommerce-table--order-details tfoot td {
    font-weight: 800 !important;
    color: #333 !important;
}

/* Customer Details Cards (Grid Layout for Billing/Shipping) */
.woocommerce-customer-details {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    margin-top: 10px !important;
}

.woocommerce-customer-details h2 {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #333 !important;
    margin-bottom: 15px !important;
    margin-top: 0 !important;
}

.woocommerce-customer-details address {
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    padding: 30px !important;
    border-radius: 20px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02) !important;
    font-style: normal !important;
    line-height: 1.8 !important;
    color: #555 !important;
    font-size: 14px !important;
}

/* ARABIC (RTL) & MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    /* Stack totals on mobile */
    .woocommerce-table--order-details tfoot th {
        text-align: left !important;
        display: block !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    .woocommerce-table--order-details tfoot td {
        display: block !important;
        padding-top: 5px !important;
    }
}

html[dir="rtl"] .woocommerce-table--order-details th,
body.rtl .woocommerce-table--order-details th,
html[dir="rtl"] .woocommerce-table--order-details tfoot th,
body.rtl .woocommerce-table--order-details tfoot th {
    text-align: right !important;
}

div.nsl-container[data-align="left"] {
    text-align: center !important;
}