/* ═══════════════════════════════════════════════════════════
   Multi-step Search Flow (MSF) — homepage component
   Requires: css/main.css loaded first
   ═══════════════════════════════════════════════════════════ */

/* ─── Trigger pill ────────────────────────────────────────── */
.msf-trigger-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 16px 0 0 0;
  max-width: 600px;
}

.msf-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  background: white;
  border: 1.5px solid var(--parchment);
  border-radius: 50px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.msf-trigger svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--stone);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msf-trigger-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.msf-trigger-main {
  font-size: .9rem;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msf-trigger-sub {
  font-size: .72rem;
  color: var(--stone);
  margin-top: 1px;
}

.msf-trigger-clear {
  flex-shrink: 0;
  background: white;
  border: 1.5px solid var(--parchment);
  border-radius: 50px;
  cursor: pointer;
  display: none;
  padding: 10px 16px;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  white-space: nowrap;
  color: var(--charcoal);
  box-shadow: var(--shadow-md);
}

.msf-trigger-clear.visible {
  display: flex;
}

/* ─── Backdrop ────────────────────────────────────────────── */
.msf-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 1100;
}

.msf-backdrop.open {
  display: block;
}

/* ─── Sheet ───────────────────────────────────────────────── */
.msf-sheet {
  display: none;
  position: fixed;
  background: white;
  z-index: 1101;
  flex-direction: column;
  overflow: hidden;
}

.msf-sheet.open {
  display: flex;
}

@media (max-width: 768px) {
  .msf-sheet {
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 95%;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .msf-sheet.open {
    transform: translateY(0);
  }
}

@media (min-width: 769px) {
  .msf-sheet {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
  }

  .msf-trigger-wrap {
    margin: 16px 0 0 0;
  }

  .msf-trigger {
    margin: 0;
  }
}

/* ─── Handle pill (mobile only) ─────────────────────────── */
.msf-handle-wrap {
  display: none;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.msf-handle {
  width: 36px;
  height: 4px;
  background: var(--parchment);
  border-radius: 2px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .msf-handle-wrap {
    display: block;
  }
}

/* ─── Sheet header ────────────────────────────────────────── */
.msf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--parchment);
  flex-shrink: 0;
}

.msf-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mist);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
}

.msf-skip {
  font-size: .85rem;
  font-weight: 500;
  color: var(--charcoal);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.msf-step-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.msf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--parchment);
  transition: all .2s;
}

.msf-dot.active {
  background: var(--forest);
  width: 22px;
  border-radius: 4px;
}

/* ─── Steps ───────────────────────────────────────────────── */
.msf-step {
  flex: 1;
  overflow-y: auto;
  display: none;
}

.msf-step.active {
  display: block;
}

.msf-step-content {
  padding: 28px 24px;
}

.msf-heading {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 6px;
  line-height: 1.1;
}

.msf-sub {
  color: var(--stone);
  font-size: .875rem;
  margin-bottom: 28px;
}

/* ─── Step 1: Community ───────────────────────────────────── */
.msf-community-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msf-community-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border-radius: 16px;
  border: 1px solid var(--parchment);
  background: white;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}

.msf-community-card.selected {
  border-color: var(--forest);
  background: var(--cream);
}

.msf-community-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  border-radius: 50%;
}

.msf-community-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--forest);
}

.msf-community-name {
  font-weight: 600;
  font-size: .95rem;
  color: var(--charcoal);
}

.msf-community-desc {
  font-size: .78rem;
  color: var(--stone);
  margin-top: 2px;
}

/* ─── Step 2: Calendar ────────────────────────────────────── */
.msf-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.msf-cal-prev,
.msf-cal-next {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--mist);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
}

.msf-cal-month-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--charcoal);
}

.msf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.msf-cal-dow {
  text-align: center;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--stone);
  padding: 6px 0;
}

.msf-cal-day {
  text-align: center;
  padding: 10px 2px;
  font-size: .875rem;
  cursor: pointer;
  color: var(--charcoal);
  border-radius: 50%;
  transition: background .12s;
  position: relative;
  user-select: none;
}

.msf-cal-day.empty  { cursor: default; }
.msf-cal-day.past   { color: #c0b8b0; pointer-events: none; }

.msf-cal-day.sel-start,
.msf-cal-day.sel-end {
  background: var(--forest) !important;
  color: white;
  border-radius: 50%;
}

.msf-cal-day.in-range    { background: rgba(45, 74, 56, .1); border-radius: 0; }
.msf-cal-day.range-start { background: rgba(45, 74, 56, .1); border-radius: 50% 0 0 50%; }
.msf-cal-day.range-end   { background: rgba(45, 74, 56, .1); border-radius: 0 50% 50% 0; }

.msf-cal-day:not(.past):not(.empty):hover {
  background: var(--parchment);
  border-radius: 50%;
}

/* ─── Step 3: Guests ──────────────────────────────────────── */
.msf-guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--parchment);
}

.msf-guest-row:last-child {
  border-bottom: none;
}

.msf-guest-label {
  font-weight: 600;
  font-size: .95rem;
  color: var(--charcoal);
}

.msf-guest-desc {
  font-size: .78rem;
  color: var(--stone);
  margin-top: 1px;
}

.msf-counter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msf-counter-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--parchment);
  background: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
  transition: border-color .15s;
  line-height: 1;
}

.msf-counter-btn:disabled {
  color: var(--parchment);
  border-color: var(--parchment);
  cursor: default;
}

.msf-counter-val {
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal);
  min-width: 20px;
  text-align: center;
}

/* ─── Sheet footer ────────────────────────────────────────── */
.msf-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--parchment);
  flex-shrink: 0;
  background: white;
}

.msf-back-btn {
  background: none;
  border: none;
  font-size: .9rem;
  font-weight: 500;
  color: var(--charcoal);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-body);
}

.msf-next-btn {
  background: var(--forest);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 30px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .18s ease, transform .12s ease;
}

.msf-next-btn:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
}

.msf-next-btn:active {
  transform: translateY(0);
  background: var(--forest-dark, #1e3326);
}

.msf-next-btn.search {
  background: var(--clay);
}

.msf-next-btn.search:hover {
  background: var(--clay-dark);
}
