/* Care House Booking — floating search bar + modal.
   Brand: teal pill (--c-green #49D4AB) + indigo CTA (--c-primary #230F57).
   Theme tokens are defined on :root by the child theme; fallbacks included
   so the plugin still renders sanely if the theme ever changes. */

.chb-wrap { position: relative; z-index: 5; width: 100%; }
/* Inside the hero, the widgets wrap is flex-row — make the bar take a full row */
.chs-hero .elementor-widget-shortcode { flex: 1 1 100% !important; width: 100% !important; margin-top: 28px; }

.chb-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--c-green, #49D4AB);
  border-radius: 999px; padding: 10px 14px;
  box-shadow: 0 14px 38px rgba(35, 15, 87, .30);
}
.chb-field {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  transition: background-color .22s ease, transform .22s ease;
}
/* gentle micro-interactions on the filter fields */
.chb-field:hover { background: rgba(255,255,255,.10); }
.chb-field:focus-within { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.chb-field:focus-within .chb-ic { animation: chbIcPop .3s ease; }
@keyframes chbIcPop {
  0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); }
}
/* focus underline sweep (grows from the start edge) */
.chb-select::before {
  content: ""; position: absolute; bottom: 0; inset-inline-start: 0;
  height: 2px; width: 100%; background: #fff;
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.chb-field:focus-within .chb-select::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .chb-options.is-open, .chb-options li, .chb-field:focus-within .chb-ic { animation: none; }
  .chb-select::before { transition: none; }
}
.chb-field + .chb-field { border-inline-start: 1px solid rgba(255,255,255,.35); }
.chb-ic { color: #fff; display: inline-flex; flex: 0 0 auto; }

.chb-select { position: relative; flex: 1 1 auto; min-width: 0; }
.chb-input {
  width: 100%; background: transparent; border: 0;
  border-bottom: 1.5px solid rgba(255,255,255,.75);
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 6px 2px 8px; outline: none; cursor: pointer;
}
.chb-input::placeholder { color: rgba(255,255,255,.92); }
.chb-input:focus { border-bottom-color: #fff; }
/* chevron */
.chb-select::after {
  content: ""; position: absolute; inset-inline-end: 2px; top: 50%;
  width: 8px; height: 8px; margin-top: -7px;
  border-inline-end: 2px solid #fff; border-block-end: 2px solid #fff;
  transform: rotate(45deg); pointer-events: none; opacity: .9;
}

.chb-options {
  position: absolute; top: calc(100% + 8px); inset-inline: -6px;
  max-height: 260px; overflow-y: auto;
  background: var(--c-card, #fff); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(35, 15, 87, .22);
  list-style: none; margin: 0; padding: 6px; z-index: 60;
  display: none; min-width: 220px;
}
.chb-options.is-open { display: block; animation: chbDrop .22s cubic-bezier(.3,.9,.4,1); }
@keyframes chbDrop {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.chb-options li { animation: chbItem .25s ease backwards; }
.chb-options li:nth-child(-n+8) { animation-delay: calc(var(--chb-i, 0) * 0ms); }
@keyframes chbItem {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.chb-options li {
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px;
  color: var(--c-text, #454152); cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.chb-options li:hover, .chb-options li.is-active { background: var(--c-bg-soft, #F1EFF8); color: var(--c-primary, #230F57); }
.chb-options li.chb-empty { color: #999; cursor: default; background: none; }

.chb-cta {
  flex: 0 0 auto; border: 0; cursor: pointer;
  background: var(--c-primary, #230F57); color: #fff;
  font-weight: 700; font-size: 14.5px;
  padding: 12px 28px; border-radius: 999px;
  transition: background-color .2s ease, transform .15s ease;
}
.chb-cta:hover { background: var(--c-primary-alt, #362170); transform: translateY(-1px); }

/* ── Modal ── */
.chb-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 16, 42, .55); padding: 16px;
}
.chb-modal[hidden] { display: none; }
.chb-modal__box {
  position: relative; width: 100%; max-width: 520px;
  background: var(--c-card, #fff); border-radius: 16px;
  padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
  max-height: 90vh; overflow-y: auto;
}
.chb-modal__close {
  position: absolute; top: 10px; inset-inline-start: 14px;
  border: 0; background: none; font-size: 26px; line-height: 1;
  color: var(--c-text, #454152); cursor: pointer;
}
.chb-modal h3 { margin: 0 0 6px; color: var(--c-heading, #230F57); font-size: 20px; }
.chb-summary { font-size: 13px; color: var(--c-text, #454152); background: var(--c-bg-soft, #F1EFF8); border-radius: 10px; padding: 10px 14px; margin: 10px 0 16px; line-height: 1.9; }
#chb-form label { display: block; font-size: 13.5px; font-weight: 600; color: var(--c-heading, #230F57); margin-bottom: 14px; }
#chb-form input, #chb-form textarea {
  display: block; width: 100%; margin-top: 6px;
  border: 1.5px solid var(--c-border, #E4E1EE); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: var(--c-bg, #fff);
  color: var(--c-text, #454152); outline: none; box-sizing: border-box;
}
#chb-form input:focus, #chb-form textarea:focus { border-color: var(--c-green, #49D4AB); }
.chb-hp { position: absolute !important; opacity: 0; height: 0; width: 0; pointer-events: none; }
.chb-cta--block { display: block; width: 100%; border-radius: 12px; }
.chb-error { color: #C0392B; font-size: 13px; margin: 10px 0 0; }

.chb-step[data-step="done"] { text-align: center; padding: 12px 0; }
.chb-done__icon {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--c-green, #49D4AB); color: #fff; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}
.chb-cta--wa { display: inline-block; margin-top: 14px; text-decoration: none; background: #25D366; }
.chb-cta--wa:hover { background: #1EBE5A; }

/* ── Responsive: stack fields ── */
@media (max-width: 992px) {
  .chb-bar { flex-wrap: wrap; border-radius: 20px; padding: 14px; gap: 2px; }
  .chb-field { flex: 1 1 100%; padding: 8px 4px; }
  .chb-field + .chb-field { border-inline-start: 0; border-top: 1px solid rgba(255,255,255,.3); }
  .chb-cta { flex: 1 1 100%; margin-top: 10px; }
}
