/* Product listing/category styles aligned to unified light theme */

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 10% -10%, #fff 0%, #f5f5f7 48%, #f1f2f4 100%);
  color: #1d1d1f;
  font-family: "Montserrat", sans-serif;
  overflow-x: hidden;
}

.search-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.search-box {
  width: min(480px, 100%);
  height: 42px;
  border-radius: 999px;
  border: 1px solid #d3d3d8;
  padding: 0 14px;
  background: #fff;
  color: #1d1d1f;
  outline: none;
}

.search-box:focus {
  border-color: #8ab8ef;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.search-container::before,
.navbar .search-container::before {
  display: none !important;
}

.products-intro {
  max-width: 1240px;
  margin: 82px auto 6px;
  padding: 0 16px;
}

.products-intro-title {
  margin: 0;
  color: #1d1d1f;
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.products-intro-subtitle {
  margin: 7px 0 0;
  color: #63656d;
  font-size: 0.94rem;
  line-height: 1.52;
  max-width: 760px;
}

.builder-cta-row {
  margin-top: 14px;
}

.builder-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--ui-brand, #2563eb);
  background: var(--ui-brand, #2563eb);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.builder-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--ui-brand-ring, rgba(37, 99, 235, 0.32));
}

.builder-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 17, 20, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.builder-modal.show {
  display: flex;
  animation: modalFadeIn 220ms ease-out;
}

.builder-modal-panel {
  width: min(760px, 100%);
  background: #fff;
  border: 1px solid #e7e7ed;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  padding: 20px;
  transform: translateY(8px) scale(0.98);
  animation: modalPanelIn 220ms ease-out forwards;
  position: relative;
}

.builder-modal-panel h3 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.builder-modal-panel p {
  margin: 8px 0 0;
  color: #5f6470;
  line-height: 1.5;
}

.builder-modal-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.builder-pill {
  border: 1px solid #dbe1ec;
  background: #f7faff;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  font-size: 0.92rem;
  color: #24344a;
}

.builder-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.builder-modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #737986;
  cursor: pointer;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPanelIn {
  to { transform: translateY(0) scale(1); }
}

.catalog-filters-shell {
  max-width: 1240px;
  margin: 0 auto 8px;
  padding: 0 16px;
}

.catalog-filters-bar {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

.filters-wrapper,
.category-filters,
.more-categories,
.more-dropdown,
.category-main,
.filter-section,
.category-section,
.category-main .products-section,
.category-main .filters-sidebar {
  border-color: #e7e7ed !important;
}

.category-filter-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  margin: 0.3rem;
  border-radius: 999px;
  border: 1px solid #d7d7dd;
  background: #fff;
  color: #1d1d1f;
  text-decoration: none;
}

.category-filter-link:hover {
  color: #005ec2;
  background: #f5f8fd;
}

.products-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px 28px;
}

body.apple-ui.products-page .products-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#productCategoriesContainer {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

#productGrid {
  display: block;
  width: 100%;
}

.catalog-section {
  margin-bottom: 20px;
  overflow: hidden;
}

.product-grid.section-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  overflow: visible;
  gap: 16px;
  padding: 4px 2px 10px;
}

.product-grid.section-grid::-webkit-scrollbar {
  height: 10px;
}

.product-grid.section-grid::-webkit-scrollbar-thumb {
  background: #cfd4de;
  border-radius: 999px;
}

.product-grid.section-grid::-webkit-scrollbar-track {
  background: #edf0f5;
  border-radius: 999px;
}

.product-grid.section-grid .product-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 100%;
}

.empty-note {
  color: #63656d;
  margin: 8px 0 0;
}

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

.product-card {
  background: #fff;
  border: 1px solid #e7e7ed;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease;
  cursor: pointer;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.product-card img,
.product-image img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-bottom: 1px solid #ececf2;
  background: #f4f5f8;
}

.product-content,
.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
}

.product-name {
  color: #1d1d1f;
  margin: 0;
  min-height: 2.5em;
  line-height: 1.25;
}

.product-brand,
.product-compatibility,
.product-content p {
  color: #63656d;
}

.product-compatibility {
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.1em;
}

.product-price {
  color: #1d1d1f;
  font-weight: 700;
  margin: 0;
  margin-top: auto;
}

.product-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  margin-top: auto;
}

.product-actions button,
.product-link,
.btn-add-cart,
.btn-view-details {
  border-radius: 999px;
  border: 1px solid #d7d7dd;
  background: #fff;
  color: #111;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}

.btn-add-cart {
  background: #0071e3;
  border-color: #0071e3;
  color: #fff;
}

.btn-add-cart:hover {
  background: #0062c7;
  border-color: #0062c7;
}

.btn-view-details:hover,
.product-link:hover {
  background: #f1f1f4;
}

.category-main {
  max-width: 1240px;
  margin: 12px auto 30px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.filters-sidebar {
  position: sticky;
  top: 74px;
  align-self: start;
}

.filter-section,
#dynamicFilters .filter-section {
  background: #fff;
  border: 1px solid #e7e7ed;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.filter-title,
.category-title {
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.filter-option label {
  color: #565861;
}

.price-range-inputs input {
  background: #fff;
  color: #1d1d1f;
  border: 1px solid #d3d3d8;
  border-radius: 10px;
  padding: 9px 10px;
}

.filter-buttons .btn {
  border-radius: 999px;
  border: 1px solid #d7d7dd;
  background: #fff;
  color: #111;
}

.filter-buttons .btn:first-child {
  background: #0071e3;
  color: #fff;
  border-color: #0071e3;
}

.scroll-left,
.scroll-right,
.nas-host-badge {
  display: none !important;
}

@media (max-width: 920px) {
  .category-main {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    position: static;
  }

  .product-actions {
    flex-wrap: wrap;
  }

  .product-grid.section-grid .product-card {
    max-width: none;
  }

  .product-grid.section-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .product-grid.section-grid {
    grid-template-columns: 1fr;
  }

  .builder-modal-grid {
    grid-template-columns: 1fr;
  }
}
