/* ClassB site search v2. Everything is scoped under .es2 so it cannot
   collide with the site stylesheet or the old es-search.css. */

.es2 {
  --es2-red: #c00;
  --es2-red-dark: #a00;
  --es2-ink: #1a1a1a;
  --es2-muted: #5f6368;
  --es2-line: #e2e2e2;
  --es2-hover: #f6f6f6;
  --es2-mark: #fff1a8;

  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  clear: both;
  text-align: left;
  color: var(--es2-ink);
  box-sizing: border-box;
}

.es2 *,
.es2 *::before,
.es2 *::after {
  box-sizing: inherit;
}

.es2 a {
  text-decoration: none;
}

.es2 mark {
  background: var(--es2-mark);
  color: inherit;
  font-weight: bold;
  padding: 0 1px;
  border-radius: 2px;
}

/* ---------- search box ---------- */

.es2-form {
  position: relative;
  display: flex;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto 16px;
}

.es2-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  font-size: 20px;
  color: var(--es2-ink);
  background: #fff;
  border: 2px solid #bbb;
  border-radius: 6px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.es2-form input[type="search"]:focus {
  border-color: var(--es2-red);
  outline: none;
}

.es2-form button {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 22px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  background: var(--es2-red);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.es2-form button:hover,
.es2-form button:focus-visible {
  background: var(--es2-red-dark);
}

/* ---------- instant dropdown ---------- */

.es2-ac {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  gap: 20px;
  padding: 16px;
  max-height: min(78vh, 640px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.es2-ac[hidden] {
  display: none;
}

.es2-ac-left {
  flex: 0 0 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.es2-ac.is-narrow .es2-ac-left {
  flex: 1 1 auto;
}

.es2-ac-right {
  flex: 1 1 auto;
  min-width: 0;
}

.es2-ac-label {
  margin: 10px 0 4px;
  padding-bottom: 4px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--es2-muted);
  border-bottom: 1px solid var(--es2-line);
}

.es2-ac-left > .es2-ac-label:first-child,
.es2-ac-right > .es2-ac-label:first-child {
  margin-top: 0;
}

.es2-ac-suggest,
.es2-ac-link {
  display: block;
  padding: 6px 8px;
  font-size: 15px;
  line-height: 1.3;
  color: var(--es2-ink);
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.es2-ac-row:hover,
.es2-ac-row.is-active {
  background: var(--es2-hover);
}

.es2-ac-all {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: #333;
  border-radius: 4px;
}

.es2-ac-all.es2-ac-row:hover,
.es2-ac-all.es2-ac-row.is-active {
  background: var(--es2-red);
}

.es2-ac-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.es2-ac-product {
  display: block;
  padding: 8px;
  color: var(--es2-ink);
  border-radius: 6px;
}

.es2-ac-product-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  margin-bottom: 6px;
}

.es2-ac-product-img img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.es2-ac-product-name {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.es2-ac-product-desc {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--es2-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- prices ---------- */

.es2-price {
  margin-top: 4px;
  font-size: 15px;
}

.es2-price-now {
  font-weight: bold;
  color: var(--es2-ink);
}

.es2-price.is-sale .es2-price-now {
  color: var(--es2-red);
}

.es2-price-was {
  margin-left: 6px;
  font-size: 13px;
  color: #888;
}

/* ---------- tabs ---------- */

.es2-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--es2-line);
  margin: 0 0 12px;
  overflow-x: auto;
}

.es2-tabs[hidden] {
  display: none;
}

.es2-tab {
  padding: 10px 14px;
  font-size: 15px;
  color: var(--es2-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.es2-tab:hover {
  color: var(--es2-ink);
}

.es2-tab.is-active {
  color: var(--es2-red);
  font-weight: bold;
  border-bottom-color: var(--es2-red);
}

.es2-tab-count {
  font-size: 13px;
  font-weight: normal;
  color: var(--es2-muted);
}

/* ---------- summary ---------- */

.es2-summary {
  min-height: 20px;
  margin: 0 0 12px;
  padding: 0;
  font-size: 14px;
  color: var(--es2-muted);
}

/* ---------- did you mean ---------- */

.es2 .es2-dym {
  margin: 0 0 16px;
  padding: 0;
  font-size: 16px;
  color: var(--es2-ink);
}

.es2-dym-link {
  font-weight: bold;
  font-style: italic;
  color: var(--es2-red);
}

.es2-dym-link:hover {
  text-decoration: underline;
}

/* ---------- exact design match ---------- */

.es2-exact {
  margin: 0 0 24px;
}

.es2-exact-item {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 10px;
  padding: 14px;
  color: var(--es2-ink);
  background: #fff8f8;
  border: 2px solid var(--es2-red);
  border-radius: 8px;
}

.es2-exact-item:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.es2-exact-img {
  flex: 0 0 140px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.es2-exact-img img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.es2-exact-info {
  min-width: 0;
}

.es2-exact-kicker {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--es2-red);
}

.es2-exact-name {
  margin: 4px 0 10px;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.3;
}

.es2-exact-go {
  display: inline-block;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  background: var(--es2-red);
  border-radius: 6px;
}

.es2-ac-exact {
  font-weight: bold;
  color: var(--es2-red);
}

/* ---------- sections (All view) ---------- */

.es2-results {
  transition: opacity 0.15s ease;
}

.es2-results.is-loading {
  opacity: 0.45;
}

.es2-section {
  margin: 0 0 32px;
}

.es2-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--es2-ink);
}

.es2 .es2-section-title {
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: bold;
  color: var(--es2-ink);
}

.es2-count {
  font-weight: normal;
  color: var(--es2-muted);
}

.es2-viewall {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: bold;
  color: var(--es2-red);
}

.es2-viewall:hover {
  text-decoration: underline;
}

/* ---------- category chips ---------- */

.es2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.es2-chip {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--es2-ink);
  background: #f2f2f2;
  border: 1px solid var(--es2-line);
  border-radius: 20px;
}

.es2-chip:hover {
  color: #fff;
  background: var(--es2-red);
  border-color: var(--es2-red);
}

.es2-chip:hover mark {
  background: transparent;
  color: inherit;
}

/* ---------- product grid ---------- */

.es2-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.es2-layout .es2-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.es2-card {
  display: flex;
  flex-direction: column;
  padding: 10px;
  color: var(--es2-ink);
  background: #fff;
  border: 1px solid var(--es2-line);
  border-radius: 6px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.es2-card:hover,
.es2-card:focus-visible {
  border-color: #bbb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.es2-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}

.es2-card-img.is-empty,
.es2-ac-product-img.is-empty {
  background: #f2f2f2;
  border-radius: 4px;
}

.es2-card-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.es2-card-name {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.es2-card:hover .es2-card-name {
  color: var(--es2-red);
}

.es2-card .es2-price {
  margin-top: auto;
  padding-top: 8px;
}

/* ---------- products view: filters + toolbar ---------- */

.es2-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.es2-filters {
  flex: 0 0 220px;
  min-width: 0;
}

.es2-main {
  flex: 1 1 auto;
  min-width: 0;
}

.es2-filters-toggle {
  display: none;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid var(--es2-line);
  border-radius: 6px;
  background: #f7f7f7;
}

.es2-filter {
  margin: 0 0 20px;
}

.es2 .es2-filter-title {
  margin: 0 0 6px;
  padding: 0 0 6px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--es2-ink);
  border-bottom: 1px solid var(--es2-line);
}

.es2-filter-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 4px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--es2-ink);
  border-radius: 4px;
}

.es2-filter-opt:hover {
  background: var(--es2-hover);
}

.es2-filter-check {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border: 1px solid #999;
  border-radius: 3px;
  background: #fff;
}

.es2-filter-opt.is-active .es2-filter-check {
  background: var(--es2-red);
  border-color: var(--es2-red);
  box-shadow: inset 0 0 0 2px #fff;
}

.es2-filter-opt.is-active .es2-filter-label {
  font-weight: bold;
}

.es2-filter-label {
  flex: 1 1 auto;
  min-width: 0;
}

.es2-filter-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--es2-muted);
}

.es2-filter-clear {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: bold;
  color: var(--es2-red);
}

.es2-filter-clear:hover {
  text-decoration: underline;
}

.es2-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.es2-sort {
  font-size: 14px;
  color: var(--es2-muted);
}

.es2-sort select {
  height: 36px;
  margin-left: 6px;
  padding: 0 8px;
  font-size: 14px;
  color: var(--es2-ink);
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
}

/* ---------- page rows ---------- */

.es2-result {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 16px 10px;
  border-bottom: 1px solid var(--es2-line);
  color: inherit;
  border-radius: 6px;
}

.es2-result:hover,
.es2-result:focus-visible {
  background: var(--es2-hover);
}

.es2-thumb {
  flex: 0 0 150px;
  width: 150px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--es2-line);
  border-radius: 4px;
  overflow: hidden;
}

.es2-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.es2-body {
  flex: 1 1 auto;
  min-width: 0;
}

.es2 .es2-title {
  margin: 0 0 4px;
  padding: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: bold;
  color: var(--es2-ink);
}

.es2-result:hover .es2-title {
  color: var(--es2-red);
  text-decoration: underline;
}

.es2-url {
  margin: 0 0 6px;
  font-size: 13px;
  color: #1a7f37;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.es2-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  background: var(--es2-muted);
  border-radius: 10px;
  vertical-align: 1px;
}

.es2 .es2-snippet {
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.5;
  font-weight: normal;
  color: #333;
  overflow-wrap: anywhere;
}

/* ---------- messages (no results / error) ---------- */

.es2-message {
  padding: 40px 10px;
  text-align: center;
}

.es2 .es2-message h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #444;
}

.es2 .es2-message p {
  margin: 0;
  font-size: 15px;
  color: var(--es2-muted);
}

/* ---------- pagination ---------- */

.es2-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 0;
}

.es2-page {
  display: inline-block;
  min-width: 42px;
  height: 42px;
  line-height: 42px;
  padding: 0 6px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--es2-ink);
  background: #e6e6e6;
  border-radius: 6px;
  user-select: none;
}

a.es2-page:hover {
  background: #cfcfcf;
}

.es2-page.is-active {
  color: #fff;
  background: var(--es2-red);
}

/* ---------- design ID hint ---------- */

.es2-designid {
  margin: 36px 0 0;
  padding: 14px 16px;
  font-size: 14px;
  text-align: center;
  color: var(--es2-muted);
  background: #f7f7f7;
  border-radius: 6px;
}

.es2-designid a {
  color: var(--es2-red);
}

/* ---------- tablets ---------- */

@media (max-width: 860px) {
  .es2-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .es2-layout {
    display: block;
  }

  .es2-filters {
    margin: 0 0 14px;
  }

  .es2-filters-toggle {
    display: block;
  }

  .es2-filters[open] .es2-filters-toggle {
    margin-bottom: 14px;
  }

  .es2-layout .es2-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .es2-ac-left {
    flex-basis: 220px;
  }

  .es2-ac-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* On wide screens the filter panel is always open and has no toggle */
@media (min-width: 861px) {
  .es2-filters > summary {
    display: none;
  }
}

/* ---------- phones ---------- */

@media (max-width: 560px) {
  .es2 {
    padding-top: 20px;
  }

  .es2-form input[type="search"] {
    font-size: 17px;
  }

  .es2-form button {
    padding: 0 14px;
    font-size: 16px;
  }

  .es2-ac {
    flex-direction: column;
    gap: 6px;
    padding: 12px;
  }

  .es2-ac-left {
    flex: 0 0 auto;
  }

  /* products become compact rows: picture left, text right */
  .es2-ac-products {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .es2-ac-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
  }

  .es2-ac-product-img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin: 0;
  }

  .es2-ac-product-desc {
    display: none;
  }

  .es2-grid,
  .es2-layout .es2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .es2-exact-img {
    flex-basis: 90px;
    width: 90px;
    height: 90px;
  }

  .es2-exact-name {
    font-size: 17px;
  }

  .es2-result {
    gap: 12px;
    padding: 14px 4px;
  }

  .es2-thumb {
    flex-basis: 84px;
    width: 84px;
    height: 64px;
  }

  .es2 .es2-title {
    font-size: 17px;
  }
}
