/*
 * CBA_TWO_FIELD_ORIGINAL_MODAL_V3
 *
 * The original search-modal.css still controls the visual language
 * of dropdown panels, sections, result rows, icons, metadata, and
 * keyboard states. This file controls only the two-input layout,
 * independent dropdown positioning, and filter pills.
 */

.cba-search-v3 {
  position: relative;
  width: min(760px, 100%);
  max-width: 100%;
}

.cba-search-v3,
.cba-search-v3 * {
  box-sizing: border-box;
}

.cba-search-v3 .cba-search-v3-fields {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.25fr)
    minmax(170px, 0.9fr)
    48px;
  width: 100%;
  overflow: visible;
  border: 1px solid #dedede;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
}

.cba-search-v3 .cba-search-v3-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  background: #fff;
}

.cba-search-v3 .cba-search-v3-field:first-child {
  border-radius: 17px 0 0 17px;
}

.cba-search-v3 .cba-search-v3-field +
.cba-search-v3 .cba-search-v3-field {
  border-left: 1px solid #e5e5e5;
}

.cba-search-v3 .cba-search-v3-icon {
  flex: 0 0 auto;
  margin-left: 14px;
  color: #555;
  font-size: 18px;
}

.cba-search-v3 .cba-search-v3-field input[type="text"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 12px 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 15px;
}

.cba-search-v3 .cba-search-v3-field input::placeholder {
  color: #747474;
  opacity: 1;
}

.cba-search-v3 .submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 17px 17px 0;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.cba-search-v3 .submit:hover {
  background: #292929;
}

/*
 * Separate dropdowns prevent city results and category results from
 * competing for the same large panel.
 */
.cba-search-v3 .cba-search-v3-dropdown {
  position: absolute;
  z-index: 100030;
  top: calc(100% + 8px);
  display: none;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.17);
}

.cba-search-v3 .cba-search-v3-dropdown.open {
  display: block;
}

.cba-search-v3 #cba-query-dd {
  left: 0;
  width: min(520px, calc(100vw - 24px));
}

.cba-search-v3 #cba-city-dd {
  right: 48px;
  width: min(460px, calc(100vw - 24px));
}

/*
 * Preserve the old modal row styling while removing native button
 * appearance.
 */
.cba-search-v3 .cba-search-v3-dropdown .item,
.cba-search-v3 .cba-search-v3-dropdown .loc-item {
  width: 100%;
  margin: 0;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cba-search-v3 .cba-search-v3-dropdown .panel {
  max-height: min(68vh, 620px);
  overflow-y: auto;
}

.cba-search-v3 .cba-search-v3-dropdown .section[hidden],
.cba-search-v3 .cba-search-v3-dropdown .results-group[hidden],
.cba-search-v3 .cba-search-v3-dropdown .cba-search-message[hidden] {
  display: none;
}

.cba-search-v3 .cba-search-v3-dropdown .kb-active {
  background: #f2f3f5;
  outline: 2px solid rgba(17, 17, 17, 0.12);
  outline-offset: -2px;
}

.cba-search-v3 .cba-search-message {
  padding: 18px 12px;
  color: #777;
  font-size: 14px;
  text-align: center;
}

/* Active filters below the site header. */
.cba-active-filters-v3 {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: min(1180px, calc(100% - 32px));
  margin: 11px auto 17px;
}

.cba-active-filters-v3,
.cba-active-filters-v3 * {
  box-sizing: border-box;
}

.cba-active-filters-v3 .cba-filter-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(420px, calc(100vw - 70px));
  min-height: 36px;
  padding: 6px 8px 6px 13px;
  overflow: hidden;
  border: 1px solid #d6d6d6;
  border-radius: 999px;
  background: #fff;
  color: #161616;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  font-weight: 700;
}

.cba-active-filters-v3 .cba-filter-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cba-active-filters-v3 .cba-filter-pill button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  margin-left: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ededed;
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cba-active-filters-v3 .cba-filter-pill button:hover {
  background: #dcdcdc;
}

.cba-active-filters-v3 .cba-clear-filters {
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 720px) {
  .cba-search-v3 .cba-search-v3-fields {
    grid-template-columns:
      minmax(130px, 1fr)
      minmax(125px, 0.9fr)
      46px;
    border-radius: 15px;
  }

  .cba-search-v3 .cba-search-v3-field input[type="text"] {
    height: 46px;
    padding-right: 7px;
    font-size: 14px;
  }

  .cba-search-v3 .cba-search-v3-icon {
    margin-left: 10px;
  }

  .cba-search-v3 .submit {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 0 14px 14px 0;
  }

  .cba-search-v3 #cba-query-dd,
  .cba-search-v3 #cba-city-dd {
    right: auto;
    left: 0;
    width: min(520px, calc(100vw - 24px));
  }

  .cba-active-filters-v3 {
    width: calc(100% - 24px);
    margin-top: 9px;
  }
}

@media (max-width: 480px) {
  .cba-search-v3 .cba-search-v3-fields {
    grid-template-columns: 1fr 44px;
  }

  .cba-search-v3 .cba-query-field {
    grid-column: 1;
    grid-row: 1;
    border-radius: 14px 0 0 0;
  }

  .cba-search-v3 .cba-location-field {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid #e5e5e5;
    border-left: 0;
    border-radius: 0 0 0 14px;
  }

  .cba-search-v3 .submit {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 44px;
    min-width: 44px;
    height: auto;
  }

  .cba-search-v3 #cba-query-dd,
  .cba-search-v3 #cba-city-dd {
    top: calc(100% + 7px);
    width: calc(100vw - 20px);
  }
}

/*
 * CBA_SEARCH_V3_VISUAL_CLEANUP_V2
 *
 * Correct the V3 result layout without changing search behavior.
 */

/* Defensive hide in case cached markup temporarily contains the icon. */
.cba-search-v3
.cba-query-field
.cba-search-v3-icon[icon="search"] {
  display: none;
}

.cba-search-v3
.cba-query-field
input[type="text"] {
  padding-left: 16px;
}

/* Stop inherited modal rules from using horizontal group layouts. */
.cba-search-v3
.cba-search-v3-dropdown
.panel {
  display: block;
  width: 100%;
}

.cba-search-v3
.cba-search-v3-dropdown
.section,
.cba-search-v3
.cba-search-v3-dropdown
.results-group {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.cba-search-v3
.cba-search-v3-dropdown
.section[hidden],
.cba-search-v3
.cba-search-v3-dropdown
.results-group[hidden] {
  display: none;
}

.cba-search-v3
.cba-search-v3-dropdown
.section > h3,
.cba-search-v3
.cba-search-v3-dropdown
.results-group > h3 {
  display: block;
  width: auto;
  margin: 15px 14px 9px;
  padding: 0;
  color: #111;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

/* Every result list must be a vertical stack. */
.cba-search-v3
.cba-search-v3-dropdown
.list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px;
}

/* Grid rows prevent the icon and copy from becoming centered. */
.cba-search-v3
.cba-search-v3-dropdown
.item,
.cba-search-v3
.cba-search-v3-dropdown
.loc-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 62px;
  margin: 0;
  padding: 10px 12px;
  gap: 12px;
  border: 0;
  border-radius: 11px;
  background: #f2f2f2;
  color: #111;
  text-align: left;
}

.cba-search-v3
.cba-search-v3-dropdown
.item:hover,
.cba-search-v3
.cba-search-v3-dropdown
.loc-item:hover,
.cba-search-v3
.cba-search-v3-dropdown
.item.kb-active,
.cba-search-v3
.cba-search-v3-dropdown
.loc-item.kb-active {
  background: #e6e6e6;
}

/* Fixed icon column. */
.cba-search-v3
.cba-search-v3-dropdown
.thumb {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid #d7d7d7;
  border-radius: 9px;
  background: #fafafa;
  color: #747474;
}

/* Copy fills the remaining row instead of becoming centered. */
.cba-search-v3
.cba-search-v3-dropdown
.meta {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.cba-search-v3
.cba-search-v3-dropdown
.name {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Business rows need additional vertical room. */
.cba-search-v3
#cba-biz-results
.item {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  min-height: 82px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.cba-search-v3
#cba-biz-results
.thumb {
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
}

.cba-search-v3
#cba-biz-results
.meta {
  padding-top: 1px;
}

.cba-search-v3
#cba-biz-results
.name {
  white-space: normal;
}

.cba-search-v3
#cba-biz-results
.sub {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Keep the submit icon visible against the black button. */
.cba-search-v3
.submit {
  background: #111;
  color: #fff;
}

.cba-search-v3
.submit:hover,
.cba-search-v3
.submit:focus-visible {
  background: #292929;
  color: #fff;
}

@media (max-width: 720px) {
  .cba-search-v3
  .cba-search-v3-dropdown
  .list {
    padding-right: 9px;
    padding-left: 9px;
  }

  .cba-search-v3
  .cba-search-v3-dropdown
  .item,
  .cba-search-v3
  .cba-search-v3-dropdown
  .loc-item {
    min-height: 58px;
    padding: 9px 10px;
  }

  .cba-search-v3
  .cba-search-v3-dropdown
  .section > h3,
  .cba-search-v3
  .cba-search-v3-dropdown
  .results-group > h3 {
    margin-right: 11px;
    margin-left: 11px;
  }
}

/*
 * CBA_SEARCH_V3_BUSINESS_IMAGES_SVG_PATH
 */

/*
 * Business result thumbnails use the actual company logo.
 * The JavaScript supplies the standard business fallback when no
 * logo is available or when the supplied image fails to load.
 */
.cba-search-v3
#cba-biz-results
img.thumb.business-thumb {
  display: block;
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7d7d7;
  border-radius: 9px;
  background: #f5f5f5;
  object-fit: cover;
  object-position: center;
}

/*
 * CBA_SEARCH_V3_EXACT_CSS_FIX
 */

/*
 * Keep the SVG container transparent.
 * Apply the visible color only to the artwork path.
 */
.cba-search-v3 .submit [icon="search"] {
    background: transparent;
    background-color: transparent;
}

.cba-search-v3 .submit svg {
    fill: none;
    stroke: none;
    background: transparent;
    background-color: transparent;
}

.cba-search-v3 .submit svg path {
    fill: #fff;
    stroke: none;
    color: #fff;
    opacity: 1;
}

.cba-search-v3 .cba-search-v3-dropdown .sub {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 2px 0 0;
    overflow: hidden;
    color: #6d6d6d;
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

