/* ============================================
   HEADER SECTION
   ============================================ */
.product-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
}

.product-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Filter Button - Ẩn trên desktop */
.filter-btn-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border: 2px solid #007bf3;
  border-radius: 8px;
  color: #007bf3;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn-mobile:hover {
  background: #007bf3;
  color: white;
}

.filter-btn-mobile i {
  font-size: 16px;
}

/* ============================================
   LAYOUT
   ============================================ */
.product-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
}

/* ============================================
   SIDEBAR FILTERS
   ============================================ */
.product-sidebar {
  background: white;
  border-radius: 12px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.clear-filter {
  color: #007bf3;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.3s;
}

.clear-filter:hover {
  opacity: 0.8;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 28px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Filter Option Item */
.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.filter-option:hover {
  background: #f8f9fa;
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #007bf3;
}

.filter-option label {
  flex: 1;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  user-select: none;
}

.filter-option.active label {
  color: #007bf3;
  font-weight: 500;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Product Card */
.product-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 123, 243, 0.15);
  transform: translateY(-4px);
  border-color: #007bf3;
}

.product-logo-proxy {
  width: 100%;
  aspect-ratio: 1;
  background: #f8f9fa;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.product-logo-proxy img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

.product-name {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.product-package {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.product-pricing {
  margin-top: auto;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.price-current {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.price-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #666;
}

.price-rating i {
  color: #4ade80;
  font-size: 12px;
}

.price-original {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
}

.price-discount {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: 8px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e8e8e8;
}

.pagination button {
  width: 36px;
  height: 36px;
  border: 1px solid #e8e8e8;
  background: white;
  border-radius: 6px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination button:hover:not(.active):not(:disabled) {
  border-color: #007bf3;
  color: #007bf3;
}

.pagination button.active {
  background: #007bf3;
  color: white;
  border-color: #007bf3;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ============================================
   MOBILE FILTER MODAL
   ============================================ */
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  animation: fadeIn 0.3s ease;
}

.filter-modal.active {
  display: block;
}

.filter-modal-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  animation: slideInFromLeft 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e8e8e8;
  background: #007bf3;
  color: white;
}

.header-proxy {
  display: flex;
  align-items: center;
  gap: 40px;
  width: 100%;
}

.filter-modal-title {
  font-size: 20px;
  font-weight: 600;
}

.filter-modal-close {
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.3s;
}

.filter-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.filter-modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.filter-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  gap: 12px;
  background: white;
}

.filter-modal-footer button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-cancel {
  background: white;
  border: 2px solid #e8e8e8;
  color: #666;
}

.btn-cancel:hover {
  border-color: #007bf3;
  color: #007bf3;
}

.btn-apply {
  background: #007bf3;
  border: 2px solid #007bf3;
  color: white;
}

.btn-apply:hover {
  background: #007bf3;
  border-color: #007bf3;
}

/* Wrapper */
.proxy-search-wrapper-proxy {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin-bottom: 20px;
}

/* Search Input */
#proxy-search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 38px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 15px;
  background: #fff;
  color: #333;
  border-radius: 0; /* vuông góc */
  box-sizing: border-box;
}

/* Focus state */
#proxy-search-input:focus {
  border-color: #007bf3;
}

/* Search Icon */
.proxy-search-wrapper-proxy .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #888;
}

/* Clear Button */
.proxy-search-wrapper-proxy .clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #aaa;
  padding: 0;
  line-height: 0;
  display: none;
}

.proxy-search-wrapper-proxy .clear-btn:hover {
  color: #555;
}

/* Mobile optimize */
@media (max-width: 480px) {
  .proxy-search-wrapper-proxy {
    max-width: 100%;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 3840px) {
  .products-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (min-width: 2560px) {
  .products-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Mobile */
@media (max-width: 1024px) {
  .product-header-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-title {
    font-size: 24px;
  }

  /* Hiện nút bộ lọc trên mobile */
  .filter-btn-mobile {
    display: flex;
    width: 100%;
    justify-content: center;
  }

  /* Ẩn sidebar trên mobile */
  .product-sidebar {
    display: none;
  }

  /* Full width cho products */
  .product-layout {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .product-card {
    padding: 16px;
  }

  .product-logo-proxy {
    margin-bottom: 12px;
  }

  .product-logo-proxy img {
    padding: 16px;
  }

  .product-name {
    font-size: 15px;
  }

  .price-current {
    font-size: 18px;
  }

  /* Modal full screen trên mobile */
  .filter-modal-content {
    width: 100%;
    max-width: 100%;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .product-title {
    font-size: 20px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card {
    padding: 12px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-package {
    font-size: 12px;
  }

  .price-current {
    font-size: 16px;
  }

  .price-original {
    font-size: 13px;
  }

  .price-discount {
    font-size: 11px;
    padding: 3px 6px;
  }
}
