/* ==========================================================================
   FLATSOME MINIMALIST REDESIGN WITH 25PX RADIUS
   ========================================================================== */

/* 1. ĐỊNH DẠNG NỀN TẢNG TỐI GIẢN */
body {
    font-family: 'DM Sans', sans-serif !important; /* Ưu tiên font hiện đại có sẵn */
    background-color: var(--fd-color-background) !important;
    color: var(--fd-color-on-surface) !important;
    -webkit-font-smoothing: antialiased;
}

/* Loại bỏ hoàn toàn đường kẻ ngang cũ của Flatsome để lấy không gian thoáng */
.is-divider.small {
    display: none !important;
}

/* 2. TRANG CHI TIẾT SẢN PHẨM & BỘ LỌC (PRODUCT DETAIL) */
.product-container {
    padding: var(--fd-stack-sm) 0;
}

/* Khu vực hình ảnh sản phẩm */
.woocommerce-product-gallery__image img {
    border-radius: var(--fd-radius-brand) !important; /* Bo góc 25px */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease;
}

/* Bo góc cho khung slider ảnh thu nhỏ */
.product-thumbnails .col img {
    border-radius: var(--fd-radius-xl) !important;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.product-thumbnails .col.is-nav-selected img {
    border-color: var(--fd-color-primary) !important;
}

/* Badge (Nhãn "Mới" / Giảm giá) dạng viên thuốc mềm mại */
.badge.badge-circle {
    border-radius: var(--fd-radius-brand) !important; /* 25px */
    padding: 6px 14px !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    background-color: var(--fd-color-secondary-container) !important;
    color: var(--fd-color-on-secondary-fixed-variant) !important;
    width: auto !important;
    height: auto !important;
}

/* 3. NÚT BẤM VÀ CÁC THÀNH PHẦN TƯƠNG TÁC (BUTTONS & INPUTS) */
button, 
.button, 
input[type="submit"], 
input[type="button"],
.wishlist-button {
    border-radius: var(--fd-radius-brand) !important; /* Luôn bo góc 25px */
    font-weight: 600 !important;
    text-transform: none !important; /* Bỏ viết hoa thô cứng */
    letter-spacing: 0 !important;
    padding: 12px 28px !important;
    border: 1px solid transparent !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Trạng thái nút Add to Cart / Mua hàng chính */
.single_add_to_cart_button.button.alt,
.button.primary {
    background-color: var(--fd-color-primary) !important;
    color: var(--fd-color-on-primary) !important;
    box-shadow: 0 4px 14px rgba(6, 18, 29, 0.15) !important;
}

.single_add_to_cart_button.button.alt:hover,
.button.primary:hover {
    background-color: var(--fd-color-moss-accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 18, 29, 0.2) !important;
}

/* Nút dạng Outline tối giản (Ví dụ nút wishlist) */
.button.is-outline {
    border-color: var(--fd-color-outline-variant) !important;
    color: var(--fd-color-on-surface) !important;
    background: var(--fd-color-surface-container-lowest) !important;
}
.button.is-outline:hover {
    background: var(--fd-color-surface-container-low) !important;
    border-color: var(--fd-color-outline) !important;
}

/* Chọn số lượng hoặc dropdown */
select, 
.orderby,
input[type="number"] {
    border-radius: var(--fd-radius-brand) !important;
    border: 1px solid var(--fd-color-surface-container-highest) !important;
    background-color: var(--fd-color-surface-container-lowest) !important;
    padding: 8px 16px !important;
    color: var(--fd-color-on-surface) !important;
}

/* 4. SIDEBAR VÀ DIALOG BỘ LỌC TỐI GIẢN (SIDEBAR FILTER) */
.sidebar-inner, 
#product-sidebar {
    background: var(--fd-color-cream-surface) !important;
    padding: var(--fd-gutter) !important;
    border-radius: var(--fd-radius-brand) !important; /* Bo 25px */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid var(--fd-color-surface-container-low);
}

.widget-title {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 1.15rem !important;
    color: var(--fd-color-tertiary) !important;
    margin-bottom: var(--fd-stack-sm) !important;
}

.product-categories li {
    padding: 8px 0 !important;
    border: none !important;
}

.product-categories li a {
    color: var(--fd-color-on-surface-variant) !important;
    transition: all 0.2s ease;
}

.product-categories li a:hover,
.product-categories li.current-cat > a {
    color: var(--fd-color-primary) !important;
    font-weight: 600;
    padding-left: 4px;
}

/* 5. ĐỊNH DẠNG TAB THÔNG TIN (PRODUCT TABS) */
.tabbed-content .nav-line {
    border-bottom: 2px solid var(--fd-color-surface-container) !important;
}

.tabbed-content .nav-line > li > a {
    text-transform: none !important;
    font-weight: 600 !important;
    color: var(--fd-color-on-surface-variant) !important;
}

.tabbed-content .nav-line > li.active > a {
    color: var(--fd-color-primary) !important;
}

/* 6. RESPONSIVE HOÀN HẢO CHO MỌI THIẾT BỊ */

/* Màn hình Tablet & Mobile (Dưới 980px) */
@media (max-width: 980px) {
    .product-main .row.content-row {
        display: flex;
        flex-direction: column;
        gap: var(--fd-stack-md);
    }
    
    .product-gallery, 
    .product-info {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
    }
    
    /* Thanh bộ lọc mobile mượt mà */
    .category-filtering {
        margin-bottom: var(--fd-stack-sm);
    }
    
    .filter-button {
        background-color: var(--fd-color-surface-container-high) !important;
        padding: 10px 24px !important;
        border-radius: var(--fd-radius-brand) !important;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
}

/* Màn hình Di động nhỏ (Dưới 549px) */
@media (max-width: 549px) {
    :root {
        --fd-gutter: 16px; /* Co nhỏ margin theo cấu hình hệ thống */
    }
    
    .product-title {
        font-size: 1.5rem !important; /* Thu nhỏ tiêu đề vừa vặn màn hình */
    }
    
    .single_add_to_cart_button.button.alt {
        width: 100% !important; /* Nút mua hàng full-width trên mobile để dễ bấm */
        text-center: center;
    }
    
    /* Thu gọn khoảng cách ảnh sản phẩm */
    .flickity-viewport {
        height: auto !important;
        aspect-ratio: 1 / 1; /* Giữ tỷ lệ vuông sạch sẽ */
    }
    
    .woocommerce-product-gallery__image img {
        border-radius: 20px !important; /* Bo nhẹ hơn một chút trên màn hình rất nhỏ để cân đối thị giác */
    }
}