
/* ==========================================================================
   CUSTOM CSS OVERRIDE - Main Theme
   ========================================================================== */

/* ==========================================================================
   1. GLOBAL / BASE STYLES
   ========================================================================== */

/* ⚠️ ĐÃ XÓA: .ajax_add_to_cart { display: none !important; }
   Rule này gây conflict với nút trong .price-button-wrapp
   Thay bằng rule chính xác hơn ở dưới */

.fixed-filter-terms {
    box-shadow:
        rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,
        rgba(0, 0, 0, 0.06) 0px 2px 4px -1px !important;
}

.price-button-wrapp .button.product_type_simple.add_to_cart_button.ajax_add_to_cart {
    display: none;
}

.et-product-search-toggle.sticky-active .search-box,
.et-product-search-toggle.sticky-active .filter-box {
    z-index: 70 !important;
}

body.home .et-product-search-toggle.sticky-active {
    top: 0px !important;
}

.product-vehicle-filter .last {
    display: none !important;
}

.product-vehicle-filter .atts {
    width: 100% !important;
}

/* ==========================================================================
   2. SWIPER / STICKY CATEGORIES
   ========================================================================== */

.swiper-container.loop-categories-container.sticky-active .swiper-button.swiper-button-next.loop-categories-next {
    right: 0px !important;
}

.swiper-container.loop-categories-container.sticky-active .swiper-button.swiper-button-prev.loop-categories-prev {
    right: 20px !important;
}

.swiper-container.loop-categories-container.sticky-active .swiper-button {
    top: 0px !important;
}

/* ==========================================================================
   3. FK CART
   ========================================================================== */

.fkcart-shortcode-container {
    color: #ffffff;
}

.fkcart-shortcode-container .fkcart-shortcode-icon-wrap svg.fkcart-icon-checkout {
    width: 25px;
}

.fkcart-shortcode-container .fkcart-shortcode-count {
    top: -11px;
    background-color: #ffc72c;
    color: #000;
}

/* ==========================================================================
   4. CATEGORY IMAGES
   ========================================================================== */

.terms_category .et-terms.simple .terms-item img {
    object-fit: contain !important;
}

ul.loop-categories .category-item a img {
    object-fit: contain;
    width: 80%;
}

ul.loop-categories .category-item .image-container {
    width: 66px;
    height: 66px;
}

ul.loop-categories .vehicle-image-slide .image-container {
    width: 160px !important;
    height: 125px !important;
    max-width: 120px !important;
    margin-right: 0 !important;
    background-color: transparent !important;
    border: none !important;
}

ul.loop-categories .vehicle-image-slide .image-container img {
    width: 120px !important;
    height: 130px !important;
    max-width: 160px !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 6px !important;
}

.vehicle-image-slide {
    flex-shrink: 0;
}

.vehicle-image-slide .vehicle-slide-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: default;
}

/* ==========================================================================
   5. PRODUCT LOOP
   ========================================================================== */

.loop-products .image-container.en-quick-view {
    display: flex;
}

/* Elementor vehicle filter styling */
.elementor-435 .elementor-element.elementor-element-196cf23 > .elementor-widget-container .product-vehicle-filter {
    color: #000000;
    background-color: #ffc72c;
    padding: 10px;
}

/* 4-column grid on desktop */
@media (min-width: 1200px) {
    ul.loop-products.products.nav-infinite {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

ul.loop-products.products.nav-infinite > li.product {
    width: 100% !important;
    margin: 0 !important;
}

/* ==========================================================================
   6. PRODUCT CARD - POST BODY
   ========================================================================== */

.post-body-inner {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1200px) {
    /* Desktop ordering */
    .price-button-wrapp  { order: 1; }
    .product-availability { order: 2; position: static !important; }
    .product-sku          { order: 3; position: static !important; }
    .product-features-list { order: 4; }

    /* Remove absolute positioning */
    .product-sku,
    .product-availability,
    .price-button-wrapp {
        position: static !important;
    }

    #loop-products .product .post-inner {
        display: block !important;
    }

    .post-body-inner .product-sku            { order: 1; }
    .post-body-inner .check-price            { order: 2; }
    .post-body-inner .product-features-list  { order: 3; }

    .post-title.en-quick-view {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
}

.product-sku {
    margin: 0px !important;
    padding-top: 10px;
}

.product-availability {
    margin: 0 !important;
    padding-bottom: 10px;
}

.check-price {
    margin: 0 !important;
    padding-bottom: 5px;
}

/* Reset theme button/link overrides */
.product .post-body .button,
.product .post-body .added_to_cart,
.post-read-more {
    margin: 0 !important;
    background-color: transparent !important;
    position: static !important;
}

/* ==========================================================================
   7. PRODUCT FEATURES LIST
   ========================================================================== */

.product-features-list li:not(:first-child) {
    font-size: 14px;
    font-weight: 700;
}

/* Truncated "fits" content */
.product-features-list li:first-child .fits-content {
    display: block;
    max-height: 4.5em;
    overflow: hidden;
    line-height: 1.5em;
}

.product-features-list li:first-child.truncated {
    cursor: pointer;
}

.product-features-list li:first-child.expanded .fits-content {
    max-height: none;
}

.product-features-list li:first-child .fits-more-btn {
    display: inline;
}

.product-features-list li:first-child.expanded .fits-more-btn {
    display: none !important;
}

/* ==========================================================================
   8. PRICE + ADD TO CART BUTTON
   ========================================================================== */

/* --- Layout wrapper --- */
.price-button-wrapp {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    flex-wrap: nowrap !important;
}

.price-button-wrapp .price,
.price-button-wrapp .add_to_cart_button {
    display: inline-flex !important;
    width: auto !important;
    float: none !important;
}

/* --- Price reset --- */
.price-button-wrapp .price {
    font-weight: 700 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: normal !important;
}

/* --- Add to cart button (DESKTOP) --- */
/* ✅ SỬA: width 80px → 110px | height 25px → 28px | font-size giữ nguyên 9px */
.price-button-wrapp .add_to_cart_button {
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    background: linear-gradient(135deg, #e63312, #c4290e) !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    width: 110px !important;
    height: 28px !important;
    border-radius: 20px !important;
    border: none !important;
    white-space: nowrap !important;
    float: none !important;
    margin: 0 !important;
    position: static !important;
    flex-shrink: 0 !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
}

/* --- Cart icon (::before) --- */
.price-button-wrapp .add_to_cart_button::before {
    content: "" !important;
    display: inline-block !important;
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
    background-color: white !important;
    background-image: none !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59L5.25 14c-.16.28-.25.61-.25.96C5 16.1 5.9 17 7 17h15v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12L8.1 13h9.45c.75 0 1.41-.41 1.75-1.03L22.76 5H5.21L4.27 2H1zm6 16c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E") center/contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59L5.25 14c-.16.28-.25.61-.25.96C5 16.1 5.9 17 7 17h15v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12L8.1 13h9.45c.75 0 1.41-.41 1.75-1.03L22.76 5H5.21L4.27 2H1zm6 16c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E") center/contain no-repeat !important;
    font-size: 0 !important;
}

.price-button-wrapp .add_to_cart_button::after {
    display: none !important;
}

/* --- Hover state --- */
.price-button-wrapp .add_to_cart_button:hover {
    background: linear-gradient(135deg, #ff4520, #e63312) !important;
    color: #fff !important;
    box-shadow: 0 5px 14px rgba(230, 51, 18, 0.5) !important;
    transform: translateY(-1px) !important;
}

/* --- Active state --- */
.price-button-wrapp .add_to_cart_button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(230, 51, 18, 0.3) !important;
}

/* --- Show/hide nút theo SKU ---
   ✅ SỬA: Bỏ rule ẩn toàn bộ .ajax_add_to_cart ở Section 1,
   chỉ dùng 2 rule này để kiểm soát hiển thị trong price-button-wrapp */
.price-button-wrapp .button.product_type_simple.add_to_cart_button {
    display: none !important;
}

.post-body-inner:has(.product-sku) .price-button-wrapp .button.product_type_simple.add_to_cart_button {
    display: inline-flex !important;
}

/* ==========================================================================
   9. RESPONSIVE - STICKY DASHBOARD
   ========================================================================== */

@media only screen and (max-width: 1279.98px) {
    .sticky-dashboard {
        display: none;
    }
}

@media only screen and (max-width: 787px) {
    .sticky-dashboard {
        display: flex !important;
    }
}

/* ==========================================================================
   10. RESPONSIVE - TABLET (max-width: 991px)
   ========================================================================== */

@media only screen and (max-width: 991px) {
    .product-layout.grid.grid-active {
        padding-top: 165px;
    }
}

/* ==========================================================================
   11. RESPONSIVE - MOBILE (max-width: 767px / 768px)
   ========================================================================== */

@media (max-width: 767px) {
    /* Vehicle filter layout */
    .product-vehicle-filter .atts {
        display: flex !important;
        gap: 6px;
        width: 100%;
    }

    .product-vehicle-filter .atts .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    .product-vehicle-filter .atts .vf-item.year  { flex: 0 0 75px !important; }
    .product-vehicle-filter .atts .vf-item.make  { flex: 1 1 0% !important; }
    .product-vehicle-filter .atts .vf-item.model { flex: 2 1 0% !important; }

    .product-vehicle-filter.vehicle-filter {
        justify-content: flex-start !important;
    }

    .select2-dropdown {
        max-width: 95vw !important;
    }

    .select2-results__options {
        max-height: 300px;
        overflow-y: auto;
    }

    /* Terms category positioning */
    .terms_category {
        --e-transform-translateY: 0 !important;
    }

    .terms_category.fixed-filter-terms {
        top: 50px !important;
    }

    /* Sticky categories wrapper */
    .loop-categories-container.sticky-active .loop-categories-wrapper {
        height: 130px !important;
        padding-top: 20px !important;
        padding-left: 10px !important;
    }

    /* Price */
    .price-button-wrapp .price {
        font-size: inherit !important;
        padding-top: 0 !important;
        line-height: normal !important;
    }

    /* Post image layout */
    .product-layout .post-image {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }

    .post-image .price-button-wrapp {
        position: static !important;
        left: auto !important;
        bottom: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
        width: 100% !important;
    }

    .post-image .product-availability {
        position: static !important;
        left: auto !important;
        bottom: auto !important;
        font-size: 10px !important;
        margin: 0 !important;
        writing-mode: horizontal-tb !important;
    }

    .post-image .check-price {
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Product card min-height */
    li.product .product-features-list ~ *,
    li.product:has(.product-features-list) .post-inner {
        min-height: 260px;
    }

    /* Check price absolute position */
    .check-price {
        position: absolute;
        left: 10px;
        top: 225px;
    }

    /* Smaller feature list text */
    .product-features-list li:not(:first-child) {
        font-size: 10px !important;
    }

    /* Category swiper item */
    .category-item.swiper-slide {
        width: 50px !important;
        margin-right: 40px !important;
    }

    /* ✅ SỬA: icon tăng từ 8px → 10px cho cân với nút lớn hơn */
    .price-button-wrapp .add_to_cart_button::before {
        width: 10px !important;
        height: 10px !important;
    }

    /* Price font */
    .woocommerce-Price-amount.amount,
    .woocommerce-Price-currencySymbol {
        font-size: 11px;
    }
}

/* ==========================================================================
   12. RESPONSIVE - SMALL MOBILE (max-width: 600px)
   ========================================================================== */

@media only screen and (max-width: 600px) {
    ul.products .custom_class,
    ul.products .en-quick-view {
        box-shadow: none !important;
    }

    .image-container svg {
        display: none !important;
    }

    .product .image-container img {
        position: relative !important;
        height: 142px !important;
        width: 142px !important;
        object-fit: contain !important;
    }
}

/* ==========================================================================
   13. RESPONSIVE - SPECIFIC SMALL MOBILE (375px–767px)
   ========================================================================== */

/* ✅ SỬA: width 70px → 90px | height 26px → 28px | font-size giữ nguyên 7px */
@media only screen and (min-width: 375px) and (max-width: 767px) {
    .price-button-wrapp a.button.add_to_cart_button.ajax_add_to_cart {
        font-size: 7px !important;
        width: 90px !important;
        height: 28px !important;
        border-radius: 14px !important;
    }
}

/* ✅ SỬA: width 55px → 80px | height 20px → 24px | font-size giữ nguyên 7px */
@media (max-width: 767px) {
    .price-button-wrapp .add_to_cart_button {
        width: 70px !important;
        font-size: 7px !important;
        height: 24px !important;
    }
}

@media (max-width: 767px) {
    a.button.add_to_cart_button.ajax_add_to_cart {
        font-size: 6px !important;
    }
}
.ajax_add_to_cart {
    display: none !important;
}

.woocommerce-terms-and-conditions-wrapper {
	display:none;
}
.fkcart-checkout-info {
	display: none;
}
