/* ==========================================================================
   Search bar — mobile first (valori Figma × --figma-px)
   ========================================================================== */

.search-bar {
  padding-block: calc(var(--figma-px) * 16);
  padding-inline: 0;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-white);
  border-bottom: 1px solid var(--color-white);
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}

.search-bar__form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: calc(var(--figma-px) * 96);
  background-color: var(--color-athens-gray-2);
  border: calc(var(--figma-px) * 1.39) solid var(--color-border-gray);
  border-radius: calc(var(--figma-px) * 31.22);
}

.search-bar__field {
  display: contents;
}

.search-bar__icon {
  position: absolute;
  top: 50%;
  left: calc(var(--figma-px) * 31);
  z-index: 1;
  width: calc(var(--figma-px) * 26);
  height: calc(var(--figma-px) * 26);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  height: 100%;
  padding-block: calc(var(--figma-px) * 23.42);
  padding-left: calc(var(--figma-px) * 93.67);
  padding-right: calc(var(--figma-px) * 31.22);
  border: 0;
  border-radius: inherit;
  background: transparent;
  font-family: var(--font-body);
  font-size: min(32px, 4.571vw);
  font-size: calc(var(--figma-px) * 32);
  font-weight: 400;
  line-height: calc(var(--figma-px) * 41.6);
  color: var(--color-oxford-blue);
}

.search-bar__input::placeholder {
  color: var(--color-pale-sky);
  opacity: 1;
}

.search-bar__input:focus {
  outline: 2px solid var(--color-nolves-blue);
  outline-offset: 2px;
}

.search-bar__input::-webkit-search-decoration,
.search-bar__input::-webkit-search-cancel-button {
  appearance: none;
}

/* Desktop — min-width 768px
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .search-bar {
    padding-block: 16px;
    padding-inline: 0;
    box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
  }

  .search-bar__form {
    gap: 10px;
    height: auto;
    background-color: transparent;
    border: 0;
    border-radius: 0;
  }

  .search-bar__field {
    display: flex;
    position: relative;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    height: 45px;
    background-color: var(--color-athens-gray-2);
    border: 1.39px solid var(--color-border-gray);
    border-radius: 20px;
  }

  .search-bar__icon {
    left: 31px;
    width: 25px;
    height: 25px;
  }

  .search-bar__input {
    padding-block: 10px;
    padding-left: 93.67px;
    padding-right: 30px;
    font-size: var(--fs-body-desktop);
    line-height: var(--lh-body-desktop);
  }

  .search-bar__submit[hidden] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 98px;
    width: 98px;
    height: 45px;
    padding: 13.27px 30px;
    background-color: var(--color-nolves-blue);
    border: 0;
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: var(--fs-cta-desktop);
    font-weight: var(--fw-cta-desktop);
    line-height: var(--lh-cta-desktop);
    color: var(--color-white);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 0 0 rgb(0 0 0 / 0%);
    transition:
      background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .search-bar__submit[hidden]:hover,
  .search-bar__submit[hidden]:focus-visible {
    background-color: color-mix(in srgb, var(--color-nolves-blue) 85%, transparent);
    box-shadow: 0 6px 6px rgb(0 0 0 / 15%);
  }
}
