.ag-custom-search-overlay {
  z-index: 999999;
}

.ag-custom-search-overlay.ag-overlay-desktop {
  position: fixed;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1280px, calc(100vw - 60px));
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.ag-custom-search-overlay.ag-overlay-mobile {
  position: fixed;
  top: 118px;
  left: 8px;
  right: 8px;
  width: auto;
  max-height: calc(100vh - 130px);
  overflow: hidden;
}

.agcs-shell {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
  border: 1px solid #ececec;
  overflow: hidden;
}

.agcs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid #ececec;
}

.agcs-head-left {
  min-width: 0;
}

.agcs-head-query {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: #111;
  margin-bottom: 5px;
}

.agcs-head-sub {
  font-size: 14px;
  color: #777;
}

.agcs-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.agcs-head-count {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

.agcs-open-all {
  border: 1px solid #dcdcdc;
  background: #fff;
  color: #111;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.agcs-open-all:hover {
  border-color: #1a74c1;
  color: #1a74c1;
}

.agcs-suggest-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid #ededed;
  background: #fff;
  flex-wrap: wrap;
}

.agcs-suggest-inline-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.agcs-suggest-inline-items {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agcs-suggest-chip {
  border: 0;
  background: transparent;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  font-weight: 500;
}

.agcs-suggest-chip:hover {
  color: #1a74c1;
}

.agcs-highlight {
  color: #1a74c1;
  font-weight: 700;
}

.agcs-body {
  display: grid;
  grid-template-columns: 270px 1fr;
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.agcs-body-empty {
  display: block;
  min-height: auto;
}

.agcs-sidebar {
  border-right: 1px solid #ececec;
  padding: 18px 18px 22px;
  background: #fafafa;
}

.agcs-facet-group + .agcs-facet-group {
  margin-top: 18px;
}

.agcs-facet-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}

.agcs-facet-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agcs-facet-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  column-gap: 8px;
  margin: 0 !important;
  padding: 2px 0 !important;
  min-height: unset !important;
}

.agcs-facet-item input[type="checkbox"] {
  margin: 0;
}

.agcs-facet-label {
  font-size: 13px;
  line-height: 1.2;
  color: #333;
}

.agcs-facet-count {
  font-size: 12px;
  color: #777;
  margin-left: 8px;
}

.agcs-facet-loading {
  font-size: 13px;
  color: #777;
  padding: 6px 0 10px;
}

.agcs-results {
  padding: 18px;
}

.agcs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.agcs-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ececec;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.agcs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  border-color: #d8e6f5;
}

.agcs-card-image {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: #fff;
}

.agcs-card-image img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.agcs-no-image {
  font-size: 13px;
  color: #888;
}

.agcs-card-content {
  padding: 12px 14px 16px;
}

.agcs-card-brand-row {
  min-height: 24px;
  margin-bottom: 10px;
}

.agcs-card-brand-logo-wrap {
  height: 24px;
  display: flex;
  align-items: center;
}

.agcs-card-brand-logo {
  max-height: 22px;
  max-width: 90px;
  display: block;
}

.agcs-card-title {
  font-size: 14px;
  line-height: 1.35;
  color: #1e1e1e;
  margin-bottom: 10px;
  min-height: 56px;
}

.agcs-card-meta-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.agcs-card-meta {
  font-size: 12px;
  color: #888;
  line-height: 1.25;
}

.agcs-card-stock {
  font-size: 13px;
  color: #2e9b47;
  margin-bottom: 8px;
}

.agcs-card-price {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.agcs-empty-state {
  padding: 28px 22px;
}

.agcs-empty {
  font-size: 15px;
  color: #666;
}

@media (max-width: 1199px) {
  .agcs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .ag-custom-search-overlay.ag-overlay-mobile {
    position: fixed;
    top: 118px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 130px);
    overflow: hidden;
  }

  .agcs-shell {
    border-radius: 18px;
  }

  .agcs-head {
    padding: 16px 16px 12px;
  }

  .agcs-head-query {
    font-size: 17px;
  }

  .agcs-head-sub {
    font-size: 13px;
  }

  .agcs-body {
    grid-template-columns: 1fr !important;
    max-height: calc(100vh - 230px);
  }

  .agcs-sidebar {
    order: 2;
    border-right: 0;
    border-top: 1px solid #ececec;
    padding: 14px;
  }

  .agcs-results {
    order: 1;
    padding: 12px;
  }

  .agcs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .agcs-card {
    border-radius: 14px;
  }

  .agcs-card-image {
    padding: 8px;
  }

  .agcs-card-content {
    padding: 10px 10px 12px;
  }

  .agcs-card-title {
    min-height: auto;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .agcs-card-price {
    font-size: 16px;
  }

  .agcs-card-brand-logo {
    max-height: 18px;
    max-width: 72px;
  }

  .agcs-card-meta {
    font-size: 11px;
  }

  .agcs-card-stock {
    font-size: 12px;
  }

  .agcs-suggest-inline {
    padding: 12px 14px;
  }
}

@media (max-width: 640px) {
  .ag-custom-search-overlay.ag-overlay-mobile {
    top: 118px;
    left: 6px;
    right: 6px;
    max-height: calc(100vh - 126px);
  }

  .agcs-head {
    flex-direction: column;
    gap: 10px;
  }

  .agcs-head-right {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .agcs-open-all {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
  }

  .agcs-suggest-inline {
    padding: 10px 12px;
  }

  .agcs-suggest-inline-label {
    font-size: 13px;
  }

  .agcs-suggest-chip {
    font-size: 13px;
  }

  .agcs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .agcs-results {
    padding: 10px;
  }

  .agcs-sidebar {
    padding: 12px;
  }

  .agcs-card-image {
    padding: 6px;
  }

  .agcs-card-content {
    padding: 8px 8px 10px;
  }

  .agcs-card-title {
    font-size: 12px;
    line-height: 1.25;
  }

  .agcs-card-price {
    font-size: 15px;
  }
}