
/* ===== Global Font Override ===== */
:root {
    --e-global-typography-primary-font-family: "Jost", sans-serif !important;
    --e-global-typography-secondary-font-family: "Jost", sans-serif !important;
    --e-global-typography-text-font-family: "Jost", sans-serif !important;
    --e-global-typography-accent-font-family: "Jost", sans-serif !important;
}
body {
    font-family: "Jost", sans-serif;
}
/* ===== Mobile Layout Fixes ===== */
@media (max-width: 767px) {
    body .elementor-section.elementor-section-boxed > .elementor-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Product Description Narrow Text Fix */
    body.single-product .elementor-column,
    body.single-product .elementor-widget-wrap,
    body.single-product .elementor-widget-woocommerce-product-data-tabs,
    body .woocommerce-tabs,
    body .woocommerce-tabs .panel,
    body .woocommerce-tabs .elementor-widget-container,
    body .woocommerce-tabs .elementor-text-editor,
    body .woocommerce-tabs p,
    body #reviews,
    body #comments,
    body #review_form_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body .woocommerce-tabs h2 {
        text-align: left !important;
        margin-bottom: 15px !important;
        font-size: 22px !important;
        width: 100% !important;
    }
    body .woocommerce-tabs p {
        text-align: left !important;
    }
    
    /* Fix huge gap before product photo */
    body.single-product .site-main,
    body.single-product .elementor-location-single,
    body.single-product .elementor-section:first-of-type,
    body.single-product .elementor-widget-wrap:first-of-type,
    body.single-product .woocommerce-product-gallery {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    body.single-product #thaimart-mobile-top-header {
        margin-bottom: 12px !important;
    }
    .tm-top-why-block {
        margin-bottom: 8px !important;
    }
}
h1, h2, h3, h4, h5, h6, p, a, button, input, 
.woocommerce-loop-product__title, 
.price, .amount, .button, 
.elementor-heading-title, 
.elementor-widget-text-editor,
.thaimart-nav-title,
.thaimart-filter-title,
.tm-tab-btn,
.tm-block-title,
.tm-block-desc,
.tm-review-text {
    font-family: "Jost", sans-serif !important;
}

/* ===== WooCommerce My Account Page Fixes ===== */
.woocommerce-account .elementor-widget-shortcode,
.woocommerce-account .woocommerce {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}
.woocommerce-account #customer_login {
    display: flex !important;
    flex-direction: column !important;
    gap: 30px !important;
    width: 100% !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    align-items: stretch !important;
}
.woocommerce-account #customer_login .u-column1,
.woocommerce-account #customer_login .u-column2 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    padding: 30px 20px !important;
    border: 1px solid var(--tm-border, #E2E8F0) !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
}
.woocommerce-account #customer_login h2 {
    font-size: 24px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
}
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register {
    width: 100% !important;
    display: block !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.woocommerce-account .woocommerce-form-login p.form-row,
.woocommerce-account .woocommerce-form-register p.form-row {
    width: 100% !important;
    display: block !important;
    margin-bottom: 15px !important;
}
.woocommerce-account form .form-row input.input-text {
    width: 100% !important;
    min-width: 100% !important;
    padding: 14px 16px !important;
    border-radius: 12px !important;
    border: 1px solid var(--tm-border, #E2E8F0) !important;
    box-sizing: border-box !important;
    height: auto !important;
    font-size: 16px !important;
}
.woocommerce-account form .woocommerce-button {
    width: 100% !important;
    padding: 16px !important;
    border-radius: 12px !important;
    background: var(--tm-green, #0b8f64) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    text-align: center !important;
    border: none !important;
    margin-top: 15px !important;
}
@media (min-width: 768px) {
    .woocommerce-account #customer_login {
        flex-direction: row !important;
        gap: 40px !important;
    }
    .woocommerce-account #customer_login .u-column1,
    .woocommerce-account #customer_login .u-column2 {
        width: 50% !important;
        max-width: 50% !important;
        padding: 40px !important;
    }
}
/* ===== WooCommerce My Account Redesign ===== */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 30px 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 10px !important;
    border: none !important;
    padding-bottom: 5px !important;
    scrollbar-width: none;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
    display: none;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block !important;
    padding: 10px 20px !important;
    background: #f8fafc !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 99px !important;
    color: #1D2633 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    background: var(--tm-green, #0b8f64) !important;
    color: #fff !important;
    border-color: var(--tm-green, #0b8f64) !important;
}

.woocommerce-account .woocommerce-MyAccount-content {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #4A5568 !important;
}
.woocommerce-account .woocommerce-MyAccount-content p {
    margin-bottom: 20px !important;
}
.woocommerce-account .woocommerce-MyAccount-content a {
    color: var(--tm-green, #0b8f64) !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}
.woocommerce-account .woocommerce-MyAccount-content a:hover {
    text-decoration: none !important;
}

/* ===== WooCommerce Notices (Global) ===== */
.woocommerce-message,
.woocommerce-info:not(.cart-empty),
.woocommerce-error {
    background: #fff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    margin-bottom: 30px !important;
    color: #1D2633 !important;
    font-weight: 500 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px !important;
}
@media (max-width: 767px) {
    .woocommerce-message,
    .woocommerce-info:not(.cart-empty),
    .woocommerce-error {
        position: fixed !important;
        bottom: 95px !important; /* Menu ~75px + 20px gap */
        left: 15px !important;
        right: 15px !important;
        z-index: 99999 !important;
        margin-bottom: 0 !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
        animation: tm-slide-up 0.3s ease-out forwards;
        transition: transform 0.3s ease, opacity 0.3s ease !important;
    }
}
@keyframes tm-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.woocommerce-message::before,
.woocommerce-info:not(.cart-empty)::before,
.woocommerce-error::before {
    display: none !important;
}
.woocommerce-message .button,
.woocommerce-info:not(.cart-empty) .button,
.woocommerce-error .button {
    background: #f1f5f9 !important;
    color: #1D2633 !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: none !important;
    align-self: flex-start !important;
}
.woocommerce-message .button:hover,
.woocommerce-info:not(.cart-empty) .button:hover,
.woocommerce-error .button:hover {
    background: #e2e8f0 !important;
}

.woocommerce-account table.shop_table.my_account_orders {
    border: none !important;
    display: block !important;
}
.woocommerce-account table.shop_table.my_account_orders thead {
    display: none !important;
}
.woocommerce-account table.shop_table.my_account_orders tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
}
.woocommerce-account table.shop_table.my_account_orders tr.order {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}
body.woocommerce-account .woocommerce-MyAccount-content table.shop_table.my_account_orders th,
body.woocommerce-account .woocommerce-MyAccount-content table.shop_table.my_account_orders td {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    border: 0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 8px 0 !important;
    text-align: right !important;
    font-size: 15px !important;
    background: transparent !important;
}
body.woocommerce-account .woocommerce-MyAccount-content table.shop_table.my_account_orders td::before {
    font-weight: 600 !important;
    color: #718096 !important;
    margin-bottom: 0 !important;
    content: attr(data-title) !important;
    text-align: left !important;
}
body.woocommerce-account .woocommerce-MyAccount-content table.shop_table.my_account_orders td.woocommerce-orders-table__cell-order-number {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #E2E8F0 !important;
    padding-bottom: 15px !important;
    margin-bottom: 10px !important;
    border-radius: 0 !important;
}
.woocommerce-account table.shop_table.my_account_orders td.woocommerce-orders-table__cell-order-number a {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1D2633 !important;
    text-decoration: none !important;
}
.woocommerce-account table.shop_table.my_account_orders td.woocommerce-orders-table__cell-order-actions::before {
    display: none !important;
}
.woocommerce-account table.shop_table.my_account_orders td.woocommerce-orders-table__cell-order-actions {
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px dashed #E2E8F0 !important;
}
.woocommerce-account table.shop_table.my_account_orders td.woocommerce-orders-table__cell-order-actions a.button {
    width: 100% !important;
    background: var(--tm-green, #0b8f64) !important;
    color: #fff !important;
    text-align: center !important;
    border-radius: 12px !important;
    padding: 14px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.woocommerce-account .u-columns.woocommerce-Addresses {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
}
.woocommerce-account .u-column.woocommerce-Address {
    width: 100% !important;
    float: none !important;
    background: #f8fafc !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}
.woocommerce-account .u-column.woocommerce-Address header.title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    border-bottom: 1px dashed #cbd5e1 !important;
    padding-bottom: 10px !important;
}
.woocommerce-account .u-column.woocommerce-Address header.title h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}
.woocommerce-account .u-column.woocommerce-Address header.title a.edit {
    font-size: 14px !important;
    background: #fff !important;
    border: 1px solid #E2E8F0 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    color: var(--tm-green, #0b8f64) !important;
}
.woocommerce-account .u-column.woocommerce-Address address {
    font-style: normal !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #4A5568 !important;
}

.woocommerce-account table.shop_table.order_details {
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    background: #fff !important;
    width: 100% !important;
    border-collapse: collapse !important;
    overflow: hidden !important;
}
.woocommerce-account table.shop_table.order_details th {
    background: #f8fafc !important;
    padding: 15px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #718096 !important;
    border-bottom: 1px solid #E2E8F0 !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
}
.woocommerce-account table.shop_table.order_details td {
    padding: 15px !important;
    border-bottom: 1px solid #E2E8F0 !important;
    border-right: none !important;
    border-left: none !important;
    border-top: none !important;
    font-size: 15px !important;
    color: #1D2633 !important;
}
.woocommerce-account table.shop_table.order_details tr:last-child td {
    border-bottom: none !important;
}
.woocommerce-account table.shop_table.order_details tfoot th {
    background: #fff !important;
    font-weight: 600 !important;
    color: #4A5568 !important;
}
.woocommerce-account h2 {
    font-size: 24px !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    margin-top: 30px !important;
}

/* ===== General Catalog Layout ===== */

.thaimart-filter-sidebar {
    background: #F4F6F8; /* Light gray background matching Figma */
    border-radius: 20px;
    padding: 24px;
    border: none;
    /* Removed max-height and overflow to remove internal scrollbar */
}

/* Internal scrollbar removed */

.thaimart-products-area {
    position: relative;
    width: 100%;
}

/* Loading state for grid */
.thaimart-products-area.loading::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 100;
    border-radius: 20px;
}

/* ===== Filter UI ===== */
.thaimart-filter-group {
    margin-bottom: 24px;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 24px;
}
.thaimart-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.thaimart-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.thaimart-filter-title {
    font-family: "Jost", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1D2633;
    margin: 0;
}

/* Chevron for titles */
.thaimart-group-toggle {
    transition: transform 0.3s;
}
.thaimart-group-toggle.collapsed {
    transform: rotate(180deg);
}

/* Checkboxes */
.thaimart-checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #1D2633;
    transition: color 0.2s;
}
.thaimart-checkbox-item:last-child {
    margin-bottom: 0;
}
.thaimart-checkbox-item:hover {
    color: #0b8f64;
}
.thaimart-checkbox-item input {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 1px solid #A0AEC0;
    border-radius: 6px;
    margin-right: 14px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: #fff;
    flex-shrink: 0;
}
.thaimart-checkbox-item input:checked {
    background: #0b8f64;
    border-color: #0b8f64;
}
.thaimart-checkbox-item input:checked::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.thaimart-count {
    margin-left: auto;
    font-size: 14px;
    color: #A0AEC0;
    font-weight: 400;
}

/* Subcategories Accordion */
.thaimart-cat-item {
    margin-bottom: 14px;
}
.thaimart-cat-item:last-child {
    margin-bottom: 0;
}
.thaimart-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.thaimart-cat-row .thaimart-checkbox-item {
    margin-bottom: 0;
    flex-grow: 1;
}
.thaimart-toggle-cat {
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1D2633;
    transition: transform 0.3s;
}
.thaimart-toggle-cat.open svg {
    transform: rotate(180deg);
}
.thaimart-subcat-wrap {
    padding-left: 36px; /* indent under the checkbox */
    margin-top: 10px;
    display: none;
}

/* Brands Search & Hide */
.thaimart-brand-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    font-size: 14px;
    color: #1D2633;
    outline: none;
    transition: border 0.3s;
    background: #fff;
    margin-bottom: 15px;
}
.thaimart-brand-search-input:focus {
    border-color: #0b8f64;
}
.tm-brand-hidden {
    display: none !important;
}

/* Price Inputs */
.thaimart-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.thaimart-price-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    font-size: 15px;
    color: #1D2633;
    outline: none;
    transition: border 0.3s;
    background: #fff;
}
.thaimart-price-input:focus {
    border-color: #0b8f64;
}
.thaimart-price-sep {
    color: #A0AEC0;
}

/* Mobile Filters Button */
#thaimart-mobile-filter-btn {
    display: none;
    background: #0b8f64;
    border: none;
    border-radius: 50px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(11, 143, 100, 0.4);
}
.thaimart-mobile-close {
    display: none;
}

@media (max-width: 1024px) {
    #thaimart-mobile-filter-btn {
        display: flex;
        position: fixed;
        top: 110px;
        right: 15px;
        bottom: auto;
        left: auto;
        transform: none;
        z-index: 99998;
        align-items: center;
        justify-content: center;
        width: auto;
        padding: 10px 16px;
        border-radius: 24px;
        font-size: 14px;
        gap: 8px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    #thaimart-mobile-filter-btn.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .thaimart-filter-sidebar {
        display: block;
        position: fixed;
        top: auto; 
        left: 0; 
        bottom: -100%;
        width: 100%;
        max-width: 100%;
        z-index: 99999;
        border-radius: 30px 30px 0 0;
        border: none;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
        height: 85vh;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        padding-bottom: 20px; /* Reduced from 80px since button is sticky */
    }
    .thaimart-filter-sidebar.open {
        bottom: 0;
    }
    .thaimart-mobile-close {
        display: flex;
        position: absolute;
        top: 20px; right: 20px;
        font-size: 30px;
        color: #1D2633;
        cursor: pointer;
        line-height: 1;
        font-weight: 300;
        z-index: 100000;
    }
    .thaimart-filter-sidebar.open {
        padding-top: 60px; /* Space for close btn */
    }
    
    #thaimart-mobile-apply-btn {
        display: block;
        width: 100%;
        position: sticky;
        bottom: 0px;
        background: #0b8f64;
        color: #fff;
        border: none;
        border-radius: 16px;
        padding: 14px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
        z-index: 100000;
        margin-top: 30px;
    }
    
    #thaimart-mobile-overlay {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 99998; /* Below sidebar, above filter btn */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    #thaimart-mobile-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* New Mobile Top Header */
    #thaimart-mobile-top-header {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: #fff;
        padding-top: 100px; /* Space for the sticky area */
    }
    .tm-top-sticky-area {
        position: fixed;
        top: 0; left: 0; width: 100%;
        background: #fff;
        z-index: 99996;
        padding: 10px 15px 0 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        box-sizing: border-box;
    }
    .tm-top-search-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 10px;
    }
    .tm-top-logo img {
        height: 32px;
        width: auto;
    }
    .tm-top-search-box {
        flex: 1;
        border: 2px solid #000;
        border-radius: 50px;
        height: 40px;
        display: flex;
        overflow: hidden;
    }
    .tm-top-search-box form {
        display: flex;
        width: 100%;
        margin: 0;
    }
    .tm-top-search-box input {
        flex: 1;
        border: none;
        outline: none;
        padding: 0 15px;
        font-size: 14px;
        background: transparent;
    }
    .tm-top-search-box button {
        background: #000;
        color: #fff;
        border: none;
        width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .tm-top-cats-row {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    .tm-top-cats-row::-webkit-scrollbar {
        display: none;
    }
    .tm-top-cat-item {
        font-size: 14px;
        color: #4A5568;
        text-decoration: none !important;
        padding: 10px 12px;
        font-weight: 500;
        position: relative;
    }
    .tm-top-cat-item.active {
        color: #000;
        font-weight: 700;
    }
    .tm-top-cat-item.active::after {
        content: "";
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        background: #000;
        border-radius: 2px;
    }
    .tm-top-usp-block {
        background: #fff5ed;
        border-radius: 8px;
        margin: 10px 15px;
        display: flex;
        padding: 12px;
        align-items: center;
    }
    .tm-usp-item {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    .tm-usp-divider {
        width: 1px;
        height: 30px;
        background: #e2d4c7;
        margin: 0 15px;
    }
    .tm-usp-title {
        color: #0b8f64;
        font-weight: 700;
        font-size: 13px;
        display: flex;
        align-items: center;
        gap: 5px;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    .tm-usp-desc {
        color: #6a5e55;
        font-size: 11px;
        line-height: 1.2;
    }
    .tm-top-why-block, .tm-top-b2b-block {
        color: #fff;
        margin: 0 15px 8px 15px;
        border-radius: 8px;
        padding: 10px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none !important;
        font-weight: 700;
        font-size: 13px;
    }
    .tm-top-why-block {
        background: #0b8f64;
    }
    .tm-top-b2b-block {
        background: #f59e0b;
        margin-bottom: 15px !important;
    }
    .tm-why-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .tm-why-right {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 500;
    }
    
    /* Hide standard header on mobile */
    .elementor-13667, /* Top banner */
    .elementor-location-header,
    [data-elementor-type="header"],
    header,
    .site-header {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important; /* Removed to avoid white gap */
    }
    
    /* Footer padding for mobile menu space */
    body .site-footer,
    body .elementor-location-footer,
    body footer {
        padding-bottom: 100px !important; /* Space for the bottom nav */
    }
    
    /* Mobile Bottom Nav */
    .thaimart-mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 15px; /* Floating */
        left: 15px;
        width: calc(100% - 30px);
        background: #489b78; /* Green */
        border-radius: 16px;
        box-shadow: 0 4px 15px rgba(72,155,120,0.3);
        z-index: 99997; 
        justify-content: space-between;
        align-items: center;
        height: 76px;
        padding: 6px; /* Inner padding for active block */
        box-sizing: border-box;
    }
    .tm-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 12px;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
        color: #ffffff; /* White text */
        font-size: 11px;
        font-weight: 600;
        transition: all 0.3s;
        height: 100%;
        flex: 1; /* Evenly spaced */
        border-radius: 16px;
    }
    .tm-nav-item:active, .tm-nav-item:active span,
    .tm-nav-item:focus, .tm-nav-item:focus span {
        color: #ffffff !important;
    }
    .tm-nav-item:active {
        opacity: 0.6;
        transform: scale(0.92);
    }
    .tm-nav-item .tm-nav-icon svg {
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
        stroke: #ffffff; /* White icon */
    }
    .tm-nav-item.active {
        background: #f0f6f4; /* Light bg */
        color: #489b78; /* Green text */
    }
    .tm-nav-item.active:active, .tm-nav-item.active:active span,
    .tm-nav-item.active:focus, .tm-nav-item.active:focus span {
        color: #489b78 !important;
    }
    .tm-nav-item.active .tm-nav-icon svg {
        stroke: #489b78; /* Green icon */
    }
    
    .tm-nav-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .tm-cart-badge {
        position: absolute;
        top: -6px;
        right: -10px;
        background: #e63946; /* Red badge */
        color: #fff;
        font-size: 9px;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        box-sizing: border-box;
    }
}

@media (min-width: 1025px) {
    #thaimart-mobile-top-header,
    .tm-top-usp-block,
    .tm-top-why-block,
    .tm-top-b2b-block {
        display: none !important;
    }
    .thaimart-mobile-bottom-nav {
        display: none !important;
    }
}

/* ===== Product Card Base ===== */
.woocommerce ul.products li.product, 
.elementor-widget-wc-archive-products ul.products li.product {
    background: #fff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 0 !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.woocommerce ul.products li.product:hover {
    background: #ffffff !important;
    border: 1px solid #cbd5e0 !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12) !important;
    z-index: 10 !important;
}

/* ===== Image ===== */
.woocommerce ul.products li.product img {
    border-radius: 16px 16px 0 0 !important;
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1) !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    margin: 0 auto !important;
    padding: 6px 6px 0 6px !important;
    box-sizing: border-box !important;
}
.woocommerce ul.products li.product:hover img {
    transform: scale(1.02) !important;
}
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    overflow: hidden !important;
    border-radius: 20px 20px 0 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-grow: 1;
    margin: 3px 3px 0 3px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

/* ===== Title - 12px horizontal padding ===== */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #4A5568 !important;
    padding: 12px 12px 6px 12px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    max-height: 73px !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ===== Rating ===== */
.woocommerce ul.products li.product .star-rating {
    margin: 0 12px 6px 12px !important;
    font-size: 11px !important;
}

/* ===== Price - 12px padding ===== */
.woocommerce ul.products li.product .price {
    padding: 0 12px 12px 12px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #1a202c !important;
    margin-bottom: 0 !important;
}

/* ===== Add to Cart Button ===== */
@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button {
    background: transparent !important;
    color: #1a202c !important;
    border-radius: 50px !important;
    padding: 10px 15px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin: auto 12px 0 12px !important;
    border: 1px solid #1a202c !important;
    box-shadow: none !important;
    transition: all 0.4s ease !important;
    display: block !important;
    width: calc(100% - 24px) !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover {
    background: linear-gradient(270deg, #0b8f64, #14c98e, #0b8f64) !important;
    background-size: 200% 200% !important;
    animation: gradient-flow 3s ease infinite !important;
    color: #fff !important;
    border: 1px solid transparent !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(11, 143, 100, 0.45) !important;
}

/* ===== Badges ===== */
.thaimart-badges-wrapper {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    z-index: 10 !important;
    pointer-events: none !important;
    align-items: flex-start !important;
}
.thaimart-hit-badge {
    background: linear-gradient(135deg, #ff8a00 0%, #e52e71 100%) !important;
    color: #fff !important;
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 3px 10px rgba(229, 46, 113, 0.4) !important;
    line-height: 1.2 !important;
}
.thaimart-set-badge {
    background: linear-gradient(135deg, #5f2c82 0%, #49a09d 100%) !important; /* Elegant purple-teal gradient */
    color: #fff !important;
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 3px 10px rgba(95, 44, 130, 0.4) !important;
    line-height: 1.2 !important;
}
.thaimart-generic-badge {
    background: #1D2633 !important; /* Dark generic badge */
    color: #fff !important;
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    line-height: 1.2 !important;
}

/* ===== Health Products Disclaimer Notice / Tooltip ===== */
.tm-health-warning-wrap {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 30 !important;
}
.tm-health-warning-trigger {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: rgba(245, 158, 11, 0.45) !important;
    color: #92400e !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    outline: none !important;
    padding: 0 !important;
    line-height: 1 !important;
    user-select: none !important;
    opacity: 0.7 !important;
    transition: all 0.25s ease !important;
}
.tm-health-warning-trigger:hover,
.tm-health-warning-wrap.is-active .tm-health-warning-trigger {
    background: #f59e0b !important;
    color: #ffffff !important;
    opacity: 1 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.4) !important;
    border-color: #ffffff !important;
}
.tm-health-disclaimer-popup {
    position: absolute !important;
    top: calc(100% + 7px) !important;
    right: -4px !important;
    width: 175px !important;
    max-width: calc(100vw - 32px) !important;
    background: #fffbeb !important;
    color: #92400e !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    text-align: left !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    border: 1px solid #fde68a !important;
    box-shadow: 0 10px 25px -5px rgba(180, 83, 9, 0.25), 0 8px 10px -6px rgba(180, 83, 9, 0.2) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-6px) scale(0.96) !important;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease !important;
    pointer-events: none !important;
    z-index: 50 !important;
}
/* Arrow pointer */
.tm-health-disclaimer-popup::before {
    content: "" !important;
    position: absolute !important;
    top: -5px !important;
    right: 8px !important;
    width: 8px !important;
    height: 8px !important;
    background: #fffbeb !important;
    border-top: 1px solid #fde68a !important;
    border-left: 1px solid #fde68a !important;
    transform: rotate(45deg) !important;
}
/* Show on hover on desktop */
.tm-health-warning-wrap:hover .tm-health-disclaimer-popup,
.tm-health-warning-wrap.is-active .tm-health-disclaimer-popup {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}
@media (max-width: 767px) {
    .tm-health-warning-wrap {
        top: 8px !important;
        right: 8px !important;
    }
    .tm-health-warning-trigger {
        width: 19px !important;
        height: 19px !important;
        font-size: 10.5px !important;
    }
    .tm-health-disclaimer-popup {
        width: 155px !important;
        font-size: 9px !important;
        padding: 7px 9px !important;
        line-height: 1.3 !important;
        border-radius: 8px !important;
    }
    .tm-health-disclaimer-popup::before {
        right: 8px !important;
    }
}

/* Single Product Page Styling for Health Warning Icon & Popup */
.single-product .wpr-product-media-wrap .tm-health-warning-wrap,
.single-product .woocommerce-product-gallery .tm-health-warning-wrap {
    top: 14px !important;
    right: 14px !important;
    z-index: 99 !important;
}
.single-product .wpr-product-media-wrap .tm-health-warning-trigger,
.single-product .woocommerce-product-gallery .tm-health-warning-trigger {
    width: 26px !important;
    height: 26px !important;
    font-size: 13.5px !important;
    border-width: 2px !important;
    opacity: 0.75 !important;
}
.single-product .wpr-product-media-wrap .tm-health-warning-trigger:hover,
.single-product .wpr-product-media-wrap .tm-health-warning-wrap.is-active .tm-health-warning-trigger,
.single-product .woocommerce-product-gallery .tm-health-warning-trigger:hover,
.single-product .woocommerce-product-gallery .tm-health-warning-wrap.is-active .tm-health-warning-trigger {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}
.single-product .wpr-product-media-wrap .tm-health-disclaimer-popup,
.single-product .woocommerce-product-gallery .tm-health-disclaimer-popup {
    width: 215px !important;
    font-size: 11px !important;
    padding: 10px 13px !important;
    line-height: 1.4 !important;
    border-radius: 12px !important;
    right: -2px !important;
    top: calc(100% + 8px) !important;
}
.single-product .wpr-product-media-wrap .tm-health-disclaimer-popup::before,
.single-product .woocommerce-product-gallery .tm-health-disclaimer-popup::before {
    right: 11px !important;
}
@media (max-width: 767px) {
    .single-product .wpr-product-media-wrap .tm-health-warning-wrap,
    .single-product .woocommerce-product-gallery .tm-health-warning-wrap {
        top: 10px !important;
        right: 10px !important;
    }
    .single-product .wpr-product-media-wrap .tm-health-warning-trigger,
    .single-product .woocommerce-product-gallery .tm-health-warning-trigger {
        width: 22px !important;
        height: 22px !important;
        font-size: 11.5px !important;
    }
    .single-product .wpr-product-media-wrap .tm-health-disclaimer-popup,
    .single-product .woocommerce-product-gallery .tm-health-disclaimer-popup {
        width: 170px !important;
        font-size: 9.5px !important;
        padding: 8px 10px !important;
    }
}

/* ===== Hide Default WooCommerce Pagination ===== */
.woocommerce nav.woocommerce-pagination {
    display: none !important;
}

/* ===== Load More Button ===== */
#thaimart-load-more-wrap {
    text-align: center;
    margin: 30px 0 20px;
}

#thaimart-load-more-btn {
    background: #0b8f64;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(11, 143, 100, 0.35);
    transition: all 0.3s ease;
    outline: none;
    letter-spacing: 0.3px;
}

#thaimart-load-more-btn:hover {
    background: #097a55;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(11, 143, 100, 0.5);
}

#thaimart-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#thaimart-load-more-btn.loading::after {
    content: "...";
    animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80%, 100% { content: "..."; }
}

#thaimart-products-end {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin: 20px 0;
    display: none;
}
/* ===== Quick Nav Block ===== */
.thaimart-quick-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 1fr;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 15px;
}
.thaimart-nav-item {
    background: #f8fafc;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    aspect-ratio: 1 / 1;
    text-decoration: none !important;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    height: 100%;
    box-sizing: border-box;
    font-family: "Jost", sans-serif;
}
.thaimart-nav-item:hover {
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: #0b8f64;
}
.thaimart-nav-item.active {
    background: #0b8f64 !important;
    border-color: #0b8f64 !important;
}
.thaimart-nav-item.active .thaimart-nav-icon,
.thaimart-nav-item.active .thaimart-nav-title {
    color: #fff !important;
}
.thaimart-nav-item.active .thaimart-nav-count {
    color: rgba(255, 255, 255, 0.8) !important;
}

.thaimart-nav-icon {
    width: 36px;
    height: 36px;
    color: #0b8f64;
    flex-shrink: 0;
}
.thaimart-nav-icon svg, .thaimart-nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.thaimart-nav-item.active .thaimart-nav-icon img {
    filter: brightness(0) invert(1);
}
.thaimart-nav-text {
    display: flex;
    flex-direction: column;
}
.thaimart-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: #1D2633;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 4px;
}
.thaimart-nav-count {
    font-size: 13px;
    color: #A0AEC0;
}
@media (max-width: 1024px) {
    .thaimart-quick-nav { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .thaimart-quick-nav { 
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        align-items: stretch;
    }
    .thaimart-quick-nav::-webkit-scrollbar {
        display: none;
    }
    .thaimart-nav-item {
        flex: 0 0 calc(42% - 10px); /* Show 2 cards and peek the 3rd */
        scroll-snap-align: start;
        padding: 12px 8px;
    }
    .thaimart-nav-icon {
        width: 36px;
        height: 36px;
        margin: 0 auto;
    }
    .thaimart-nav-title {
        font-size: 14px;
    }
    .thaimart-nav-count {
        font-size: 12px;
    }
    .thaimart-nav-text {
        align-items: center;
    }
}
/* ===== Cart Page Fixes ===== */
@media(max-width:767px) {
    body.woocommerce-cart .elementor-section:first-of-type,
    body.woocommerce-cart .elementor-widget-wrap,
    body.woocommerce-cart .page-content {
        padding-top: 20px !important;
        margin-top: 0 !important;
    }
}

    .tm-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; scrollbar-width: none; border-radius: 16px; margin-bottom: 16px; }
    .tm-carousel::-webkit-scrollbar { display: none; }
    .tm-carousel-item { flex: 0 0 100%; scroll-snap-align: start; }
    .tm-carousel-item img { width: 100%;  border-radius: 16px; display: block; object-fit: cover; aspect-ratio: 3 / 4; }
    .tm-single-img { width: 100%;  border-radius: 16px; margin-bottom: 16px; display: block; object-fit: cover; aspect-ratio: 3 / 4; }

    /* ===== Live Search Dropdown & Scrollbar Styles ===== */
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list,
    ul.wpr-ajax-search-list {
        max-height: 480px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scrollbar-width: thin !important;
        scrollbar-color: #0b8f64 #f1f5f9 !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
        border: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
        padding: 8px 0 !important;
        z-index: 999999 !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list::-webkit-scrollbar,
    ul.wpr-ajax-search-list::-webkit-scrollbar {
        width: 6px !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list::-webkit-scrollbar-track,
    ul.wpr-ajax-search-list::-webkit-scrollbar-track {
        background: #f1f5f9 !important;
        border-radius: 3px !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list::-webkit-scrollbar-thumb,
    ul.wpr-ajax-search-list::-webkit-scrollbar-thumb {
        background: #0b8f64 !important;
        border-radius: 3px !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list li,
    ul.wpr-ajax-search-list li {
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
        padding: 10px 16px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        transition: background 0.15s ease !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list li:last-child,
    ul.wpr-ajax-search-list li:last-child {
        border-bottom: none !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list li:hover,
    ul.wpr-ajax-search-list li:hover {
        background: #f8fafc !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list .wpr-ajax-img-wrap,
    ul.wpr-ajax-search-list .wpr-ajax-img-wrap {
        flex: 0 0 54px !important;
        width: 54px !important;
        height: 54px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        background: #f8fafc !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid #edf2f7 !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list .wpr-ajax-img-wrap img,
    ul.wpr-ajax-search-list .wpr-ajax-img-wrap img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list .wpr-ajax-search-content,
    ul.wpr-ajax-search-list .wpr-ajax-search-content {
        flex: 1 !important;
        min-width: 0 !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list .wpr-ajax-title,
    ul.wpr-ajax-search-list .wpr-ajax-title {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        line-height: 1.35 !important;
        margin-bottom: 4px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-decoration: none !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list .wpr-ajax-title:hover,
    ul.wpr-ajax-search-list .wpr-ajax-title:hover {
        color: #0b8f64 !important;
    }
    .wpr-ajax-search-wrap ul.wpr-ajax-search-list .wpr-search-product-price,
    ul.wpr-ajax-search-list .wpr-search-product-price {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #0b8f64 !important;
        margin: 0 !important;
    }
    .thaimart-search-view-all-item {
        padding: 12px 16px !important;
        background: #f0fdf4 !important;
        text-align: center !important;
        justify-content: center !important;
    }
    .thaimart-search-view-all-link {
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #0b8f64 !important;
        text-decoration: none !important;
        display: inline-block !important;
    }
    .thaimart-search-view-all-link:hover {
        text-decoration: underline !important;
    }

    
    @media (min-width: 1024px) {
        .tm-carousel::-webkit-scrollbar { display: block; height: 8px; }
        .tm-carousel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
    }

    
    /* Header search width */
    @media (min-width: 1024px) {
        .elementor-widget-wpr-search {
            max-width: 66% !important;
            margin: 0 auto;
        }
    }

    
    /* ===== Global Catalog Card Image Uniformity Fix ===== */
    .woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
    .woocommerce ul.products li.product .woocommerce-loop-product__link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .woocommerce ul.products li.product img,
    .woocommerce ul.products li.product .attachment-woocommerce_thumbnail,
    .wpr-grid-image-wrap img,
    ul.products li.product img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: contain !important;
        object-position: center !important;
        background-color: #ffffff !important;
        margin: 0 auto 8px auto !important;
        display: block !important;
    }

    /* ===== Single Product Gallery Image Container (Desktop & Mobile) ===== */
    body.single-product .elementor-widget-wpr-product-media .wpr-product-media-wrap,
    body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery,
    body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__wrapper,
    body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__image,
    body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__image a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
        background: #ffffff !important;
        width: 100% !important;
    }

    @media (min-width: 768px) {
        body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__wrapper {
            max-height: 480px !important;
            aspect-ratio: 1 / 1 !important;
        }
        body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__image img,
        body.single-product .woocommerce-product-gallery .wp-post-image {
            max-height: 460px !important;
            max-width: 460px !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            object-position: center !important;
            margin: 0 auto !important;
            display: block !important;
        }
    }

    @media (max-width: 767px) {
        body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__wrapper {
            max-height: 320px !important;
            aspect-ratio: 1 / 1 !important;
        }
        body.single-product .elementor-widget-wpr-product-media .woocommerce-product-gallery__image img,
        body.single-product .woocommerce-product-gallery .wp-post-image {
            max-height: 300px !important;
            max-width: 100% !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            object-position: center !important;
            margin: 0 auto !important;
            display: block !important;
        }
    }

    
/* ===== HIT Products Shortcode Grid (5 in row on desktop, 2 in row on mobile) ===== */
.thaimart-hit-grid-wrapper {
    width: 100% !important;
    margin: 0 auto !important;
}

.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 0 30px 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid::before,
.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid::after {
    display: none !important;
}

.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 1023px) and (min-width: 768px) {
    .thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 767px) {
    .thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}

    
/* ===== HIT Products Shortcode Grid (5 in row on desktop, 2 in row on mobile) ===== */
.thaimart-hit-grid-wrapper {
    width: 100% !important;
    margin: 0 auto !important;
}

.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 0 30px 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid::before,
.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid::after {
    display: none !important;
}

.thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 1023px) and (min-width: 768px) {
    .thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 767px) {
    .thaimart-hit-grid-wrapper ul.products.thaimart-hit-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}

    
/* ===== HIT PRODUCTS SLIDER (Custom Home Slider) ===== */
.custom-home-slider {
    width: 100% !important;
    position: relative !important;
    margin: 0 auto 30px auto !important;
}

.custom-home-slider .home-slider-arrows {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    position: relative !important;
    z-index: 10 !important;
}

.custom-home-slider .slider-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #3b7c5e !important;
    font-size: 18px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
    transition: all 0.25s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.custom-home-slider .slider-btn:hover {
    background: #3b7c5e !important;
    color: #ffffff !important;
    transform: scale(1.06) !important;
    box-shadow: 0 6px 14px rgba(59,124,94,0.25) !important;
}

.custom-home-slider ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important; 
    scroll-snap-type: x mandatory !important; 
    scroll-behavior: smooth !important; 
    padding: 10px 4px 30px 4px !important; 
    margin: 0 !important;
    scrollbar-width: none !important; 
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    list-style: none !important;
}

.custom-home-slider ul.products::before,
.custom-home-slider ul.products::after {
    display: none !important;
}

.custom-home-slider ul.products::-webkit-scrollbar {
    display: none !important;
}

/* 5 карточек на десктопе */
.custom-home-slider ul.products li.product {
    flex: 0 0 calc((100% - 80px) / 5) !important; 
    max-width: calc((100% - 80px) / 5) !important;
    width: calc((100% - 80px) / 5) !important;
    scroll-snap-align: start !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    height: auto !important; 
    box-sizing: border-box !important;
}

/* На экранах до 1200px: 4 карточки */
@media (max-width: 1200px) {
    .custom-home-slider ul.products li.product {
        flex: 0 0 calc((100% - 60px) / 4) !important;
        max-width: calc((100% - 60px) / 4) !important;
        width: calc((100% - 60px) / 4) !important;
    }
}

/* На планшетах до 1024px: 3 карточки */
@media (max-width: 1024px) {
    .custom-home-slider ul.products li.product {
        flex: 0 0 calc((100% - 40px) / 3) !important;
        max-width: calc((100% - 40px) / 3) !important;
        width: calc((100% - 40px) / 3) !important;
    }
}

/* На смартфонах до 768px: 2 карточки */
@media (max-width: 768px) {
    .custom-home-slider ul.products {
        gap: 12px !important;
    }
    .custom-home-slider ul.products li.product {
        flex: 0 0 calc((100% - 12px) / 2) !important;
        max-width: calc((100% - 12px) / 2) !important;
        width: calc((100% - 12px) / 2) !important;
    }
}

/* На узких экранах до 480px: 82% */
@media (max-width: 480px) {
    .custom-home-slider ul.products li.product {
        flex: 0 0 82% !important;
        max-width: 82% !important;
        width: 82% !important;
    }
}

    
/* ===== Catalog Desktop Header Spacing ===== */
@media (min-width: 1024px) {
    .page-id-13560 .elementor-element-5157202,
    body.page-id-13560 .elementor-element-5157202 {
        padding-top: 140px !important;
    }
}

    /* ===== Article Styling ===== */
/* ===== Article Styling ===== */
.tm-article-page {
    max-width: 900px;
    margin: 40px auto 80px auto;
    padding: 0 20px;
    font-family: "Jost", sans-serif;
    color: #1e293b;
    line-height: 1.7;
}

.tm-article-header {
    margin-bottom: 35px;
}

.tm-article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b7c5e;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.tm-article-back:hover {
    color: #2c5e46;
    transform: translateX(-3px);
}

.tm-article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.tm-meta-cat {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.tm-article-title {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    margin: 0 0 18px 0;
}

.tm-article-lead {
    font-size: 18px;
    color: #475569;
    background: #f8fafc;
    border-left: 4px solid #3b7c5e;
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 0;
}

.tm-item-section {
    margin-top: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e2e8f0;
}

.tm-item-section h2 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.tm-item-section p {
    font-size: 16px;
    color: #334155;
    margin-bottom: 14px;
}

.tm-item-section ul {
    margin: 10px 0 18px 20px;
    color: #334155;
}

.tm-item-section li {
    margin-bottom: 6px;
}

.tm-tip-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 18px 0 24px 0;
    font-size: 15px;
    color: #92400e;
}

.tm-tip-icon {
    font-size: 20px;
    line-height: 1;
}

/* Inline Product Card */
.tm-inline-product {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tm-inline-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(59,124,94,0.12);
    border-color: #cbd5e1;
}

.tm-ip-img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-ip-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.tm-inline-product:hover .tm-ip-img-wrap img {
    transform: scale(1.05);
}

.tm-ip-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.tm-ip-info {
    flex: 1;
    min-width: 0;
}

.tm-ip-sku {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 4px;
}

.tm-ip-title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    margin-bottom: 12px;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.tm-ip-title:hover {
    color: #3b7c5e;
}

.tm-ip-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tm-ip-price {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.tm-ip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3b7c5e;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tm-ip-btn:hover {
    background: #2c5e46;
    transform: translateY(-1px);
}

/* Related Products Grid */
.tm-related-section {
    margin-top: 60px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 16px;
}

.tm-related-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.tm-related-header p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px 0;
}

.tm-related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.tm-related-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tm-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.tm-rc-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-rc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tm-rc-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    min-height: 34px;
}

.tm-rc-title:hover {
    color: #3b7c5e;
}

.tm-rc-price {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.tm-rc-btn {
    display: block;
    text-align: center;
    background: #f1f5f9;
    color: #3b7c5e !important;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 0;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.tm-rc-btn:hover {
    background: #3b7c5e;
    color: #ffffff !important;
}

/* B2B Promo Banner */
.tm-b2b-banner {
    margin-top: 60px;
    background: linear-gradient(135deg, #1e3a2b 0%, #2e5941 50%, #3b7c5e 100%);
    border-radius: 18px;
    padding: 40px;
    color: #ffffff;
    box-shadow: 0 12px 35px rgba(30,58,43,0.25);
    position: relative;
    overflow: hidden;
}

.tm-b2b-banner::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.tm-b2b-banner-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.tm-b2b-banner-title {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 14px 0;
    line-height: 1.25;
}

.tm-b2b-banner-desc {
    font-size: 16px;
    color: #e2e8f0;
    line-height: 1.6;
    max-width: 750px;
    margin-bottom: 24px;
}

.tm-b2b-banner-desc strong {
    color: #fef08a;
}

.tm-b2b-banner-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.tm-b2b-bf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.tm-b2b-bf-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.tm-b2b-banner-action {
    display: flex;
    align-items: center;
}

.tm-b2b-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    padding: 14px 34px;
    border-radius: 30px;
    box-shadow: 0 6px 20px rgba(217,119,6,0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tm-b2b-btn-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(217,119,6,0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.tm-article-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 1024px) {
    .tm-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .tm-b2b-banner-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .tm-article-title {
        font-size: 28px;
    }
    .tm-item-section h2 {
        font-size: 22px;
    }
    .tm-inline-product {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px;
    }
    .tm-ip-img-wrap {
        width: 100%;
        height: 180px;
    }
    .tm-ip-bottom {
        width: 100%;
        justify-content: space-between;
    }
    .tm-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .tm-b2b-banner {
        padding: 24px 20px;
    }
    .tm-b2b-banner-title {
        font-size: 22px;
    }
    .tm-b2b-btn-cta {
        width: 100%;
        justify-content: center;
    }
}
    
/* ===== Blog Index Page Styling ===== */
.tm-blog-page {
    max-width: 1200px;
    margin: 40px auto 80px auto;
    padding: 0 20px;
    font-family: "Jost", sans-serif;
}

.tm-blog-hero {
    text-align: center;
    margin-bottom: 45px;
}

.tm-blog-title {
    font-size: 38px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.tm-blog-subtitle {
    font-size: 18px;
    color: #64748b;
    margin: 0;
}

.tm-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 28px;
}

.tm-blog-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tm-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(59,124,94,0.12);
    border-color: #cbd5e1;
}

.tm-blog-img {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #f8fafc;
    transition: transform 0.35s ease;
}

.tm-blog-card:hover .tm-blog-img {
    transform: scale(1.03);
}

.tm-blog-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tm-blog-meta {
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-blog-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.tm-blog-card:hover .tm-blog-card-title {
    color: #3b7c5e;
}

.tm-blog-excerpt {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 20px 0;
    flex: 1;
}

.tm-blog-more {
    font-size: 15px;
    font-weight: 700;
    color: #3b7c5e;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.tm-blog-card:hover .tm-blog-more {
    gap: 10px;
}

@media (max-width: 768px) {
    .tm-blog-title {
        font-size: 28px;
    }
    .tm-blog-grid {
        grid-template-columns: 1fr;
    }
}

    
/* ===== Desktop Header Spacing for Blog & Article Pages ===== */
@media (min-width: 1024px) {
    .tm-blog-page,
    .tm-article-page {
        margin-top: 180px !important;
    }
}

.thaimart-catalog-subtitle {
    font-family: Jost, sans-serif !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #666 !important;
    margin: 8px 0 26px 0 !important;
}
@media (max-width: 768px) {
    .thaimart-catalog-subtitle {
        font-size: 14px !important;
        line-height: 1.45 !important;
        margin: 6px 0 20px 0 !important;
    }
}

    