/* public/css/infinite-search-optimized.css */

/* === BỘ LỌC SIDEBAR === */
/* Style cơ bản cho accordion (có thể dùng AlpineJS thay thế) */
.filter-group .filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.filter-group .filter-header.active + .filter-content {
    /* JS sẽ set max-height */
}
.filter-group .filter-header .icon-arrow-down {
    transition: transform 0.3s ease-out;
}
.filter-group .filter-header.active .icon-arrow-down {
    transform: rotate(180deg);
}
/* Style cho nút checkbox filter */
.filter-options-grid input[type="checkbox"]:checked + .filter-option-btn {
    background-color: #d70018; /* var(--primary-color) */
    border-color: #d70018;
    color: white;
}
.filter-options-grid input[type="checkbox"]:checked + .filter-option-btn .count {
    color: white;
}

/* === PRODUCT CARD === */
/* Hiệu ứng hover nhẹ nhàng */
.product-card {
    /* background-color: var(--background-white); */
    background-color: #d70018;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
/* Line clamp cho tên sản phẩm */
.product-card-name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Style cho tag giảm giá (nếu dùng) */
.product-tag {
    position: absolute; top: 0.75rem; left: 0.75rem;
    background-color: #d70018; /* var(--primary-color) */
    color: white; padding: 2px 8px; font-size: 0.75rem; font-weight: 600;
    border-radius: 9999px; z-index: 10;
}

/* === LIST VIEW STYLES === */
/* Container khi ở chế độ list */
#search-results-container.view-list {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Khoảng cách giữa các item */
}
/* Card khi ở chế độ list */
#search-results-container.view-list .product-card {
    display: flex; /* Chuyển sang flex row */
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}
#search-results-container.view-list .product-card:hover {
    transform: none; /* Bỏ hiệu ứng translate Y */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* Giữ shadow nhẹ */
}
#search-results-container.view-list .product-image-wrapper {
    width: 120px; /* Kích thước ảnh cố định */
    height: 120px;
    flex-shrink: 0;
    padding: 0;
    aspect-ratio: unset; /* Bỏ aspect-square */
}
#search-results-container.view-list .product-image {
     height: 100%; /* Cho ảnh fill */
}
#search-results-container.view-list .product-details {
    padding: 0;
    flex-grow: 1;
    min-width: 0; /* Cho phép text wrap */
}
#search-results-container.view-list .product-card-name {
    height: auto; /* Bỏ chiều cao cố định */
    font-size: 1rem; /* Tăng size chữ */
    margin-bottom: 0.5rem;
}
#search-results-container.view-list .product-meta {
     flex-direction: row; /* Meta nằm ngang */
     flex-wrap: wrap;
     gap: 0.5rem 1rem;
     margin-bottom: 0.5rem;
}
#search-results-container.view-list .price-container {
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    gap: 0.25rem; /* Giảm gap giá */
}
#search-results-container.view-list .price-and-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Căn phải */
    justify-content: space-between; /* Đẩy giá và nút ra xa */
    width: 180px; /* Độ rộng cột giá/nút */
    flex-shrink: 0;
    padding-left: 1rem;
    border-left: 1px solid #e2e8f0; /* var(--border-color) */
    height: 100%; /* Chiều cao bằng card */
    margin-left: auto; /* Đẩy sang phải */
}
#search-results-container.view-list .cta-button {
    /* Nút có thể giữ style cũ hoặc làm đơn giản hơn */
    width: auto; /* Cho nút co giãn */
    padding: 0.5rem 1rem;
}
#search-results-container.view-list .cta-button:hover span { /* Hiện text ngay */
    max-width: 100px; opacity: 1; margin-left: 0.5rem;
}

/* Ẩn các phần không cần thiết giữa 2 view */
#search-results-container.view-grid .price-and-action { display: none; }
#search-results-container.view-list .product-details .cta-button.cta-grid { display: none; }
#search-results-container.view-list .product-details .price-container { display: none; } /* Giá đã chuyển sang cột riêng */

/* === LOADING INDICATOR === */
#loading-indicator svg {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}