/* =============================================================================
   search-drawer.css
   Search panel anchored below header — matches digicert.com pattern.
   Loaded via loadCSS() from header.js
   ============================================================================= */

/* ── Trigger (reuses .nav-tool-icon from header) ─────────────────────────── */

.search-drawer-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.search-drawer-trigger:hover,
.search-drawer-trigger:focus {
  background: none;
}

/* ── Panel ────────────────────────────────────────────────────────────────── */

.search-drawer-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 101;
  background: var(--background-color, #fff);
  border-top: 1px solid var(--border-color, #d2dce3);
  box-shadow: var(--panel-shadow);
  clip-path: var(--panel-clip-below);
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(-1 * var(--translate-sm)));
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    visibility 0ms var(--duration-normal);
}

.search-drawer-panel.search-drawer-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    visibility 0ms 0ms;
}

/* ── Content ─────────────────────────────────────────────────────────────── */

.search-drawer-content {
  max-width: var(--container-max-width, 1248px);
  margin: 0 auto;
  padding: var(--space-l, 24px) var(--container-padding, 1.5rem) var(--space-xl, 32px);
}

/* ── Search form ─────────────────────────────────────────────────────────── */

.search-drawer-form {
  margin-bottom: var(--space-l, 24px);
  border-bottom: 1px solid var(--border-color, #d2dce3);
  padding-bottom: var(--space-l, 24px);
}

.search-drawer-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-m, 16px);
}

.search-drawer-search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  width: var(--icon-size-m, 24px);
  height: var(--icon-size-m, 24px);
}

.search-drawer-search-icon img {
  width: 100%;
  height: 100%;
}

.search-drawer-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--body-font-family, 'Roboto', sans-serif);
  font-size: var(--heading-font-size-s, 20px);
  font-weight: var(--font-weight-regular, 400);
  color: var(--text-color, #222);
  min-width: 0;
}

.search-drawer-input::placeholder {
  color: var(--digicert-neutral-400, #abb6bf);
}

/* Hide browser clear button — we have our own close */
.search-drawer-input::-webkit-search-cancel-button {
  display: none;
}

.search-drawer-close {
  --search-drawer-close-size: 20px;

  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs, 4px);
  color: var(--digicert-neutral-500, #909ca5);
  border-radius: var(--border-radius-s, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--search-drawer-close-size);
  height: var(--search-drawer-close-size);
  position: relative;
  transition: color var(--duration-fast, 150ms) ease;
}

.search-drawer-close::before,
.search-drawer-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: currentcolor;
  border-radius: 1px;
}

.search-drawer-close::before {
  transform: rotate(45deg);
}

.search-drawer-close::after {
  transform: rotate(-45deg);
}

.search-drawer-close:hover,
.search-drawer-close:focus {
  color: var(--text-color, #222);
  background: none;
}

/* ── Recommended links ───────────────────────────────────────────────────── */

.search-drawer-links-heading {
  font-family: var(--body-font-family, 'Roboto', sans-serif);
  font-size: var(--body-font-size-xs, 14px);
  font-weight: var(--font-weight-regular, 400);
  color: var(--digicert-neutral-500, #909ca5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-m, 16px);
}

.search-drawer-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-s, 8px);
}

.search-drawer-links-list a {
  display: block;
  padding: var(--space-xs, 4px) 0;
  font-family: var(--body-font-family, 'Roboto', sans-serif);
  font-size: var(--body-font-size-s, 16px);
  color: var(--text-color, #222);
  text-decoration: none;
  transition: color var(--duration-fast, 150ms) ease;
}

.search-drawer-links-list a:hover {
  color: var(--digicert-blue, #0174c3);
}

/* ==========================================================================
   Desktop (>= 900px)
   ========================================================================== */

@media (width >= 900px) {
  .search-drawer-content {
    padding: var(--space-xl, 32px) var(--container-padding, 32px) var(--space-2xl, 40px);
  }

  .search-drawer-input {
    font-size: var(--heading-font-size-m, 32px);
  }

  /* 3-column grid for recommended links */
  .search-drawer-links-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s, 8px) var(--space-xl, 32px);
  }
}
