@layer components {
  /* ============================================================
   * Digentus One Search Bar
   * Enterprise  Grade
   * ============================================================ */

  .d1-search-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    z-index: 100;
  }

  .d1-search--small {
    max-width: 320px;
  }

  .d1-search--large {
    max-width: 650px;
  }

  .d1-search-input-group {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid var(--dig-color-border);
    border-radius: 999px;
    overflow: hidden;
    background-color: var(--dig-color-bg-alt);
    transition:
      border-color 160ms ease,
      box-shadow 160ms ease,
      background-color 160ms ease;
  }

  .d1-search-input-group:hover {
    border-color: rgba(37, 209, 219, 0.38);
  }

  .d1-search-input-group:focus-within {
    border-color: rgba(37, 209, 219, 0.55);
    box-shadow:
      0 0 0 2px rgba(37, 209, 219, 0.08),
      0 14px 34px rgba(0, 0, 0, 0.24);
  }

  .d1-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 0 0 1rem;
    color: var(--dig-color-text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition:
      color 160ms ease,
      transform 160ms ease;
  }

  .d1-search-submit:hover {
    color: var(--dig-color-primary);
  }

  .d1-search-submit:active {
    transform: scale(0.96);
  }

  .d1-search-icon,
  .d1-search-submit .dashicons {
    width: 1em;
    height: 1em;
    line-height: 1;
  }

  .d1-search--small .d1-search-icon,
  .d1-search--small .d1-search-submit .dashicons {
    font-size: 1.15rem;
  }

  .d1-search--large .d1-search-icon,
  .d1-search--large .d1-search-submit .dashicons {
    font-size: 1.45rem;
  }

  .d1-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    outline: none;
    border: none;
    font-weight: 500;
    letter-spacing: -0.01em;
    background: transparent;
    color: var(--dig-color-text);
  }

  .d1-search-input::placeholder {
    color: var(--dig-color-text-muted);
    opacity: 0.86;
  }

  .d1-search--small .d1-search-input {
    padding: 0.65rem 1rem 0.65rem 0.55rem;
    font-size: 0.9rem;
  }

  .d1-search--large .d1-search-input {
    padding: 1rem 1.5rem 1rem 0.75rem;
    font-size: 1.1rem;
  }

  .d1-search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 1400;
    display: none;
    max-height: 450px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(
      180deg,
      rgba(10, 27, 41, 0.98),
      rgba(4, 14, 26, 0.98)
    );
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    box-shadow:
      0 28px 80px rgba(0, 0, 0, 0.46),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
  }

  .d1-search-dropdown::-webkit-scrollbar {
    width: 6px;
  }

  .d1-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
  }

  .d1-search-dropdown::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.32);
    border-radius: 999px;
  }

  .d1-search-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: rgba(37, 209, 219, 0.52);
  }

  .d1-search-item,
  .d1-search-suggestion-item {
    color: var(--dig-color-text) !important;
    border-bottom-color: rgba(148, 163, 184, 0.12) !important;
    transition:
      background-color 140ms ease,
      color 140ms ease;
  }

  .d1-search-item:hover,
  .d1-search-suggestion-item:hover,
  .d1-search-active {
    background: linear-gradient(
      90deg,
      rgba(37, 209, 219, 0.11),
      rgba(37, 209, 219, 0.035)
    ) !important;
  }

  @media (max-width: 1023px) {
    .d1-app-header-search .d1-search-input-group {
      height: 42px;
      border-color: rgba(148, 163, 184, 0.16);
      background: linear-gradient(
        180deg,
        rgba(5, 19, 34, 0.92),
        rgba(3, 14, 25, 0.92)
      );
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 10px 28px rgba(0, 0, 0, 0.2);
    }

    .d1-app-header-search .d1-search-input-group:focus-within {
      border-color: rgba(37, 209, 219, 0.55);
      box-shadow:
        0 0 0 2px rgba(37, 209, 219, 0.08),
        0 14px 34px rgba(0, 0, 0, 0.26);
    }

    .d1-app-header-search .d1-search-input {
      font-size: 0.88rem;
      color: rgba(226, 232, 240, 0.94);
    }

    .d1-app-header-search .d1-search-input::placeholder {
      color: rgba(148, 163, 184, 0.74);
    }

    .d1-app-header-search .d1-search-submit {
      color: rgba(148, 163, 184, 0.82);
    }
  }
}

