/**
 * WooCommerce – Cart / Checkout / Account + Responsive
 * Appended to style.css
 * @package shopnoidia
 */

/* ==========================================================================
   BREADCRUMB — chỉ thêm padding/spacing, không override Shofy theme CSS
   ========================================================================== */
.breadcrumb__area { background: #f8f9fa !important; border-bottom: 1px solid #eee; }
.breadcrumb__area .breadcrumb__list { padding: 0; margin: 0; }
.breadcrumb__area .breadcrumb__list .current { color: var(--primary-color, #0a2856); font-weight: 600; }
.breadcrumb__area .breadcrumb__list a { color: #555; }
.breadcrumb__area .breadcrumb__list a:hover { color: var(--primary-color, #0a2856); }

/* ==========================================================================
   WOOCOMMERCE – CART
   ========================================================================== */
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce { max-width: 100%; }

/* Cart table */
.woocommerce-cart-form__contents { width: 100%; border-collapse: collapse; }
.woocommerce-cart-form__contents thead th { padding: 14px 12px; background: #f8f9fa; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #555; border-bottom: 2px solid #eee; }
.woocommerce-cart-form__contents td { padding: 16px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.woocommerce-cart-form__contents .product-thumbnail img { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; border: 1px solid #eee; }
.woocommerce-cart-form__contents .product-name a { color: #222; font-weight: 600; font-size: 14px; }
.woocommerce-cart-form__contents .product-price, .woocommerce-cart-form__contents .product-subtotal { font-weight: 700; color: var(--accent-color, #e8000d); }
.woocommerce td.actions { background: #f8f9fa; padding: 16px; border-radius: 0 0 8px 8px; }
.woocommerce td.actions .coupon { display: flex; gap: 8px; flex-wrap: wrap; }
.woocommerce td.actions .coupon label { font-weight: 600; font-size: 13px; align-self: center; }
.woocommerce td.actions .coupon #coupon_code { padding: 10px 14px; border: 2px solid #eee; border-radius: 6px; font-size: 13px; outline: none; }
.woocommerce td.actions .coupon #coupon_code:focus { border-color: var(--primary-color); }
.woocommerce td.actions .button, .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    background: var(--primary-color) !important; color: #fff !important; border: none !important;
    padding: 10px 22px !important; border-radius: 6px !important; font-weight: 700 !important;
    font-size: 14px !important; cursor: pointer !important; transition: background .2s !important;
    text-decoration: none !important; display: inline-block !important;
}
.woocommerce td.actions .button:hover, .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover { background: #0a2856 !important; }

/* Cart totals */
.cart_totals h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.cart_totals .shop_table { width: 100%; border-collapse: collapse; }
.cart_totals .shop_table th, .cart_totals .shop_table td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.cart_totals .shop_table .order-total .woocommerce-Price-amount { font-size: 22px; font-weight: 900; color: var(--accent-color, #e8000d); }

/* ==========================================================================
   WOOCOMMERCE – CHECKOUT
   ========================================================================== */
.woocommerce-checkout #customer_details h3,
.woocommerce-checkout #order_review_heading { font-size: 18px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #eee; }

.woocommerce-checkout .form-row { margin-bottom: 16px; }
.woocommerce-checkout .form-row label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row input[type="password"],
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
    width: 100%; padding: 12px 14px; border: 2px solid #eee; border-radius: 8px;
    font-size: 14px; outline: none; transition: border-color .2s; box-sizing: border-box;
}
.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus { border-color: var(--primary-color); }

/* Order review table */
.woocommerce-checkout-review-order-table { width: 100%; border-collapse: collapse; }
.woocommerce-checkout-review-order-table thead th { background: #f8f9fa; padding: 12px 14px; font-size: 13px; font-weight: 700; text-transform: uppercase; color: #555; }
.woocommerce-checkout-review-order-table td, .woocommerce-checkout-review-order-table th { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.woocommerce-checkout-review-order-table .order-total .woocommerce-Price-amount { font-size: 20px; font-weight: 900; color: var(--accent-color,#e8000d); }

/* Place order button */
#place_order {
    width: 100%; background: var(--primary-color) !important; color: #fff !important;
    border: none !important; padding: 16px !important; border-radius: 8px !important;
    font-size: 17px !important; font-weight: 800 !important; cursor: pointer !important;
    transition: background .2s !important; letter-spacing: .5px !important;
}
#place_order:hover { background: #0a2856 !important; }

/* Payment methods */
.woocommerce-checkout #payment { background: #f8f9fa; border-radius: 8px; padding: 20px; margin-top: 20px; }
.woocommerce-checkout #payment ul.payment_methods { margin: 0; padding: 0; list-style: none; }
.woocommerce-checkout #payment ul.payment_methods li { padding: 12px 0; border-bottom: 1px solid #eee; }
.woocommerce-checkout #payment ul.payment_methods li label { font-size: 14px; font-weight: 600; cursor: pointer; }
.woocommerce-checkout #payment div.payment_box { background: #fff; border-radius: 6px; padding: 14px; margin-top: 10px; font-size: 13px; color: #666; }

/* ==========================================================================
   WOOCOMMERCE – MY ACCOUNT
   ========================================================================== */
.woocommerce-MyAccount-navigation { min-width: 200px; }
.woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.woocommerce-MyAccount-navigation ul li a { display: block; padding: 13px 18px; font-size: 14px; color: #333; border-bottom: 1px solid #f5f5f5; transition: background .15s, color .15s; }
.woocommerce-MyAccount-navigation ul li a:hover { background: #f0f4ff; color: var(--primary-color); }
.woocommerce-MyAccount-navigation ul li.is-active a { background: var(--primary-color); color: #fff; font-weight: 700; }
.woocommerce-MyAccount-content { flex: 1; }
.woocommerce-account .woocommerce { display: flex; gap: 30px; align-items: flex-start; }

/* Account form inputs */
.woocommerce-account .woocommerce-EditAccountForm input,
.woocommerce-account .woocommerce-address-fields input,
.woocommerce-account .woocommerce-address-fields select,
.woocommerce-ResetPassword input { width: 100%; padding: 11px 14px; border: 2px solid #eee; border-radius: 8px; font-size: 14px; outline: none; }
.woocommerce-account .woocommerce-EditAccountForm input:focus { border-color: var(--primary-color); }

/* Account orders table */
.woocommerce-orders-table { width: 100%; border-collapse: collapse; }
.woocommerce-orders-table thead th { background: #f8f9fa; padding: 12px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #666; }
.woocommerce-orders-table td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a { background: var(--primary-color); color: #fff; padding: 6px 14px; border-radius: 5px; font-size: 12px; font-weight: 600; text-decoration: none; }
.wc-bacs-bank-details, .woocommerce-bacs-bank-details { background: #f0f4ff; border-radius: 8px; padding: 16px; margin-top: 12px; }

/* WC Notices */
.woocommerce-message, .woocommerce-info, .woocommerce-error { border-radius: 8px !important; padding: 14px 18px !important; margin-bottom: 20px !important; font-size: 14px !important; }
.woocommerce-message { background: #e8f5e9 !important; border-color: #81c784 !important; color: #2e7d32 !important; }
.woocommerce-info { background: #e3f2fd !important; border-color: #64b5f6 !important; color: #1565c0 !important; }
.woocommerce-error { background: #fce4ec !important; border-color: #e57373 !important; color: #c62828 !important; }
.woocommerce-message::before { color: #2e7d32 !important; }
.woocommerce-error::before { color: #c62828 !important; }

/* ==========================================================================
   RESPONSIVE – MOBILE & TABLET
   ========================================================================== */

/* Base mobile adjustments */
@media (max-width: 991px) {
    /* Header */
    .tp-header-top { display: none; }
    
    /* Reduce header height and whitespace on mobile/tablet */
    .tp-header-main, .tp-header-sticky-area {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    }
    header .tp-header-area {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    .logo img {
        height: 40px !important;
        width: auto !important;
    }
    /* Fix potential margins on mobile row */
    .tp-header-main .row, .tp-header-sticky-area .row {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    body { padding-bottom: 62px; } /* space for bottom nav */

    /* Search results drop-down */
    .bb-quick-search-results { max-height: 280px; }

    /* Front page */
    .tp-slider-area { padding: 0 0 40px 0 !important; }

    /* Archive filters */
    .tp-shop-sidebar { display: none; }
    .tp-shop-sidebar.sidebar-open { display: block; position: fixed; top: 0; left: 0; width: 80%; max-width: 320px; height: 100vh; background: #fff; z-index: 10001; overflow-y: auto; padding: 24px; box-shadow: 4px 0 24px rgba(0,0,0,.15); }
    .filter-sidebar-col { display: none !important; }

    /* WC account */
    .woocommerce-account .woocommerce { flex-direction: column; }
    .woocommerce-MyAccount-navigation { width: 100%; }
    .woocommerce-MyAccount-navigation ul { display: flex; flex-wrap: wrap; overflow: visible; border-radius: 8px; }
    .woocommerce-MyAccount-navigation ul li { flex: 1 1 auto; }
    .woocommerce-MyAccount-navigation ul li a { text-align: center; padding: 10px 12px; font-size: 12px; border-bottom: none; border-right: 1px solid #f5f5f5; }

    /* Section titles */
    .tp-section-title, .section-title { font-size: 17px; }

    /* Floating buttons – offset for bottom nav */
    #button-contact-vr { bottom: 80px; }
    .back-to-top-wrapper { bottom: 80px; }
}

@media (max-width: 767px) {
    /* Typography */
    body { font-size: 14px; }
    h1 { font-size: 22px !important; }
    h2 { font-size: 18px !important; }

    /* Cart table – mobile stack */
    .woocommerce-cart-form__contents thead { display: none; }
    .woocommerce-cart-form__contents tr { display: block; border-bottom: 2px solid #eee; padding: 12px 0; }
    .woocommerce-cart-form__contents td { display: flex; align-items: center; gap: 10px; border: none; padding: 6px 12px; }
    .woocommerce-cart-form__contents td::before { content: attr(data-title); font-size: 12px; font-weight: 700; color: #888; min-width: 80px; text-transform: uppercase; }
    .woocommerce-cart-form__contents td.product-remove::before { display: none; }
    .woocommerce-cart-form__contents td.product-thumbnail::before { display: none; }

    /* Checkout 2-col → 1-col */
    .col-form-col-1, .col-form-col-2 { width: 100% !important; float: none !important; }

    /* Product card – 2 per row on mobile */
    .tp-product-item { font-size: 13px; }
    .tp-product-content { padding: 8px 8px 10px; }
    .tp-product-price-wrapper .price { font-size: 13px; }
    .tp-product-thumb img { aspect-ratio: 1; }
    .tp-product-title { font-size: 12px !important; }
    .tp-product-rating-text { display: none; } /* Ẩn số đánh giá cho gọn */

    /* Single product – stack */
    .tp-product-details-title { font-size: 18px !important; }
    .tp-product-details-price-wrapper .price { font-size: 22px !important; }

    /* Footer */
    .tp-footer-widget { margin-bottom: 30px; }
    .tp-footer-top .col-xl-4, .tp-footer-top .col-xl-2 { margin-bottom: 28px; }

    /* Hero slider */
    .tp-slider-item { padding: 30px 0 !important; }
    .tp-slider-item .tp-slider-title { font-size: 26px !important; line-height: 1.3 !important; margin-bottom: 10px !important; }
    .tp-slider-item p { font-size: 14px !important; line-height: 1.4 !important; margin-bottom: 15px !important; }

    /* Front page sections – slider 2 sản phẩm trên mobile */
    .snd-product-slider.swiper-container { padding-bottom: 10px; }

    /* Page / blog sidebar – goes below on mobile */
    .tp-sidebar, .tp-blog-sidebar { margin-top: 30px; }

    /* Breadcrumb wrapping on mobile */
    .breadcrumb__area { padding-top: 15px !important; padding-bottom: 15px !important; margin-bottom: 25px !important; }
    .breadcrumb__list {
        font-size: 12px !important;
        line-height: 1.6 !important;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0 5px;
    }
    .breadcrumb__list a, .breadcrumb__list span { font-size: 12px !important; }

    /* 404 */
    .tp-404-title { font-size: 80px !important; }

    /* Offcanvas/cart overlay */
    .offcanvas__area.offcanvas-opened { right: 0 !important; }
    .cartmini__area.cartmini-opened { right: 0 !important; }

    /* Page about stats */
    .tp-stats-grid .col-6 { padding: 10px 0; }

    /* Checkout fields */
    .woocommerce-checkout .form-row-first,
    .woocommerce-checkout .form-row-last { width: 100% !important; float: none !important; }
}

@media (max-width: 575px) {
    /* Extra small screens */
    .container { padding-left: 14px; padding-right: 14px; }
    .tp-product-item .tp-product-add-cart-btn-large-wrapper { bottom: 0 !important; } /* Always show on mobile */
    .tp-product-action { display: none; } /* Hide hover buttons */

    /* Mini cart full width */
    .cartmini__area { width: 100%; right: -100%; }

    /* Search overlay full */
    .tp-search-form { padding: 20px; margin: 0 14px; }

    /* Footer bottom */
    .tp-footer-bottom .col-md-6 { text-align: center !important; }
    .tp-footer-bottom .col-md-6:last-child { margin-top: 8px; }

    /* Blog cards */
    .tp-blog-card { min-height: auto; }

    /* Announcement bar text */
    .ae-anno-announcement__text { font-size: 11px; }
}

/* ============================================================================
   PRODUCT SLIDER – Swiper responsive (desktop 4, tablet 3, mobile 2)
   ============================================================================ */
.tp-product-arrival-slider {
    position: relative;
    padding: 0 40px;
}
.snd-product-slider {
    overflow: hidden;
}

/* FIX CLS: Enforce layout before Swiper JS initializes */
.snd-product-slider:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-wrapper {
    display: flex;
    overflow: hidden;
}
.snd-product-slider:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide {
    flex-shrink: 0 !important;
    width: calc(25% - 12px) !important; /* Desktop 4 items, 3 gaps of 16px */
    margin-right: 16px !important;
}
@media (max-width: 1199px) {
    .snd-product-slider:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide { 
        width: calc(33.333% - 10.66px) !important; /* 3 items, 2 gaps */
        margin-right: 16px !important;
    }
}
@media (max-width: 767px) {
    .snd-product-slider:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide { 
        width: calc(50% - 8px) !important; /* 2 items, 1 gap */
        margin-right: 16px !important;
    }
}


.snd-product-slider .swiper-slide {
    height: auto;
    display: flex;
}
.snd-product-slider .swiper-slide > .tp-product-item {
    width: 100%;
    flex: 1;
}
/* Arrow navigation */
.tp-arrival-slider-button-prev,
.tp-arrival-slider-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.tp-arrival-slider-button-prev:hover,
.tp-arrival-slider-button-next:hover { background: #0a2856; }
.tp-arrival-slider-button-prev { left: 0; }
.tp-arrival-slider-button-next { right: 0; }
.tp-arrival-slider-button-prev::after,
.tp-arrival-slider-button-next::after {
    font-family: 'swiper-icons', serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.tp-arrival-slider-button-prev::after { content: 'prev'; }
.tp-arrival-slider-button-next::after { content: 'next'; }

/* Arrow SVG fallback */
.tp-arrival-slider-button-prev svg,
.tp-arrival-slider-button-next svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2.5;
}

@media (max-width: 1199px) {
    /* tablet: slider 3 */
    .tp-product-arrival-slider { padding: 0 36px; }
}
@media (max-width: 767px) {
    /* mobile: slider 2 */
    .tp-product-arrival-slider { padding: 0; }
    .tp-arrival-slider-button-prev { left: -10px; }
    .tp-arrival-slider-button-next { right: -10px; }
}
@media (max-width: 575px) {
    .tp-product-arrival-slider { padding: 0; }
}

/* ============================================================================
   HOVER FIX - đảm bảo chữ không biến mất khi hover
   ============================================================================ */
/* Override rule gây lỗi: a:hover tự override màu primary - chỉ áp dụng cho link thường */
a:hover {
    color: var(--primary-color);
    opacity: 1 !important;
}
/* Nút trên nền màu - chữ phải luôn trắng */
.tp-btn:hover,
.tp-btn-2:hover,
.tp-header-search-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.tp-product-add-cart-btn-large:hover,
.tp-cat-btn:hover,
#place_order:hover {
    color: #fff !important;
    opacity: 1 !important;
}
/* Nút trên nền tối (bottom nav) */
.tp-header-bottom-nav a:hover,
.tp-main-nav ul li a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}
/* Action icons header - chữ đổi màu primary */
.tp-header-action-btn:hover {
    color: var(--primary-color) !important;
}
/* Category panel links */
.tp-cat-panel ul li a:hover {
    background: #f0f4ff;
    color: var(--primary-color) !important;
}
/* Mobile item buttons */
.tp-mobile-item-btn:hover {
    color: var(--primary-color) !important;
}
/* Footer links */
.tp-footer-widget ul li a:hover {
    color: var(--primary-color) !important;
}

/* Footer title style */
.tp-footer-widget-title {
    font-size: 16px; font-weight: 700; color: #111;
    margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}
.tp-footer-widget ul { margin: 0; padding: 0; list-style: none; }
.tp-footer-widget ul li { margin-bottom: 8px; }
.tp-footer-widget ul li a { font-size: 13px; color: #555; transition: color .15s; }
.tp-footer-widget ul li a:hover { color: var(--primary-color); }
.tp-footer-contact a { color: #333; font-size: 14px; transition: color .15s; }
.tp-footer-contact a:hover { color: var(--primary-color); }
.tp-footer-top { padding: 50px 0 20px; }
.tp-footer-bottom { background: #f5f5f5; border-top: 1px solid #eee; }

/* Post content styling */
.tp-post-content h2, .tp-page-body h2 { font-size: 20px; font-weight: 700; color: #111; margin: 28px 0 14px; }
.tp-post-content h3, .tp-page-body h3 { font-size: 17px; font-weight: 700; color: #111; margin: 22px 0 12px; }
.tp-post-content ul, .tp-page-body ul { padding-left: 20px; margin-bottom: 16px; }
.tp-post-content ul li, .tp-page-body ul li { margin-bottom: 6px; line-height: 1.7; }
.tp-post-content blockquote, .tp-page-body blockquote { border-left: 4px solid var(--primary-color); padding: 12px 20px; background: #f0f4ff; border-radius: 0 8px 8px 0; margin: 20px 0; font-style: italic; color: #555; }
.tp-post-content img, .tp-page-body img { max-width: 100%; height: auto; border-radius: 8px; }
.tp-post-content a { color: var(--primary-color); }
.tp-post-content p { margin-bottom: 16px; }

/* Pagination */
/* Pagination */
ul.page-numbers { display: flex !important; align-items: center !important; justify-content: center !important; list-style: none !important; padding: 0 !important; margin: 0 !important; gap: 6px !important; flex-wrap: wrap !important; }
.page-numbers { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 38px !important; height: 38px !important; border-radius: 6px !important; border: 1px solid #eee !important; color: #333 !important; font-size: 14px !important; font-weight: 600 !important; margin: 0 !important; text-decoration: none !important; transition: background .2s, color .2s; }
.page-numbers.current, .page-numbers:hover { background: var(--primary-color) !important; color: #fff !important; border-color: var(--primary-color) !important; }
.page-numbers.dots { border: none !important; cursor: default !important; }
.page-numbers.prev, .page-numbers.next { width: auto !important; padding: 0 14px !important; }

/* Sorting */
.woocommerce-ordering { margin-bottom: 0; }
.woocommerce-ordering select {
    border: 1px solid #eee;
    padding: 0 40px 0 20px;
    height: 40px;
    line-height: 38px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L5 5L9 1" stroke="%23555555" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
}
.woocommerce-ordering select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ================================================================
   MOBILE SHOP TOP BAR — Fix căn giữa nút Lọc & Sắp xếp
   ================================================================ */
@media (max-width: 991px) {
    /* Row chứa 2 nút: căn giữa dọc, không wrap */
    .tp-shop-top-mobile-row {
        flex-wrap: nowrap !important;
        align-items: center !important;
        margin-left: -5px !important;
        margin-right: -5px !important;
        min-height: 46px !important;
    }
    /* Hai cột con đều flex + căn giữa dọc */
    .tp-shop-top-mobile-left,
    .tp-shop-top-mobile-right {
        padding-left: 5px !important;
        padding-right: 5px !important;
        display: flex !important;
        align-items: center !important;
    }
    .tp-shop-top-mobile-right {
        min-width: 0 !important;
        justify-content: flex-end !important;
    }
    /* Wrapper của select cũng flex để căn giữa */
    .tp-shop-top-select {
        margin: 0 !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
    }
    .woocommerce-ordering {
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Nice-select & native select: chiều cao 38px, khớp với nút Lọc */
    .tp-shop-top-select select.orderby,
    .tp-shop-top-select .nice-select {
        width: auto !important;
        min-width: 120px !important;
        max-width: calc(100vw - 150px) !important;
        margin: 0 !important;
        height: 38px !important;
        line-height: 36px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        font-size: 13px !important;
        box-sizing: border-box !important;
    }

    /* Dropdown list: KHÔNG tràn màn hình */
    .tp-shop-top-select .nice-select .list {
        width: max-content !important;
        min-width: 150px !important;
        max-width: calc(100vw - 16px) !important;
        white-space: nowrap !important;
        left: auto !important;
        right: 0 !important;
        box-sizing: border-box !important;
        font-size: 13px !important;
        z-index: 9999 !important;
    }
    .tp-shop-top-select .nice-select .option {
        white-space: nowrap !important;
        line-height: 1.5 !important;
        padding: 8px 14px !important;
        min-height: auto !important;
        font-size: 13px !important;
    }

    /* Nút Lọc: override mọi padding từ theme94a3.css, đảm bảo height = 38px */
    .tp-filter-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        line-height: 38px !important;
        padding: 0 12px !important;  /* Override padding: 13px 20px 9px từ theme94a3 */
        gap: 6px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        box-sizing: border-box !important;
    }
    .tp-filter-btn svg {
        display: block !important;
        flex-shrink: 0 !important;
    }
    /* Fix: Reset tp-shop-top-right margin-top từ theme desktop */
    .tp-shop-top-right {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    /* Fix: form.woocommerce-ordering có margin-bottom mặc định làm lệch dọc */
    .tp-shop-top-select form.woocommerce-ordering,
    form.woocommerce-ordering {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        height: 38px !important;
    }
    /* Fix: native select.orderby tràn màn hình khi mở — giới hạn bằng cách giữ 
       container nhỏ và select tự co lại; trình duyệt mobile sẽ mở overlay riêng */
    .tp-shop-top-select,
    .tp-shop-top-select .woocommerce-ordering {
        max-width: calc(100vw - 120px) !important;
        overflow: visible !important;
    }
    /* Select box: giới hạn kích thước hiển thị, dùng text-overflow để cắt text dài */
    .tp-shop-top-select select.orderby {
        max-width: 100% !important;
        text-overflow: ellipsis !important;
    }
}

/* ================================================================
   MOBILE FILTER OFFCANVAS — Giảm padding header/body
   ================================================================ */
@media (max-width: 991px) {
    #mobileShopFilterOffcanvas .offcanvas-header {
        padding: 12px 16px !important;
        border-bottom: 1px solid #eaeaea !important;
    }
    #mobileShopFilterOffcanvas .offcanvas-body,
    #mobileShopFilterBody {
        padding: 12px 16px !important;
        overflow-y: auto !important;
    }
    #mobileShopFilterBody .bb-filter-offcanvas-area,
    #mobileShopFilterBody .bb-shop-sidebar,
    #mobileShopFilterBody .bb-filter-offcanvas-wrapper,
    #mobileShopFilterBody .tp-sidebar-search,
    #mobileShopFilterBody .bb-product-filter {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    #mobileShopFilterBody .bb-filter-offcanvas-area {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        z-index: auto !important;
        overflow: visible !important;
    }
    #mobileShopFilterBody .mobile-filter-close {
        display: none !important;
    }
    /* Fix: bb-shop-sidebar và bb-filter-offcanvas-wrapper kế thừa padding-top lớn từ desktop gây khoảng trắng */
    #mobileShopFilterBody .bb-shop-sidebar,
    #mobileShopFilterBody .bb-filter-offcanvas-wrapper {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }
    /* Fix: front-ecommerceb81c.css set padding:120px 15px 35px cho .bb-filter-offcanvas-wrapper trên mobile */
    #mobileShopFilterBody .bb-filter-offcanvas-wrapper {
        padding: 0 !important;
        min-height: auto !important;
    }
    /* Fix: .bb-filter-offcanvas-area có position:fixed khi trong offcanvas */
    #mobileShopFilterBody .bb-filter-offcanvas-area {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        overflow-y: visible !important;
        overscroll-behavior-y: auto !important;
    }
}

/* Filter toggle for mobile */
.tp-filter-toggle-btn {
    display: none; background: var(--primary-color); color: #fff; border: none;
    padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: 14px;
    cursor: pointer; margin-bottom: 16px; align-items: center; gap: 8px;
}
@media (max-width: 991px) { .tp-filter-toggle-btn { display: flex; } }
.sidebar-close-btn { display: none; background: none; border: none; cursor: pointer; font-size: 20px; float: right; }
@media (max-width: 991px) { .sidebar-close-btn { display: block; } }

/* Single Product Cart Form */
.product-form-wrapper form.cart { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-bottom: 30px; border-top: 1px solid #eee; padding-top: 30px; }
.product-form-wrapper form.cart .quantity { display: flex; align-items: center; position: relative; width: 120px; background: #f5f5f5; border-radius: 6px; padding: 0 15px; }
.product-form-wrapper form.cart .quantity input.qty { width: 100%; height: 46px; border: none; background: transparent; text-align: center; font-size: 16px; font-weight: 600; padding: 0; outline: none; -moz-appearance: textfield; }
.product-form-wrapper form.cart .quantity input.qty::-webkit-outer-spin-button, .product-form-wrapper form.cart .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.product-form-wrapper form.cart .button.single_add_to_cart_button { flex: 1; min-width: 200px; height: 46px; border-radius: 6px !important; background: var(--primary-color) !important; color: #fff !important; font-size: 16px !important; font-weight: 600 !important; border: none !important; margin: 0 !important; padding: 0 30px !important; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.product-form-wrapper form.cart .button.single_add_to_cart_button:hover { background: #0a2856 !important; }

/* Product Tags and Categories */
.tp-product-details-category span a, .tp-product-details-query-item a { color: #555; text-decoration: none; transition: color .2s; }
.tp-product-details-category span a:hover, .tp-product-details-query-item a:hover { color: var(--primary-color); }
.tp-product-details-query-item { font-size: 14px; margin-bottom: 5px; color: #222; }
.tp-product-details-query-item span:first-child { font-weight: 600; margin-right: 5px; }
.tp-product-details-category { margin-bottom: 5px; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: #888; }

/* Single Product Gallery Thumbnails */
.product .flex-control-thumbs { display: flex; flex-wrap: wrap; margin: 10px -5px 0; padding: 0; list-style: none; }
.product .flex-control-thumbs li { width: 90px; height: 90px; padding: 0 5px; margin-bottom: 10px; cursor: pointer; list-style: none; }
.product .flex-control-thumbs li img { width: 100%; height: 100%; object-fit: contain; border: 1px solid #eee; border-radius: 4px; transition: border-color 0.3s; }
.product .flex-control-thumbs li img.flex-active, .product .flex-control-thumbs li img:hover { border-color: var(--primary-color); }

/* Single Product Tabs */
.product .woocommerce-tabs { margin-top: 50px; border-top: 1px solid #eee; padding-top: 40px; clear: both; }
.product .woocommerce-tabs ul.tabs { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 30px; border-bottom: 1px solid #eee; }
.product .woocommerce-tabs ul.tabs li { margin: 0; padding: 0; border: none; background: transparent; position: relative; }
.product .woocommerce-tabs ul.tabs li a { display: block; padding: 10px 25px; font-size: 18px; font-weight: 600; color: #555; text-decoration: none; position: relative; }
.product .woocommerce-tabs ul.tabs li.active a { color: var(--primary-color); }
.product .woocommerce-tabs ul.tabs li.active a::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--primary-color); }
.product .woocommerce-tabs .panel h2:first-of-type { display: none; }

/* Single Product Description Lists */
.product .woocommerce-tabs .panel ul { list-style: none; padding: 0; margin: 0 0 20px 0; }
.product .woocommerce-tabs .panel ul li { position: relative; padding-left: 20px; margin-bottom: 10px; line-height: 1.6; color: #555; }
.product .woocommerce-tabs .panel ul li::before { content: ''; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary-color); }

/* Single Product Attributes Table */
.product table.shop_attributes { width: 100%; border-collapse: collapse; margin-bottom: 30px; border: 1px solid #eee; }
.product table.shop_attributes th, .product table.shop_attributes td { padding: 12px 15px; border-bottom: 1px solid #eee; text-align: left; }
.product table.shop_attributes th { width: 30%; background: #f9f9f9; font-weight: 600; color: #333; border-right: 1px solid #eee; font-style: normal; }
.product table.shop_attributes td { color: #555; }
.product table.shop_attributes td p { margin: 0; padding: 0; }

/* Single Product Reviews */
.product .woocommerce-tabs .panel #reviews ol.commentlist { list-style: none !important; padding: 0; margin: 0; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li { list-style: none !important; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid #eee; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li .comment_container { display: flex; gap: 20px; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li img.avatar { width: 50px; height: 50px; border-radius: 50%; padding: 0; border: none; background: #f5f5f5; flex-shrink: 0; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li .comment-text { flex: 1; border: none; padding: 0; margin: 0; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li .meta { margin-bottom: 10px; color: #888; font-size: 13px; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li .meta strong { color: #333; font-size: 15px; font-weight: 600; margin-right: 5px; }
.product .woocommerce-tabs .panel #reviews ol.commentlist li .description { color: #444; line-height: 1.6; }
.product .woocommerce-tabs .panel #reviews .star-rating { float: right; color: #ffb800; font-size: 14px; width: 5.4em; overflow: hidden; position: relative; height: 1em; line-height: 1; }
.product .woocommerce-tabs .panel #reviews .star-rating::before { content: '\2605\2605\2605\2605\2605'; color: #e0e0e0; float: left; top: 0; left: 0; position: absolute; letter-spacing: 2px; }
.product .woocommerce-tabs .panel #reviews .star-rating span { overflow: hidden; float: left; top: 0; left: 0; position: absolute; padding-top: 1.5em; }
.product .woocommerce-tabs .panel #reviews .star-rating span::before { content: '\2605\2605\2605\2605\2605'; top: 0; position: absolute; left: 0; color: #ffb800; letter-spacing: 2px; }

/* ================================================================
   REVIEW SUMMARY PANEL (Rating Overview: average score + star bars)
   ================================================================ */
#reviews .woocommerce-product-rating { display: none; }

/* Container layout: summary left | list right */
#reviews #comments { margin-bottom: 40px; }
#reviews h2.woocommerce-Reviews-title { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; text-align: center; }

/* Rating summary box */
#reviews .tp-review-summary { 
    display: flex; 
    gap: 30px; 
    background: #f9f9f9; 
    border-radius: 8px; 
    padding: 25px 30px; 
    margin-bottom: 30px; 
    align-items: center; 
    justify-content: center; 
    flex-wrap: wrap; 
}
#reviews .tp-review-avg { min-width: 120px; text-align: center; }
#reviews .tp-review-avg .avg-score { font-size: 48px; font-weight: 800; color: #222; line-height: 1; }
#reviews .tp-review-avg .avg-stars { margin: 6px 0 4px; color: #ffb800; font-size: 22px; letter-spacing: 2px; }
#reviews .tp-review-avg .avg-count { font-size: 13px; color: #888; }
#reviews .tp-review-bars { flex: none; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
#reviews .tp-review-bars .bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #555; }
#reviews .tp-review-bars .bar-row .bar-label { width: 40px; flex-shrink: 0; }
#reviews .tp-review-bars .bar-row .bar-track { flex: 1; height: 8px; background: #e5e5e5; border-radius: 4px; overflow: hidden; }
#reviews .tp-review-bars .bar-row .bar-fill { height: 100%; background: #ffb800; border-radius: 4px; transition: width .4s; }
#reviews .tp-review-bars .bar-row .bar-pct { width: 36px; text-align: right; flex-shrink: 0; }

/* Individual review card */
#reviews .commentlist li.review { list-style: none !important; counter-increment: none !important; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 20px; margin-bottom: 15px; }
#reviews .commentlist li.review::before { display: none !important; content: none !important; }
#reviews .commentlist li.review .comment_container { display: flex; gap: 16px; align-items: flex-start; }
#reviews .commentlist li.review img.avatar { width: 44px; height: 44px; border-radius: 50%; background: #f0f0f0; flex-shrink: 0; border: none; padding: 0; }
#reviews .commentlist li.review .comment-text { flex: 1; border: none; padding: 0; margin: 0; }
#reviews .commentlist li.review .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#reviews .commentlist li.review .meta .woocommerce-review__author { font-weight: 700; font-size: 15px; color: #222; }
#reviews .commentlist li.review .meta .woocommerce-review__dash { display: none; }
#reviews .commentlist li.review .meta .woocommerce-review__published-date { font-size: 13px; color: #aaa; }
#reviews .commentlist li.review .description p { color: #555; font-size: 15px; line-height: 1.7; margin: 0; }
#reviews .commentlist li.review .star-rating { float: none !important; margin-left: auto; }

/* Review form */
#review_form_wrapper { margin-top: 40px; border-top: 1px solid #eee; padding-top: 30px; }
#review_form_wrapper h3#reply-title { font-size: 20px; font-weight: 700; color: #222; margin-bottom: 5px; }
#review_form_wrapper .comment-notes { font-size: 13px; color: #888; margin-bottom: 20px; }
#review_form_wrapper .comment-form-rating label { font-weight: 600; color: #333; margin-bottom: 8px; display: block; }
#review_form_wrapper .stars a { font-size: 22px; color: #ccc; text-decoration: none; transition: color .2s; }
#review_form_wrapper .stars a:hover, #review_form_wrapper .stars a.active, #review_form_wrapper .stars .selected a { color: #ffb800 !important; }
#review_form_wrapper .stars { margin-bottom: 20px; }
#review_form_wrapper p.comment-form-comment label { font-weight: 600; color: #333; margin-bottom: 6px; display: block; }
#review_form_wrapper p.comment-form-comment textarea { width: 100%; min-height: 120px; padding: 12px 15px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; color: #333; background: #f9f9f9; resize: vertical; outline: none; transition: border-color .2s; }
#review_form_wrapper p.comment-form-comment textarea:focus { border-color: var(--primary-color); background: #fff; }
#review_form_wrapper .comment-form-author, #review_form_wrapper .comment-form-email { display: inline-block; width: 48%; margin-right: 2%; }
#review_form_wrapper .comment-form-email { margin-right: 0; }
#review_form_wrapper .comment-form-author input, #review_form_wrapper .comment-form-email input { width: 100%; padding: 10px 15px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; color: #333; background: #f9f9f9; outline: none; transition: border-color .2s; }
#review_form_wrapper .comment-form-author input:focus, #review_form_wrapper .comment-form-email input:focus { border-color: var(--primary-color); background: #fff; }
#review_form_wrapper .form-submit #submit { display: inline-block; padding: 12px 40px; background: var(--primary-color); color: #fff; font-size: 16px; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; transition: background .2s; margin-top: 15px; }
#review_form_wrapper .form-submit #submit:hover { background: #0a2856; }
#review_form_wrapper .comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #666; margin: 10px 0; }
#review_form_wrapper .comment-form-cookies-consent input { width: auto; }

/* ================================================================
   PRODUCT DESCRIPTION TABLE (inline-styled tables from database)
   ================================================================ */
.woocommerce-tabs .panel .entry-content table,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 30px;
    font-size: 14px;
    border: 1px solid #ddd;
}
.woocommerce-tabs .panel .entry-content table th,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) th {
    background: #222;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #333;
    letter-spacing: .5px;
    font-size: 13px;
}
.woocommerce-tabs .panel .entry-content table td,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) td {
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    color: #444;
    line-height: 1.5;
    vertical-align: top;
}
.woocommerce-tabs .panel .entry-content table tr:nth-child(odd) td,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) tr:nth-child(odd) td {
    background: #f7f7f7;
}
.woocommerce-tabs .panel .entry-content table tr:nth-child(even) td,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) tr:nth-child(even) td {
    background: #fff;
}
.woocommerce-tabs .panel .entry-content table td strong,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) td strong {
    color: #222;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}
.woocommerce-tabs .panel .entry-content table td a,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) td a {
    color: var(--primary-color);
    text-decoration: none;
}
.woocommerce-tabs .panel .entry-content table td a:hover,
.woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) td a:hover {
    text-decoration: underline;
}
@media (max-width: 767px) {
    .woocommerce-tabs .panel .entry-content table,
    .woocommerce-tabs .panel table:not(.shop_attributes):not(.commentlist) {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
}

/* ================================================================
   TWEAKS: Image ratio, Gallery Trigger, Price styling
   ================================================================ */
/* 1. Remove magnifying glass icon on single product gallery visually but keep it clickable via JS */
.woocommerce-product-gallery__trigger {
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    z-index: -1 !important;
}

/* 2. Product card image aspect ratio */
.tp-product-thumb img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
    width: 100%;
    height: auto;
}

/* 3. Old price color and layout */
.tp-product-price-wrapper,
.tp-product-details-price-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}
.tp-product-price-wrapper del.old-price,
.tp-product-price-wrapper del.old-price .woocommerce-Price-amount,
.tp-product-price-wrapper del.old-price bdi,
.tp-product-details-price-wrapper del.old-price,
.tp-product-details-price-wrapper del.old-price .woocommerce-Price-amount,
.tp-product-details-price-wrapper del.old-price bdi {
    color: #666666 !important;
    font-size: 0.95em !important;
    font-weight: 500;
    text-decoration: line-through !important;
}
.tp-product-price-wrapper span,
.tp-product-details-price-wrapper span {
    display: inline-block;
}

@media (max-width: 767px) {
    .tp-product-price-wrapper,
    .tp-product-details-price-wrapper {
        flex-wrap: wrap !important;
        white-space: normal !important;
    }
}

/* 4. Global Star Rating Style */
.woocommerce .star-rating, .star-rating {
    float: none;
    display: inline-block;
    color: #ffb800;
    font-size: 14px;
    width: 5.4em;
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-family: sans-serif;
}
.woocommerce .star-rating::before, .star-rating::before {
    content: '\2605\2605\2605\2605\2605';
    color: #e0e0e0;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    letter-spacing: 2px;
}
.woocommerce .star-rating span, .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em; /* Hides text */
}
.woocommerce .star-rating span::before, .star-rating span::before {
    content: '\2605\2605\2605\2605\2605';
    top: 0;
    position: absolute;
    left: 0;
    color: #ffb800;
    letter-spacing: 2px;
}
.tp-product-details-rating { margin-right: 8px; display: flex; align-items: center; }

/* 5. WooCommerce Mini Cart Fallback Styles */
.widget_shopping_cart_content {
    padding: 20px;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.woocommerce-mini-cart {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.woocommerce-mini-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}
.woocommerce-mini-cart-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 4px;
}
.woocommerce-mini-cart-item a {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}
.woocommerce-mini-cart-item .quantity {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}
.woocommerce-mini-cart-item .remove {
    position: absolute;
    right: 0;
    top: 15px;
    color: #e8000d;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
}
.woocommerce-mini-cart__total {
    padding: 15px 0;
    border-top: 1px solid #eee;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    margin: 0;
}
.woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}
.woocommerce-mini-cart__buttons a.button {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
}
.woocommerce-mini-cart__buttons a.checkout {
    background: var(--primary-color);
    color: #fff;
}
.woocommerce-mini-cart__empty-message {
    padding: 30px 20px;
    text-align: center;
    color: #888;
    font-size: 15px;
}

/* 9. WooCommerce Login & Register Page Styling */
.woocommerce-account .woocommerce-MyAccount-content,
.woocommerce-account .woocommerce-MyAccount-navigation {
    margin-bottom: 40px;
}
#customer_login {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
}

/* Fix Bootstrap col-1 and col-2 conflicting with WooCommerce globally */
.woocommerce .col2-set {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.woocommerce .col2-set .col-1,
.woocommerce .col2-set .col-2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 0 !important; /* Forces them to split 50/50 if there's room */
    min-width: 300px;
    float: none !important;
}

/* Style for Login/Register blocks specifically */
#customer_login .u-column1,
#customer_login .u-column2 {
    max-width: 450px !important;
    background: #fff;
    padding: 35px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #f1f1f1;
}
#customer_login h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    color: #111;
}
.woocommerce-form-login,
.woocommerce-form-register {
    width: 100% !important;
}
.woocommerce-form-login .woocommerce-form-row,
.woocommerce-form-register .woocommerce-form-row {
    margin-bottom: 20px;
}
.woocommerce-form-login label,
.woocommerce-form-register label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #333;
}
.woocommerce-form-login .woocommerce-Input,
.woocommerce-form-register .woocommerce-Input {
    width: 100%;
    border: 1px solid #e0e0e0;
    height: 50px;
    padding: 0 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.woocommerce-form-login .woocommerce-Input:focus,
.woocommerce-form-register .woocommerce-Input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1,95,204,0.25);
    outline: none;
}
.woocommerce-form-login .woocommerce-button,
.woocommerce-form-register .woocommerce-button,
.woocommerce-form-login .woocommerce-Button,
.woocommerce-form-register .woocommerce-Button,
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content input.button {
    width: 100%;
    background: var(--primary-color) !important;
    color: #fff !important;
    border: none;
    height: 50px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content input.button {
    width: auto;
    padding: 0 30px;
    display: inline-flex;
}
.woocommerce-form-login .woocommerce-Button:hover,
.woocommerce-form-register .woocommerce-Button:hover,
.woocommerce-MyAccount-content button.button:hover,
.woocommerce-MyAccount-content input.button:hover {
    background: var(--secondary-color, #014bad) !important;
}

/* Links and Anchor Buttons in My Account Content */
.woocommerce-MyAccount-content a {
    color: #014bad;
    font-weight: 500;
    transition: all 0.3s ease;
}
.woocommerce-MyAccount-content a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
/* Info message buttons (like "Duyệt sản phẩm" in Orders & Downloads) - just text link */
body.woocommerce-downloads .woocommerce-info a.button,
body.woocommerce-downloads .woocommerce-message a.button,
body.woocommerce-orders .woocommerce-info a.button,
body.woocommerce-orders .woocommerce-message a.button,
.woocommerce-info a.button,
.woocommerce-message a.button {
    background: transparent !important;
    color: #014bad !important;
    padding: 0 !important;
    border: none !important;
    font-weight: 600;
    text-decoration: underline;
    display: inline;
}
body.woocommerce-downloads .woocommerce-info a.button:hover,
body.woocommerce-downloads .woocommerce-message a.button:hover,
body.woocommerce-orders .woocommerce-info a.button:hover,
body.woocommerce-orders .woocommerce-message a.button:hover,
.woocommerce-info a.button:hover,
.woocommerce-message a.button:hover {
    background: transparent !important;
    color: var(--primary-color) !important;
    text-decoration: underline;
}
.woocommerce-form-login .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    margin-bottom: 0;
}
.woocommerce-form-login .lost_password {
    text-align: center;
    margin-top: 15px;
}
.woocommerce-form-login .lost_password a {
    color: #666;
    text-decoration: underline;
}

/* My Account Navigation */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 8px;
    margin: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}
.woocommerce-MyAccount-navigation ul li {
    margin-bottom: 4px;
    border: none;
}
.woocommerce-MyAccount-navigation ul li:last-child {
    margin-bottom: 0;
}
.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 12px 16px;
    border-radius: 6px;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* My Account Layout for logged in */
@media (min-width: 768px) {
    .woocommerce-account .woocommerce {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
        align-items: flex-start;
    }
    .woocommerce-account .woocommerce-MyAccount-navigation {
        flex: 0 0 260px;
        width: 260px;
        margin: 0;
        float: none;
    }
    .woocommerce-account .woocommerce-MyAccount-content {
        flex: 1 1 0;
        width: auto;
        float: none;
    }
}

/* Hero Slider Navigation Arrows */
.tp-slider-area .tp-slider-arrow button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #051a36;
    color: #fff;
    border: none;
    z-index: 99;
    display: flex !important; /* Force show even if swiper-button-lock is applied */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none; /* Prevent clicks when invisible */
    transition: opacity 0.3s ease-out 5s, background-color 0.3s ease;
}
.tp-slider-area:hover .tp-slider-arrow button {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease-in 0s, background-color 0.3s ease;
}
.tp-slider-area .tp-slider-arrow button:hover {
    background-color: #0b3469;
}
.tp-slider-area .tp-slider-button-prev { left: 10px; }
.tp-slider-area .tp-slider-button-next { right: 10px; }

/* Centering the SVG icon inside the button */
.tp-slider-area .tp-slider-button-prev svg {
    transform: translateX(-2px);
}
.tp-slider-area .tp-slider-button-next svg {
    transform: translateX(1px);
}

/* Fix sticky header menu text color */
.tp-header-sticky-area .main-menu > nav > ul > li > a {
    color: #010f1c !important;
}
.tp-header-sticky-area .main-menu > nav > ul > li:hover > a,
.tp-header-sticky-area .main-menu > nav > ul > li.current-menu-item > a {
    color: #1E79E7 !important;
}

/* Fix global button text colors on blue backgrounds */
.tp-btn,
.tp-btn-2,
.tp-btn-border-2,
.tp-btn-3,
.button.alt,
.checkout-button,
.cartmini-checkout-btn,
.tp-checkout-btn,
.tp-cart-checkout-btn,
button[type="submit"] {
    color: #ffffff !important;
}

/* Exception for the slider shop button which has a white background */
.tp-slider-shop-btn {
    color: #FF3A2D !important;
}
.tp-slider-shop-btn:hover {
    color: #ffffff !important;
}


/* Product Action Icons Customizations */
.tp-product-action-btn:hover { 
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important; 
}
.tp-product-action-btn:hover svg { color: #fff !important; }
@media (max-width: 991px) { .tp-product-action { display: none !important; } }

/* Lower the action buttons and position at bottom right */
.tp-product-action {
    top: auto !important;
    bottom: 30px !important;
}

/* Force square 1:1 aspect ratio for product images */
.tp-product-thumb a {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.tp-product-thumb a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Mini Cart Sidebar Styles */
.cartmini__area{position:fixed;top:0;right:-450px;width:420px;max-width:100%;height:100%;z-index:9999;background:#fff;box-shadow:-5px 0 25px rgba(0,0,0,.1);transition:right .3s ease}
.cartmini__area.cartmini-opened{right:0}
.cartmini__wrapper{height:100%;display:flex;flex-direction:column}
.cartmini__top-wrapper{display:flex;flex-direction:column;height:100%}
.cartmini__top{flex-shrink:0;display:flex;justify-content:space-between;align-items:center;padding:20px 25px;border-bottom:1px solid #eee}
.cartmini__top-title h4{margin:0;font-size:18px;font-weight:600}
.cartmini__close-btn{background:none;border:none;cursor:pointer;padding:5px;color:#333}

.widget_shopping_cart_content{flex:1;display:flex;flex-direction:column;overflow:hidden}
.cartmini__shipping{flex:1;overflow-y:auto;scrollbar-width:none}
.cartmini__shipping::-webkit-scrollbar{display:none}
.cartmini__checkout{flex-shrink:0;padding:20px 25px;border-top:1px solid #eee;background:#fff}

.cartmini__widget-list{padding:0 25px}
.cartmini__widget-item{display:flex;gap:15px;padding:20px 0;border-bottom:1px solid #f0f0f0;position:relative}
.cartmini__thumb{flex-shrink:0;width:70px;height:70px;border:1px solid #eee;border-radius:6px;overflow:hidden}
.cartmini__thumb img{width:100%;height:100%;object-fit:cover}
.cartmini__content{flex:1;min-width:0}
.cartmini__title{font-size:14px;font-weight:500;margin:0 25px 8px 0;line-height:1.4}
.cartmini__title a{color:#333;text-decoration:none}
.cartmini__title a:hover{color:var(--primary-color)}

.cartmini__del{position:absolute;top:20px;right:0;width:22px;height:22px;display:flex;align-items:center;justify-content:center;font-size:18px;color:#999;text-decoration:none;border-radius:50%;transition:all .2s}
.cartmini__del:hover{color:#e00;background:#fef0f0}

.cartmini__qty{margin-bottom:8px}
.cartmini__qty-input{display:inline-flex;align-items:center;border:1px solid #ddd;border-radius:4px;overflow:hidden}
.cartmini-qty-btn{width:32px;height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;background:#f8f8f8;color:#333;user-select:none;transition:background .15s}
.cartmini-qty-btn:hover{background:#eee}
.cartmini-qty-value{width:36px;height:30px;text-align:center;border:none;border-left:1px solid #ddd;border-right:1px solid #ddd;font-size:14px;font-weight:500;background:#fff;outline:none}

.cartmini__price{font-size:14px;font-weight:600;color:var(--primary-color)}
.cartmini__price del{color:#666;font-weight:400;font-size:12px;margin-left:5px}

.cartmini__checkout-title{font-size:15px;margin-bottom:8px;color:#333}
.cartmini__checkout-btn{margin-top:12px}
.cartmini__checkout-btn .tp-btn{display:block;padding:14px 20px;background:var(--primary-color);color:#fff !important;border-radius:6px;font-size:15px;font-weight:600;text-decoration:none;text-align:center;transition:background .2s}
.cartmini__checkout-btn .tp-btn:hover{opacity:.9}
.cartmini__checkout-btn .tp-btn-border{background:#fff !important;color:#333 !important;border:2px solid #ddd}
.cartmini__checkout-btn .tp-btn-border:hover{border-color:var(--primary-color);color:var(--primary-color) !important}

.cartmini__empty .tp-btn{display:inline-block;padding:10px 25px;background:var(--primary-color);color:#fff !important;border-radius:6px;text-decoration:none}

@media(max-width:575px){.cartmini__area{width:100%;right:-100%}}

/* Quick View Modal Styles */
.tp-product-modal .modal-dialog { --bs-modal-width: 1200px; max-width: 1200px; margin-top: 5vh; }
@media only screen and (min-width: 1200px) and (max-width: 1399px) { .tp-product-modal .modal-dialog { --bs-modal-width: 1000px; max-width: 1000px; } }
@media only screen and (min-width: 992px) and (max-width: 1199px) { .tp-product-modal .modal-dialog { --bs-modal-width: 850px; max-width: 850px; } }
.tp-product-modal-content { position: relative; background: #fff; border-radius: 10px; overflow: hidden; padding: 20px; }
.tp-product-modal-close-btn { 
    background-color: var(--tp-common-white); 
    color: #333;
    font-size: 25px; 
    height: 40px; 
    right: 15px; 
    position: absolute; 
    top: 15px; 
    width: 40px; 
    border-radius: 50%;
    z-index: 100;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.tp-product-modal-close-btn:hover { background-color: #eee; }

/* Fix Quick View Image Layout */
#product-quick-view-modal .woocommerce-product-gallery { opacity: 1 !important; transition: none !important; margin: 0; padding: 0; display: block; }
#product-quick-view-modal .woocommerce-product-gallery figure { margin: 0; }
#product-quick-view-modal .woocommerce-product-gallery__wrapper { display: flex; overflow: hidden; }
#product-quick-view-modal .woocommerce-product-gallery__image { flex: 0 0 100%; max-width: 100%; }
#product-quick-view-modal .woocommerce-product-gallery__image img { width: 100%; height: auto; object-fit: contain; max-height: 600px; margin: 0 auto; display: block; }

/* PC Cart and Checkout Layout Fixes */
.woocommerce-cart .cart-collaterals,
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
    float: none !important;
    width: 100% !important;
}
.woocommerce form .form-row {
    float: none !important;
    width: 100% !important;
    margin-bottom: 20px;
}
.woocommerce-checkout #customer_details {
    display: flex !important;
    flex-direction: column !important;
    gap: 30px;
}
.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
}

/* Fix Cart Actions Layout (Coupon and Update Cart) */
.woocommerce-cart table.cart td.actions {
    padding: 20px 0;
    border-bottom: none;
}
.woocommerce-cart table.cart td.actions .coupon {
    display: inline-flex;
    align-items: stretch;
    gap: 10px;
    float: left;
    width: auto;
    max-width: 100%;
}
.woocommerce-cart table.cart td.actions .coupon .input-text {
    width: 250px;
    max-width: 100%;
    margin: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0 15px;
}
.woocommerce-cart table.cart td.actions .button {
    float: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    margin: 0;
    white-space: nowrap;
    background-color: var(--tp-theme-primary);
    color: #fff;
    border-radius: 4px;
    padding: 0 25px;
    font-weight: 500;
    border: none;
    transition: all 0.3s;
}
.woocommerce-cart table.cart td.actions .button:hover {
    background-color: var(--tp-heading-primary);
    color: #fff;
}
.woocommerce-cart table.cart td.actions > .button[name="update_cart"] {
    display: none !important; /* HIDE UPDATE CART BUTTON */
}

/* Premium Cart Table Styling */
.woocommerce table.shop_table {
    border: none;
    border-radius: 0;
}
.woocommerce table.shop_table th {
    background: #fff;
    border: none;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 600;
    padding: 15px 20px;
    color: #333;
    text-align: left;
}
.woocommerce table.shop_table td {
    border-top: none;
    border-bottom: 1px solid #eee;
    padding: 20px;
    vertical-align: middle;
    background: #fff;
}
.woocommerce table.shop_table td.product-remove a.remove {
    color: #999;
    font-size: 16px;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f5f5f5;
    text-decoration: none;
    transition: all 0.3s;
}
.woocommerce table.shop_table td.product-remove a.remove:hover {
    color: #fff;
    background: red;
}
.woocommerce table.shop_table td.product-thumbnail img {
    width: 80px;
    border-radius: 4px;
    border: none;
}
.woocommerce table.shop_table td.product-name a {
    color: #333;
    font-weight: 500;
    font-size: 15px;
}
.woocommerce table.shop_table td.product-name a:hover {
    color: var(--tp-theme-primary);
}
.woocommerce table.shop_table td.product-price, 
.woocommerce table.shop_table td.product-subtotal {
    font-weight: 600;
    color: var(--accent-color, #e8000d);
}

@media (max-width: 575px) {
    .woocommerce-cart table.cart td.actions .coupon {
        width: 100%;
        flex-direction: column;
        margin-bottom: 15px;
    }
    .woocommerce-cart table.cart td.actions .coupon .input-text {
        width: 100%;
        height: 46px;
    }
}

@media (min-width: 992px) {
    /* Cart Page Two-Column Layout */
    .woocommerce-cart .woocommerce {
        display: flex;
        flex-wrap: nowrap;
        gap: 40px;
        align-items: flex-start;
    }
    .woocommerce-cart .woocommerce:after,
    .woocommerce-cart .woocommerce:before {
        display: none !important;
    }
    .woocommerce-cart .woocommerce-cart-form {
        flex: 0 0 65% !important;
        max-width: 65% !important;
    }
    .woocommerce-cart .cart-collaterals {
        flex: 0 0 calc(35% - 40px) !important;
        max-width: calc(35% - 40px) !important;
        position: sticky;
        top: 20px;
        background: #f9f9f9;
        padding: 30px;
        border-radius: 8px;
    }
    .woocommerce-cart .cart-empty-wrapper {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Checkout Page Two-Column Layout */
    form.woocommerce-checkout {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 40px !important;
        align-items: flex-start !important;
    }
    form.woocommerce-checkout::before,
    form.woocommerce-checkout::after {
        display: none !important;
    }
    form.woocommerce-checkout #customer_details {
        flex: 0 0 60% !important;
        max-width: 60% !important;
        width: 60% !important;
    }
    form.woocommerce-checkout #order_review_heading {
        display: none !important;
    }
    form.woocommerce-checkout #order_review {
        flex: 0 0 calc(40% - 40px) !important;
        max-width: calc(40% - 40px) !important;
        width: calc(40% - 40px) !important;
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 130px !important;
        background: #fff;
        padding: 30px;
        border-radius: 8px;
        border: 1px solid #eaeaea;
        box-shadow: 0 5px 20px rgba(0,0,0,0.03);
        margin-bottom: 30px;
        z-index: 10;
    }

/* FORCE sticky parents to allow sticky behavior */
html, body, .tp-main-wrapper, main, .tp-checkout-area, .woocommerce {
    overflow: visible !important;
    overflow-x: clip !important;
}
    form.woocommerce-checkout #order_review::before {
        content: "Chi tiết đơn hàng";
        display: block;
        font-size: 20px;
        font-weight: 600;
        color: var(--tp-heading-primary);
        margin-bottom: 25px;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
        text-transform: uppercase;
    }
}
@media (max-width: 991px) {
    .woocommerce-cart .cart-collaterals,
    .woocommerce-checkout #order_review {
        margin-top: 40px;
        background: #fff;
        padding: 20px;
        border-radius: 8px;
        border: 1px solid #eaeaea;
        box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    }
}

/* Checkout Coupon Form Style */
.woocommerce-form-coupon {
    display: flex !important;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px !important;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}
.woocommerce-form-coupon p {
    width: 100%;
    margin-bottom: 0 !important;
}
.woocommerce-form-coupon p.form-row-first {
    flex: 1;
    width: auto;
}
.woocommerce-form-coupon p.form-row-last {
    width: auto;
}
.woocommerce-form-coupon .button {
    background: var(--tp-theme-primary);
    color: #fff;
    border: none;
    padding: 0 25px;
    height: 54px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    line-height: 54px;
}
.woocommerce-form-coupon .button:hover {
    background: var(--tp-heading-primary);
}
.woocommerce-form-coupon .input-text {
    height: 54px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 15px;
    width: 100%;
}

/* Shofy Style Buttons inside Cart/Checkout */
.woocommerce-cart .cart-collaterals .checkout-button,
.woocommerce-checkout #place_order {
    background-color: var(--tp-theme-primary);
    color: #fff;
    border-radius: 4px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    text-align: center;
    border: none;
    transition: all 0.3s;
    margin-top: 20px;
}
.woocommerce-cart .cart-collaterals .checkout-button:hover,
.woocommerce-checkout #place_order:hover {
    background-color: var(--tp-heading-primary);
}

/* Fix Floating Phone Icon Color (Increase specificity to preserve animation without !important) */
#gom-all-in-one #phone-vr .phone-vr-circle-fill {
    box-shadow: 0 0 0 0 #4caf50;
    background-color: rgba(76, 175, 80, 0.7) !important;
}
#gom-all-in-one #phone-vr .phone-vr-img-circle {
    background-color: #4caf50 !important;
}
#gom-all-in-one #zalo-vr .phone-vr-circle-fill {
    box-shadow: 0 0 0 0 #0088ff;
    background-color: rgba(0, 136, 255, 0.7) !important;
}
#gom-all-in-one #zalo-vr .phone-vr-img-circle {
    background-color: #0088ff !important;
}

/* WooCommerce Notices as Toast Popups */
.woocommerce-notices-wrapper {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}
.woocommerce-notices-wrapper .woocommerce-message, 
.woocommerce-notices-wrapper .woocommerce-error, 
.woocommerce-notices-wrapper .woocommerce-info {
    pointer-events: auto;
    background: #fff !important;
    border: none !important;
    border-left: 4px solid #28a745 !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15) !important;
    padding: 16px 24px !important;
    border-radius: 6px !important;
    margin: 0 !important;
    width: 380px;
    max-width: calc(100vw - 40px);
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    position: relative;
    animation: slideInRightToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    list-style: none;
    outline: none !important;
}
.woocommerce-notices-wrapper .woocommerce-message:hover, 
.woocommerce-notices-wrapper .woocommerce-error:hover, 
.woocommerce-notices-wrapper .woocommerce-info:hover {
    border: none !important;
    border-left: 4px solid #28a745 !important;
    background: #fff !important;
    color: #333 !important;
}
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-error:hover {
    border-left-color: #e8000d !important;
}
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-info:hover {
    border-left-color: #0068ff !important;
}
/* Ensure ul lists inside error notices look clean */
.woocommerce-notices-wrapper ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.woocommerce-notices-wrapper ul li {
    margin-bottom: 5px;
}
.woocommerce-notices-wrapper ul li:last-child {
    margin-bottom: 0;
}
.woocommerce-notices-wrapper .woocommerce-message .button,
.woocommerce-notices-wrapper .woocommerce-error .button,
.woocommerce-notices-wrapper .woocommerce-info .button {
    float: right;
    margin-left: 15px;
    background: #f0f0f0;
    color: #333;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}
.woocommerce-notices-wrapper .woocommerce-message .button:hover,
.woocommerce-notices-wrapper .woocommerce-error .button:hover,
.woocommerce-notices-wrapper .woocommerce-info .button:hover {
    background: #e0e0e0;
}
/* Toast fade out animation */
@keyframes slideInRightToast {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRightToast {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}
.wc-notice-hiding {
    animation: slideOutRightToast 0.4s ease-in forwards !important;
}

/* ==========================================================================
   PRODUCT THUMBNAILS SLIDER FIX
   ========================================================================== */
.wc-thumbs-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 15px;
    width: 100%;
}
.woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding: 5px 0 !important;
    scrollbar-width: none; /* Hide scrollbar for cleaner look with arrows */
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 0 !important;
}
.woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
    display: none;
}
.woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 calc(25% - 11.25px) !important; /* 4 items per view */
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    scroll-snap-align: start;
    cursor: pointer;
}
@media (max-width: 768px) {
    .woocommerce-product-gallery .flex-control-thumbs li {
        flex: 0 0 calc(25% - 11.25px) !important; /* Keep 4 on mobile, or could be 30% */
    }
}

/* Thumbnail Navigation Arrows */
.wc-thumb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: #333;
    transition: all 0.3s ease;
}
.wc-thumb-nav-btn:hover {
    background: #0a2856;
    color: #fff;
    border-color: #0a2856;
}
.wc-thumb-nav-btn.prev {
    left: -15px;
}
.wc-thumb-nav-btn.next {
    right: -15px;
}
.wc-thumb-nav-btn.disabled {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
}

/* Failsafe for stuck PhotoSwipe */
.pswp:not(.pswp--open) {
    display: none !important;
}
.pswp.pswp--open .pswp__bg {
    opacity: 0.8 !important; /* Ensure bg is visible when open */
}

/* ==========================================================================
   PRODUCT MAIN IMAGE ASPECT RATIO (MOBILE FIX)
   ========================================================================== */
@media (max-width: 768px) {
    .woocommerce-product-gallery__image, 
    .woocommerce-product-gallery__image a {
        display: block;
        width: 100%;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        background: #fff;
    }
    .woocommerce-product-gallery__image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        margin: 0 auto;
    }
}

/* Wishlist Active State */
.snd-wishlist-btn.active {
    color: var(--accent-color, #e8000d) !important;
}
.snd-wishlist-btn.active svg {
    fill: currentColor !important;
    color: var(--accent-color, #e8000d) !important;
}

/* Prevent background scroll when cart or offcanvas is open */
body.offcanvas-overlay,
body.cartmini-opened {
    overflow: hidden !important;
}

/* Fix Category Menu Submenu Positioning & Transition Overlap */
.tp-category-menu-content,
.tp-category-menu-content > ul {
    border-radius: 0 0 10px 10px !important;
}
.tp-category-menu-content > ul > li:last-child,
.tp-category-menu-content > ul > li:last-child > a {
    border-radius: 0 0 10px 10px !important;
}
.tp-category-menu-content > ul > li { 
    position: relative !important; 
}
.tp-category-menu-content ul li .tp-submenu { 
    top: 0 !important; 
    left: 100% !important; /* Đặt sát mép chuẩn, không lồng vào nhau */
    margin-left: 0 !important;
    border-radius: 10px !important; /* Bo 4 góc của khung danh mục con */
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    transform: none !important; /* Tắt hoàn toàn hiệu ứng dịch chuyển của theme gốc */
    transition: opacity 0.1s ease-in-out, visibility 0.1s ease-in-out !important; 
    transition-delay: 0s !important; /* Biến mất nhanh nhưng vẫn có hiệu ứng */
    z-index: 999 !important;
}

/* Fix product description images stretching on mobile */
.woocommerce-Tabs-panel--description img,
.woocommerce-product-details__short-description img,
#tab-description img,
.tp-product-details-desc img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
}

.tp-category-menu-content ul li:hover .tp-submenu {
    transform: none !important; /* Đảm bảo khung đứng yên tuyệt đối */
    transition: opacity 0.1s ease-in-out, visibility 0.1s ease-in-out !important; 
    transition-delay: 0s !important; /* Hiện ra cực nhanh */
}

/* ==========================================================================
   LIVE SEARCH DROPDOWN
   ========================================================================== */

/* Wrapper form không cần position relative nữa */
.bb-form-quick-search.tp-header-search {
    /* position handled by wrapper */
}

/* Wrapper bên trong — đây là parent trực tiếp của dropdown */
.tp-header-search-wrapper {
    position: relative !important;
    overflow: visible !important; /* Override bất kỳ overflow:hidden nào từ theme */
}

/* Dropdown container — position được set bởi JS (fixed) */
.bb-quick-search-results {
    display: none;
    z-index: 99999;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    border: 1px solid #e8eaf0;
    overflow: hidden;
    max-height: 500px;
    overflow-y: auto;
    /* Scrollbar mỏng kiểu Chrome */
    scrollbar-width: thin;
    scrollbar-color: #d0d7e3 #f5f7fa;
}
.bb-quick-search-results::-webkit-scrollbar { width: 5px; }
.bb-quick-search-results::-webkit-scrollbar-track { background: #f5f7fa; }
.bb-quick-search-results::-webkit-scrollbar-thumb { background: #c8d0de; border-radius: 10px; }

/* Header số kết quả */
.snd-search-header {
    padding: 10px 16px 8px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
    letter-spacing: .3px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafbfc;
}

/* Danh sách sản phẩm */
.search-results-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Từng item */
.search-results-list li {
    border-bottom: 1px solid #f3f4f6;
}
.search-results-list li:last-child {
    border-bottom: none;
}

/* Link trong item */
.snd-search-item-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 11px 16px !important;
    text-decoration: none !important;
    color: #1a1a2e !important;
    transition: background 0.15s ease !important;
    outline: none;
}
.snd-search-item-link:hover,
.snd-search-item-link.is-active {
    background: #f0f5ff !important;
}

/* Thumbnail */
.snd-search-item-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid #e8eaf0;
    flex-shrink: 0;
    background: #f8f9fb;
}

/* Nội dung text */
.snd-search-item-body {
    flex: 1;
    min-width: 0;
}

/* Tên sản phẩm */
.snd-search-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Danh mục */
.snd-search-item-cat {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    display: block;
}

/* Giá */
.snd-search-item-price {
    font-size: 13px;
    font-weight: 700;
    color: #e8000d;
    line-height: 1;
}
.snd-search-item-price del {
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
    margin-left: 5px;
}

/* Highlight từ khóa */
.snd-search-item-title mark {
    background: #fff3cd;
    color: #b35900;
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 700;
    font-style: normal;
}

/* "Xem tất cả kết quả" link */
.snd-search-view-all {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color, #0f3475) !important;
    background: #f4f7ff;
    text-decoration: none !important;
    border-top: 1px solid #e8edf5;
    transition: background 0.15s ease;
    letter-spacing: .2px;
}
.snd-search-view-all:hover {
    background: #e6edff;
    color: var(--primary-color, #0f3475) !important;
}
.snd-search-view-all svg {
    vertical-align: middle;
    margin-left: 4px;
}

/* Trạng thái loading */
.snd-search-loading {
    padding: 20px 16px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}
.snd-search-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--primary-color, #0f3475);
    border-radius: 50%;
    animation: snd-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes snd-spin { to { transform: rotate(360deg); } }

/* Trạng thái không có kết quả */
.snd-search-empty {
    padding: 20px 16px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}

/* Mobile: giảm thumbnail + padding */
@media (max-width: 767px) {
    .bb-quick-search-results {
        border-radius: 0 0 10px 10px;
        max-height: 380px;
    }
    .snd-search-item-thumb {
        width: 42px;
        height: 42px;
    }
    .snd-search-item-link {
        padding: 9px 12px !important;
        gap: 10px !important;
    }
    .snd-search-item-title {
        font-size: 12.5px;
    }
}


