@use '@cfpb/cfpb-design-system/src/abstracts' as *;
@use '@cfpb/cfpb-design-system/src/elements/cfpb-button/cfpb-button' as *;
@use '@cfpb/cfpb-design-system/src/utilities/index' as *;

// Hide light DOM content.
::slotted(ul),
::slotted(ol) {
  display: none !important;
}

// This line-height settings is taken from base.scss.
button {
  // We need to override the user agent stylesheet for form controls (button, input, select, textarea).
  font: inherit;

  // If the base font is set smaller than 16px, we need to set a minimum height.
  min-height: 32px;
}

.o-form-search {
  position: relative;
  display: flex;
  flex-direction: column;
  row-gap: rem-from-px(15);

  // Tablet and above.
  @include respond-to-min($bp-sm-min) {
    flex-direction: row;
    border-left: 0;
    button[type='submit'] {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
      flex-basis: 25%;
    }
  }

  .container {
    position: relative;
    width: 100%;

    // We need to set inline-flex on the container so that the input's height is correct in Firefox/Safari.
    display: inline-flex;
  }

  .popup {
    display: none;
    position: absolute;
    top: rem-from-px(34);
    z-index: 100;
    background: white;
    border: 1px solid var(--pacific);
    border-top: 0;
    width: calc(100% - 2px);

    &::after {
      position: absolute;
      content: '';
      display: block;
      width: 100%;
      height: 1px;
      bottom: -1px;
      border-bottom: 1px solid var(--pacific);
    }
  }

  .popup.show {
    display: block;
  }
}
