/* /css/passion_search_box.css */

/* --- Visibility primitives (prevent accidental full-screen overlay) --- */
[hidden] { display: none !important; }
.autocomplete-box[hidden] { display: none !important; }

/* JS will add/remove this on <body> when a dialog is open */
body.modal-open { overflow: hidden; }

/* --- Layout --- */
.search-bar-wrapper { margin: 12px 0 18px; }
.search-bar-wrapper h3 { margin: 0 0 10px; }

/* Input */
.cl1q-search-form input[type="search"],
.cl1q-search-form input[type="text"] {
  width: 320px;
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
}

/* Auto-complete */
.autocomplete-box {
  margin-top: 8px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,.08);
  max-width: 640px;
  padding: 6px;
}
.autocomplete-box .no-suggestion {
  padding: 10px;
  color: #666;
}

.autocomplete-box .no-suggestion-message {
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--color-text);
}

.autocomplete-box .no-suggestion-actions {
  font-size: var(--font-size-sm);
  color: #555;
}

/* ==========================================================
   Cl1Q Navigation v2 — Desktop Search
   ========================================================== */

.search-bar-wrapper--navbar {
  position: relative;
  margin: 0;
  width: 100%;
  min-width: 0;
  align-self: center;
}

.search-bar-wrapper--navbar .cl1q-search-form {
  margin: 0;
  width: 100%;
}

.search-bar-wrapper--navbar
.cl1q-search-form input[type="search"] {
  display: block;
  width: 100%;
  max-width: none;

  height: 36px;
  padding: 7px 11px;

  font-size: var(--font-size-sm);
  line-height: 1.2;

  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);

  background-color: var(--color-surface);
  color: var(--color-text);
}

.search-bar-wrapper--navbar
.cl1q-search-form input[type="search"]:focus {
  border-color: var(--color-accent);
  outline: 2px solid var(--color-accent-soft);
  outline-offset: 1px;
}

/* Results drop directly beneath navbar Search */
.search-bar-wrapper--navbar .autocomplete-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;

  width: min(420px, 80vw);
  max-width: none;
  margin-top: 0;

  z-index: 10000;
}

@media (max-width: 860px) {
  .search-bar-wrapper--navbar {
    display: block;
    order: 5;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    margin: 4px 0 0;
  }

  .search-bar-wrapper--navbar .cl1q-search-form {
    width: 100%;
  }

  .search-bar-wrapper--navbar
  .cl1q-search-form input[type="search"] {
    width: 100%;
    max-width: none;
    height: 40px;
    padding: 8px 12px;
  }

  .search-bar-wrapper--navbar .autocomplete-box {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin-top: 0;
  }
}

/* Fallback actions */
.fallback-line { margin-top: 8px; color: #555; }
.linklike {
  background: none; border: none; padding: 0; margin: 0 2px;
  color: #0a58ca; cursor: pointer; text-decoration: underline;
  font: inherit;
}
.linklike:hover { text-decoration: none; }
.linklike:focus-visible {
  outline: 2px solid #0a58ca;
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Modal overlay & dialog --- */
/* Default: overlay is NOT shown until JS adds .is-open */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;                 /* was flex; now off by default */
  justify-content: center;
  align-items: center;
  background-color: rgba(0,0,0,0.4);
}
.popup-overlay.is-open { display: flex; }

.popup-box {
  background: #fff;
  padding: 24px 30px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  width: 90%;
  max-width: 420px;
  max-height: 85vh;              /* keep it on-screen */
  overflow: auto;
}

/* Hide individual dialogs until opened */
.popup-box[hidden] { display: none !important; }

/* Dialog form fields */
.dialog-form input[type="text"],
.dialog-form input[type="email"] {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.dialog-form button[type="submit"] {
  width: 100%;
  padding: 10px;
  background-color: var(--color-accent, #4CAF50);
  color: #fff; font-weight: 600;
  border: none; border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}
.dialog-form button[type="submit"]:hover {
  background-color: #45a049;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.dialog-form button[type="submit"]:focus-visible {
  outline: 2px solid #2e7d32;
  outline-offset: 2px;
}

/* Close button */
.close-form-button {
  float: right;
  background: transparent; border: none;
  font-size: 20px; font-weight: 700;
  cursor: pointer; color: #888;
}
.close-form-button:hover { color: #000; }
.close-form-button:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Screen-reader only text */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Glow feedback after successful actions */
[data-cl1q-search-input].glow {
  box-shadow: 0 0 0 3px rgba(76,175,80,0.25);
  transition: box-shadow .25s ease;
}

/* Motion-reduction friendliness */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
