/* --- Layout Chung --- */
.product-archive-container {
    display: flex;
    gap: 30px; /* Khoảng cách giữa bộ lọc và danh sách */
}

.product-filters-area {
    width: 25%; /* Độ rộng cột bộ lọc */
    flex-shrink: 0;
}

.product-listing-area {
    width: 75%; /* Độ rộng cột danh sách sản phẩm */
}

/* --- Bộ lọc --- */
.product-filters h4 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.filter-group input[type="search"],
.filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box; /* Quan trọng */
}

.filter-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-group ul li {
    margin-bottom: 5px;
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    margin-right: 5px;
}

/* Price Range Slider Styles (Cần nếu dùng jQuery UI Slider) */
#price-slider-range,
.slider-range {
    margin-bottom: 10px;
}
.price-range-values,
.range-values {
    font-size: 0.9em;
    color: #555;
    text-align: center;
}
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; -ms-touch-action: none; touch-action: none; border-radius: 50%; background: #0073aa; border: 1px solid #0073aa;}
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; background: #aaa; }
.ui-slider-horizontal { height: .6em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }

#fgps-reset-filters {
    margin-top: 15px;
    cursor: pointer;
    display: none;
}
#fgps-filter-loading {
    margin-top: 10px;
    color: #777;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}


/* --- Thanh công cụ Toolbar --- */
.product-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.product-count {
    font-size: 0.9em;
    color: #555;
}
.product-sorting label {
    margin-right: 5px;
}


/* --- Danh sách sản phẩm Grid --- */
.product-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Responsive Grid */
    gap: 20px;
}

/* --- Card sản phẩm --- */
.product-card {
    border: 1px solid #eee;
    text-align: center;
    padding: 15px;
    position: relative; /* Cho nút compare */
    display: flex; /* Cho phép căn chỉnh bên trong */
    flex-direction: column; /* Xếp dọc */
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Chiếm toàn bộ không gian trừ nút */
    flex-grow: 1; /* Cho phép link co giãn */
}

.product-card-image {
    margin-bottom: 10px;
    height: 150px; /* Cố định chiều cao ảnh */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    height: auto; /* Giữ tỷ lệ */
    width: auto;
    display: block;
}
.product-card-title {
    font-size: 1.1em;
    margin: 0 0 10px 0;
    min-height: 2.4em; /* Đảm bảo đủ chỗ cho 2 dòng title */
    overflow: hidden;
}
.product-card-price {
    font-weight: bold;
    color: #c00;
    margin-bottom: 10px;
}

.product-card .compare-button {
    margin-top: auto; /* Đẩy nút xuống dưới cùng */
    padding: 5px 10px;
    font-size: 0.9em;
    cursor: pointer;
    /* Thêm style cho nút compare */
}
.product-card .compare-button.added {
    background-color: #d4edda; /* Màu xanh lá khi đã thêm */
    border-color: #c3e6cb;
    color: #155724;
}


/* --- Trang chi tiết sản phẩm --- */
.product-details-grid {
    display: grid;
    grid-template-columns: 40% 60%; /* Chia cột cho ảnh và thông tin */
    gap: 30px;
    margin-top: 20px;
}
.product-gallery img {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
}
.product-info .product-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #c00;
    margin-bottom: 15px;
}
.product-info .product-sku {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 20px;
}
.product-specs,
.product-features-list,
.product-description {
    margin-bottom: 20px;
}
.product-specs h4,
.product-features-list h4,
.product-description h4 {
     margin-bottom: 10px;
     border-bottom: 1px solid #eee;
     padding-bottom: 5px;
}
.product-specs ul,
.product-features-list ul {
    list-style: disc;
    margin-left: 20px;
    padding: 0;
}
.product-specs ul li,
.product-features-list ul li {
    margin-bottom: 5px;
}
.product-info .compare-button {
    margin-top: 20px;
    padding: 10px 20px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .product-archive-container {
        flex-direction: column; /* Xếp chồng bộ lọc và danh sách */
    }
    .product-filters-area,
    .product-listing-area {
        width: 100%;
    }
    .product-details-grid {
        grid-template-columns: 1fr; /* Một cột trên mobile */
    }
    .product-gallery {
        margin-bottom: 20px;
    }
}

