/* ===== FORM TÌM KIẾM NGANG ===== */
.search-filter-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.search-filter-form h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    flex: 1;
}

.filter-group label {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
}

.search-filter-form input,
.search-filter-form select {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 0;
}

.search-filter-form input:focus,
.search-filter-form select:focus {
    outline: none;
    border-color: #ffd700;
    background: white;
    transform: translateY(-1px);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-search {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #2d3748;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.btn-reset {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== GRID SẢN PHẨM 3-4 CỘT ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #e53e3e, #c53030);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.product-content {
    padding: 15px;
}

.product-title {
    margin-bottom: 8px;
}

.product-title a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    display: block;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.product-title a:hover {
    color: #667eea;
}

.product-id {
    color: #667eea;
    font-weight: 700;
    font-size: 0.8rem;
}

.product-price {
    color: #e53e3e;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 8px 0;
}

.product-price::before {
    content: '₫';
    font-size: 0.9rem;
    margin-right: 2px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
}

.product-category {
    color: #667eea;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 8px;
    border-radius: 10px;
}

.product-date {
    color: #a0aec0;
}

/* ===== KHÔNG CÓ SẢN PHẨM ===== */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-products::before {
    content: '😔';
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

/* ===== RESPONSIVE GRID ===== */

/* Desktop lớn: 4 cột */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop nhỏ: 3 cột */
@media (max-width: 1199px) and (min-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet: 2 cột */
@media (max-width: 991px) and (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile lớn: 2 cột */
@media (max-width: 767px) and (min-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-image {
        height: 160px;
    }
}

/* Mobile nhỏ: 1 cột */
@media (max-width: 575px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card {
        margin: 0 10px;
    }
    
    .product-image {
        height: 200px;
    }
}

/* ===== RESPONSIVE FILTER ===== */
@media (max-width: 1200px) {
    .filter-row {
        gap: 12px;
    }
    
    .filter-group {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .search-filter-form {
        padding: 15px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-filter-form {
        padding: 12px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .btn-search,
    .btn-reset {
        justify-content: center;
    }
}
@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-actions {
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }

  .btn-search,
  .btn-reset {
    width: 100%; /* full width để dễ bấm trên mobile */
    justify-content: center;
  }
}
