/* SearchComponent - minimal mandatory styles */
/* Prefer global CSS; only layout/position not covered by global */
/* Satisfaction: search works smoothly on desktop and mobile */

/* ----- Trigger: mobile only, same style as other nav icons (grey); hidden on desktop ----- */
.search-component-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2a2a2a;
  cursor: pointer;
  flex-shrink: 0;
}

.search-component-trigger-icon {
  width: 2rem;
  height: 2rem;
  stroke: currentColor;
}

.search-component-trigger:hover {
  color: #2a2a2a;
  opacity: 0.85;
}

@media (min-width: 992px) {
  .search-component-trigger {
    display: none !important;
  }
}

/* ----- Expandable: on desktop always visible; on mobile hidden until .search-component.is-open ----- */
.search-component-expandable {
  display: flex;
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

@media (max-width: 991px) {
  .search-component-expandable {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    z-index: 1060;
    background: #2a2a2a;
  }

  /* When open on mobile: break out of nav and span full viewport width (overlay already full screen) */
  .search-component.is-open .search-component-expandable {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--search-expandable-top, 71px);
    width: 100%;
    max-width: 100vw;
    margin-top: 0;
    padding: 0.75rem 1rem 1rem;
    box-sizing: border-box;
  }
}

/* ----- Overlay: mobile only when search open; dims content below nav only ----- */
.search-component-overlay {
  display: none;
  position: fixed;
  top: var(--search-expandable-top, 72px);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1055;
}

@media (max-width: 991px) {
  .search-component.is-open .search-component-overlay {
    display: block;
  }
  /* No overlay on search results page */
  .search-component.is-open.search-component--no-overlay .search-component-overlay {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .search-component-overlay {
    display: none !important;
  }
}

/* Match nav bar: grow to fill space, wide enough for full placeholder */
.search-component {
  flex: 1 1 0%;
  min-width: 410px;
  max-width: 760px;
  padding-left: 2rem;
  width: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
}

@media (min-width: 992px) {
  .search-component-expandable {
    flex: 1 1 0%;
  }
}

/* Mobile: reduce min-width so search bar fits; when closed show only trigger */
@media (max-width: 991px) {
  .search-component {
    min-width: 0;
    padding-left: 0.25rem;
    padding-right: 0;
  }

  .search-component.is-open .search-component-trigger {
    color: #d5181a;
  }

  .search-component-trigger {
    width: 3rem;
    height: 3rem;
    min-width: 48px;
    min-height: 48px;
  }

  .search-component-trigger-icon {
    width: 25px;
    height: 24px;
  }
}

@media (max-width: 575px) {
  .search-component {
    padding-left: 0.25rem;
  }
}

.search-component-bar {
  width: 100%;
}

/* Unified search bar: input + button aligned, no gap, shared height */
.search-component-form {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  gap: 0;
}

.search-component-form .search-input-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

/* Nav bar input height: substantial, aligned with logo and other nav elements */
.search-component-form .form-control {
  width: 100%;
  height: 4rem;
  padding: 0.5rem 3rem 1rem 0.75rem;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  margin: 0;
  line-height: 1.5;
}

.search-component-form .form-control:focus {
  outline: none;
  box-shadow: none;
  border-color: #6c757d;
}

/* Fixed-width red button, white icon, flush right of input; height matches input */
.search-component-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  align-self: stretch;
  padding: 0;
  margin: 0;
  margin-left: 0;
  background-color: #d5181a !important;
  background: #d5181a !important;
  color: #fff !important;
  border: 1px solid #d5181a !important;
  border-left: none !important;
  border-radius: 0;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  flex-shrink: 0;
}

.search-component-submit:hover {
  background-color: #b31416 !important;
  background: #b31416 !important;
  border-color: #b31416 !important;
  color: #fff !important;
}

/* Icon size proportional to nav bar height */
.search-component-submit-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  pointer-events: none;
  stroke: #fff;
  color: #fff;
}

.search-component-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0;
  background: var(--longos-white);
  /* border: 1px solid var(--longos-light-gray); */
  border-radius: 4px;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
  z-index: 1050;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.75rem;
}

.search-component-suggestions {
  padding: 0.25rem 0;
}

.search-component-suggestion {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.search-component-suggestion:hover {
  background: var(--longos-light-tan);
}

.search-component-result-item img,
.search-component-card-img {
  object-fit: cover;
  border-radius: 4px;
}

.search-component-result-card .search-component-result-info {
  min-width: 0;
}

.search-component-card-price-wrap {
  margin-top: 0.25rem;
}

/* Price style to match screenshot: dollars prominent, cents small superscript */
.search-component-price-main {
  color: var(--longos-dark-gray, #2a2a2a);
  font-size: 1.25rem;
  font-weight: 700;
}

.search-component-price-cents {
  font-size: 0.65em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  color: var(--longos-dark-gray, #2a2a2a);
}

.search-component-see-all-link {
  padding: 1rem 0;
  /* min-height: 44px; */
  display: flex;
  align-items: center;
  text-align: center;
}

.search-component-see-all-link:hover {
  opacity: 0.9;
}

.search-component-no-match {
  color: var(--longos-medium-gray, #6c757d);
  font-style: italic;
  text-align: center;
}

.search-component-clear {
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-component-clear-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: block;
  pointer-events: none;
}

.search-component-clear:hover .search-component-clear-icon {
  opacity: 0.85;
}

.search-highlight {
  background: rgba(200, 180, 160, 0.35);
  font-weight: 600;
  padding: 0 0.1em;
}

/* ========== Mobile: closed by default (icon); open = dark container + pointer, overlay; results align with input ========== */
@media (max-width: 991px) {
  .search-component {
    width: 100%;
    max-width: none;
    padding-left: 0.5rem;
    padding-right: 0.25rem;
  }

  /* Dark container with triangular pointer (speech-bubble tail) pointing up to search icon */
  .search-component-bar {
    position: relative;
    width: 100%;



    padding: 0.5rem;
  }

  .search-component-form {
    display: flex;
    width: 100%;
    min-width: 0;
  }

  /* Input takes all remaining space; button fixed width */
  .search-component-form .search-input-wrapper {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
  }

  .search-component-form .form-control {
    width: 100%;
    min-width: 0;
    height: 3.25rem;
    min-height: 44px;
    border-radius: 5px 0px 0px 5px;
    border: 1px solid transparent;
    background: #fff;
    color: #2a2a2a;
    box-sizing: border-box;
  }

  .search-component-form .form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: #6c757d;
  }

  .search-component-form .form-control::placeholder {
    color: var(--longos-medium-gray, #6c757d);
  }

  .search-component-expandable::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #2a2a2a;
    pointer-events: none;
  }

  .search-component-submit {
    width: 48px;
    min-width: 48px;
    flex-shrink: 0;
    border-radius: 0px 5px 5px 0px;
    background-color: #d5181a !important;
    border: none !important;
  }

  .search-component-submit-icon {
    width: 24px;
    height: 24px;
  }

  .search-component-clear {
    right: 0rem;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .search-component-clear-icon {
    width: 2.35rem;
    height: 2.35rem;
  }

  /* Results container: full width of input area (same as input wrapper), ends before red button */
  .search-component-dropdown {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin-top: -3px;
    border-radius: 0px 0px 5px 5px;
    /* box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); */
    max-height: 75vh;
    padding: 1rem;
    /* border: 1px solid rgba(0, 0, 0, 0.08); */
    background: var(--longos-white, #fff);
    box-sizing: border-box;
  }

  .search-component-suggestion {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .search-component-result-card {
    padding: 0.75rem 0;
    min-height: 56px;
  }

  .search-component-result-card .search-component-result-image img,
  .search-component-result-card .search-component-card-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
  }

  /* .search-component-result-card .search-component-result-info {
    font-size: 0.9375rem;
  } */

  /* .search-component-card-name {
    font-size: 1rem;
  } */

  .search-component-card-price-wrap {
    margin-top: 0.35rem;
  }

  .search-component-price-main {
    font-size: 1.125rem;
  }




}

@media (max-width: 575px) {
  .search-component.is-open .search-component-expandable {
    padding: 0.5rem 0.75rem 0.75rem;
  }

  .search-component {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .search-component-bar {
    border-radius: 10px;
    /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); */
  }

  .search-component-form .form-control {
    width: 100%;
    min-width: 0;
    height: 3rem;
    min-height: 44px;
    padding: 0.5rem 3rem 0.5rem 0.75rem;

    /* avoids zoom on focus in iOS */
    border-radius: 5px 0px 0px 5px;
    box-sizing: border-box;
  }

  .search-component-clear {
    right: 0.5rem;
  }

  .search-component-submit {
    width: 48px;
    min-width: 48px;
    border-radius: 0px 5px 5px 0px;
  }

  .search-component-submit-icon {
    width: 1.65rem;
    height: 1.65rem;
  }

  .search-component-dropdown {
    width: 100%;
    max-width: 100%;
    border-radius: 0px 0px 5px 5px;
    margin-top: -3px;
    padding: 0.75rem;
    max-height: 80vh;
    box-sizing: border-box;
  }

  .search-component-suggestion {
    padding: 0.65rem 0.75rem;
  }

  .search-component-result-card .search-component-result-image img,
  .search-component-result-card .search-component-card-img {
    width: 52px;
    height: 52px;
  }
}