/* Products Page Layout */
.products-page {
  padding: 40px 0;
  background: #f5f5f5;
}

.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
}

/* Sidebar */
.products-sidebar {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  align-self: start;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #1A1A1A;
  border-bottom: 2px solid #FFC107;
  padding-bottom: 10px;
  text-transform: uppercase;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-list a,
.cat-filter-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
  background: #fcfcfc;
  border: 1px solid #eee;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.category-list a:hover,
.category-list a.active,
.cat-filter-link:hover,
.cat-filter-link.active {
  background: #FFC107;
  color: #1A1A1A;
  border-color: #FFC107;
}

.cat-filter-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.cat-toggle {
  width: 42px;
  flex-shrink: 0;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fcfcfc;
  color: #666;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.cat-toggle:hover {
  background: #FFC107;
  border-color: #FFC107;
  color: #1A1A1A;
}

.cat-toggle i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.cat-filter-group.open .cat-toggle i {
  transform: rotate(180deg);
}

.cat-filter-group .sub-filter-list {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 8px 12px;
}

.cat-filter-group.open .sub-filter-list {
  display: flex;
}

.category-list a.sub-filter {
  font-size: 13px;
  padding: 8px 12px;
  font-weight: 500;
  background: #fff;
}

/* Products Grid */
.products-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.products-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: #1A1A1A;
  text-transform: uppercase;
}

.products-count {
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

.products-search-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #111;
  color: #fff;
  padding: 14px 18px;
  margin-bottom: 4px;
}

.products-search-banner p {
  margin: 0;
  font-size: 14px;
}

.products-search-banner strong {
  color: var(--yellow, #FFC107);
}

.products-clear-search {
  color: #111;
  background: var(--yellow, #FFC107);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  text-decoration: none;
}

.products-sub-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid #eee;
  border-left: 4px solid var(--yellow, #FFC107);
  padding: 14px 18px;
  margin-bottom: 4px;
}

.products-sub-banner p {
  margin: 0;
  font-size: 14px;
  color: #444;
  line-height: 1.5;
}

.products-sub-banner a {
  color: #111;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.products-sub-banner a:hover {
  color: #000;
}

.products-empty {
  grid-column: 1 / -1;
  background: #fff;
  padding: 36px 24px;
  border: 1px dashed #ccc;
  text-align: center;
}

.products-empty p {
  margin: 0 0 10px;
  color: #666;
  line-height: 1.6;
}

.products-empty code {
  background: #f3f3f3;
  padding: 2px 6px;
  font-weight: 700;
  color: #111;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.products-grid.is-subcategories {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.products-sub-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.products-sub-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.products-sub-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.products-sub-card-image {
  background:
    radial-gradient(circle at 50% 40%, #ffffff 0%, #ececec 70%, #e2e2e2 100%);
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.products-sub-card-image img {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.products-sub-card:hover .products-sub-card-image img {
  transform: scale(1.05);
}

.products-sub-card-body {
  padding: 18px 18px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.products-sub-card-body h3 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  color: #1a1a1a;
  margin: 0;
}

.products-sub-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  background: var(--yellow, #FFC107);
  color: #1a1a1a;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  padding: 10px 18px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.products-sub-card:hover .products-sub-card-btn {
  background: #e6ac00;
}

.products-sub-card-btn i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.products-sub-card:hover .products-sub-card-btn i {
  transform: translateX(3px);
}

/* Overriding the default product card for the grid view */
.products-grid .product-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  min-width: 0;
  max-width: none;
  width: 100%;
  flex: initial;
}

.products-grid .product-image {
  width: 100%;
  height: 180px;
}

.products-grid .product-name {
  font-size: 15px;
  min-height: 0;
}

.products-grid .product-oem,
.products-grid .product-model {
  margin: 0;
}

.products-grid .product-price {
  margin: 2px 0 4px;
}

.products-grid .btn-quote-sm {
  margin-top: auto;
}

.products-pagination {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 8px;
}

.products-pagination.is-visible {
  display: flex;
}

.products-pagination .page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: var(--black, #1a1a1a);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.products-pagination .page-btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--yellow, #ffc107);
  background: #fff8e1;
}

.products-pagination .page-btn.is-active {
  background: var(--yellow, #ffc107);
  border-color: var(--yellow, #ffc107);
  color: var(--black, #1a1a1a);
  cursor: default;
}

.products-pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.products-pagination .page-ellipsis {
  padding: 0 4px;
  color: #888;
  font-weight: 700;
}

@media (max-width: 991px) {
  .products-layout {
    grid-template-columns: 1fr;
  }
}
