/* ==========================================================================
   Module: Products Grid Section
   ========================================================================== */

/* Filter tabs */
.products-grid__tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: var(--space-10);
  flex-wrap: wrap;
}

.products-grid__tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: var(--font-semibold);
  font-family: var(--font-heading);
  text-transform: none; /* Soften for flat style */
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px; /* Pill shape - Flat */
  cursor: pointer;
  transition: all 0.2s ease;
}

.products-grid__tab svg {
  width: 22px;
  height: 22px;
  fill: var(--color-text-muted);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.2s ease;
}

.products-grid__tab span {
  white-space: nowrap;
}

.products-grid__tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.products-grid__tab:hover svg {
  fill: #fff;
  transform: scale(1.15);
}

.products-grid__tab--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: none;
}

.products-grid__tab--active svg {
  fill: #fff !important;
}

/* Grid */
.products-grid__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.products-grid__item {
  transition: opacity var(--transition-base);
}

.products-grid__item--hidden {
  display: none;
}

/* CTA */
.products-grid__footer {
  text-align: center;
}

/* Responsive */
@media (max-width: 1023px) {
  .products-grid__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* ==========================================================================
     MOBILE RESPONSIVE UPGRADES (SCOPE ISOLATION)
     Thanh Tab trượt ngang như App, tối ưu hiển thị nút Lọc xe
     ========================================================================== */
  .products-grid { padding: 2.5rem 0 !important; }

  /* Nâng cấp dải nút lọc thành bẻ dòng, thu gọn diện tích tối đa */
  .products-grid__tabs { 
    flex-wrap: wrap !important;
    justify-content: center !important;
    overflow-x: visible !important;
    gap: 6px !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0 !important;
    
    /* Quay về khoảng cách lề bình thường */
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .products-grid__tabs::-webkit-scrollbar {
    display: none;
  }

  /* Ép nút tab nhỏ lại kịch trần */
  .products-grid__tab {
    flex: 0 0 auto !important; /* Không bị giãn hẹp */
    padding: 6px 14px !important; /* Trái phải gọn lại chút */
    font-size: 0.8rem !important;
    gap: 4px !important;
    border-radius: 50px !important;
    height: 36px !important; /* Giữ bo tròn thẳng băng */
  }
  .products-grid__tab svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* Grid Sản phẩm */
  .products-grid__grid { 
    grid-template-columns: 1fr; 
    gap: 1rem !important;
    margin-bottom: 2rem !important;
  }

  /* Nén Header */
  .products-grid .section__header {
    margin-bottom: 1.25rem !important;
  }
  .products-grid .section__header h2 {
    font-size: 1.6rem !important;
  }
  .products-grid .section__header p {
    font-size: 0.85rem !important;
    margin-bottom: 0 !important;
  }
  
  /* Thu nhỏ nút Xem tất cả dòng xe trên Mobile */
  .products-grid__footer .btn {
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 99px !important;
  }
  .products-grid__footer .btn svg {
    width: 14px !important;
    height: 14px !important;
  }
}
