.category-search-shell {
  position: relative;
}

.category-search-shell .category-search {
  min-height: 48px;
  padding-right: 92px;
  border-color: #d9ddea;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.category-search-shell .category-search:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(109, 91, 208, 0.12);
}

.category-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.category-search-clear:hover,
.category-search-clear:focus-visible {
  background: #eeeafb;
}

.category-toolbar strong {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid #ddd8f7;
  border-radius: 999px;
  background: #f5f2ff;
  color: var(--brand-dark);
  font-size: 13px;
  white-space: nowrap;
}

.filter-row {
  padding-bottom: 2px;
}

.filter-chip {
  min-height: 44px;
  border-color: #d9ddea;
  color: #3e475b;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.filter-chip:hover {
  border-color: #afa5e9;
  background: #f7f5ff;
  color: var(--brand-dark);
}

.category-sidebar {
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.05);
}

.category-sidebar .buyer-navigation-note {
  color: var(--muted);
  font-size: 14px;
}

.category-layout > * {
  min-width: 0;
}

.product-grid-v2 {
  min-width: 0;
  gap: 24px;
}

.product-card-v2 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-color: #e1e4ed;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.055);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-card-v2:hover {
  transform: translateY(-4px);
  border-color: #cfc8f3;
  box-shadow: 0 20px 44px rgba(23, 32, 51, 0.11);
}

.product-image-button {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #eceef4;
  padding: 0;
  background: #f6f7fa;
  cursor: zoom-in;
  overflow: hidden;
}

.product-image-button::after {
  content: "View";
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.product-image-button:hover::after,
.product-image-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.product-card-v2 .product-image-button img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: #f6f7fa;
  object-fit: cover;
  transition: transform 0.24s ease;
}

.product-image-button:hover img,
.product-image-button:focus-visible img {
  transform: scale(1.035);
}

.product-image-button:focus-visible {
  outline: 3px solid rgba(109, 91, 208, 0.38);
  outline-offset: -3px;
}

.product-card-body {
  gap: 11px;
  padding: 17px;
}

.product-card-top {
  align-items: center;
  min-width: 0;
}

.sku-badge {
  min-width: 0;
  overflow: hidden;
  color: var(--brand-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-type {
  flex: 0 0 auto;
  border: 1px solid #e4dffa;
  background: #f6f3ff;
  color: #5d4ab8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.product-card-v2 h3 {
  display: -webkit-box;
  min-height: 2.7em;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card-v2 .get-quote {
  min-height: 44px;
  justify-content: center;
  margin-top: auto;
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13px;
}

.product-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
}

.product-card-actions .btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  margin: 0;
  border-radius: 11px;
  padding: 10px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.product-detail-link {
  border-color: #d9ddea;
  color: var(--brand-dark);
}

.product-detail-link:hover {
  border-color: #afa5e9;
  background: #f7f5ff;
}

.category-empty-state {
  display: none;
  margin-top: 20px;
  border: 1px dashed #c9c2ef;
  border-radius: 20px;
  padding: 28px;
  background: #faf9ff;
  text-align: center;
}

.category-empty-state.show {
  display: block;
}

.category-empty-state h3 {
  margin: 0 0 8px;
}

.category-empty-state p {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
}

.category-empty-state .actions {
  justify-content: center;
  margin-top: 18px;
}

.category-mobile-quote {
  display: none;
}

.product-image-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(23, 32, 51, 0.3);
  overflow: auto;
}

.product-image-dialog::backdrop {
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(3px);
}

.product-image-dialog-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  background: #fff;
}

.product-image-dialog-visual {
  display: grid;
  min-height: 440px;
  place-items: center;
  padding: 24px;
  background: #f5f6f9;
}

.product-image-dialog-visual img {
  width: 100%;
  max-height: 68vh;
  border-radius: 16px;
  object-fit: contain;
}

.product-image-dialog-copy {
  display: flex;
  flex-direction: column;
  padding: 34px;
}

.product-image-dialog-copy .sku-badge {
  align-self: flex-start;
}

.product-image-dialog-copy h2 {
  margin: 16px 0 10px;
  font-size: 30px;
  line-height: 1.15;
}

.product-image-dialog-copy p {
  margin: 0;
  color: var(--muted);
}

.product-image-dialog-copy .actions {
  margin-top: auto;
  padding-top: 30px;
}

.product-image-dialog-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.12);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 760px) {
  .product-image-dialog-inner {
    grid-template-columns: 1fr;
  }

  .product-image-dialog-visual {
    min-height: auto;
    padding: 14px;
  }

  .product-image-dialog-visual img {
    max-height: 48vh;
  }

  .product-image-dialog-copy {
    padding: 24px;
  }

  .product-image-dialog-copy h2 {
    font-size: 24px;
  }

  .product-image-dialog-copy .actions {
    margin-top: 18px;
    padding-top: 0;
  }
}

@media (max-width: 620px) {
  body.has-category-mobile-quote {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .category-layout {
    gap: 22px;
  }

  .category-sidebar {
    padding: 16px;
  }

  .category-sidebar h2 {
    font-size: 19px;
  }

  .category-sidebar .buyer-navigation-note {
    margin: 8px 0 12px;
  }

  .category-sidebar nav {
    display: flex;
    gap: 8px;
    padding: 2px 0 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .category-sidebar nav a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    padding: 9px 12px;
    background: #fff;
    white-space: nowrap;
  }

  .category-sidebar .actions {
    display: none;
  }

  .category-toolbar {
    gap: 10px;
  }

  .category-toolbar strong {
    justify-self: start;
  }

  .filter-row {
    flex-wrap: nowrap;
    padding: 0 0 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .category-sidebar nav a {
    min-height: 44px;
  }

  .product-grid-v2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .product-card-v2 .product-image-button img {
    aspect-ratio: 4 / 3;
  }

  .product-card-v2 h3 {
    min-height: auto;
    font-size: 18px;
  }

  .category-mobile-quote {
    position: fixed;
    z-index: 70;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 16px;
    padding: 10px 10px 10px 15px;
    background: #172033;
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.28);
    color: #fff;
  }

  .category-mobile-quote span {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
  }

  .category-mobile-quote .btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 15px;
  }

  body.has-category-mobile-quote .whatsapp-float {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.has-category-mobile-quote .back-top {
    bottom: calc(160px + env(safe-area-inset-bottom));
  }

  .category-empty-state {
    padding: 22px 16px;
  }

  .product-image-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .product-image-dialog-close {
    top: 8px;
    right: 8px;
  }
}
