/* Home discovery, scoped to preserve the other page profiles. DS-010. */
#pg-home .home-search-wrap {
  --home-search-accent: #FF6B00;
  max-width: 1040px;
  width: 100%;
  padding-inline: 24px;
  margin: 24px auto 0;
}
#pg-home .home-search {
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(14, 18, 24, .045);
}
#pg-home .home-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0;
}
#pg-home .home-search-row > .fg {
  min-width: 0;
  padding: 2px 16px;
  gap: 0;
  border-inline-end: 1px solid var(--border);
}
#pg-home .home-search-row label {
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
  letter-spacing: 0;
  text-transform: none;
}
#pg-home .home-search-row select {
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  width: 100%;
}
#pg-home .home-search-row select:focus-visible,
#pg-home .home-search-actions button:focus-visible,
#pg-home .home-carousel-arrow:focus-visible,
#pg-home .home-view-all:focus-visible,
#pg-home .home-spaces-rail:focus-visible {
  outline: 3px solid rgba(255, 107, 0, .4);
  outline-offset: 3px;
  box-shadow: none;
}
#pg-home #f-rental[aria-invalid="true"] { outline: 2px solid var(--danger-500); }
#pg-home .home-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline-start: 16px;
}
#pg-home .home-search-submit {
  background: var(--home-search-accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  padding: 12px;
  display: grid;
  place-items: center;
  box-shadow: none;
}
#pg-home .home-search-submit svg,
#pg-home .home-search-trigger > svg,
#pg-home .home-search-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#pg-home .home-search-submit:active { transform: scale(.96); }
#pg-home .home-search-trigger,
#pg-home .home-search-reset,
#pg-home .home-rental-options { display: none; }
#pg-home .home-search-panel { border: 0; padding: 0; }
#pg-home .home-search-hint { display: none; }
#pg-home .home-search-submit:hover { background: var(--orange-600); }
#pg-home .home-search-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink2);
  font: 600 12px var(--font-body);
  padding: 6px 4px;
  cursor: pointer;
  white-space: nowrap;
}
#pg-home .home-search-help:hover { color: var(--home-search-accent); }
#pg-home .home-search-help svg { width: 16px; height: 16px; }
#pg-home .home-search-hint,
#pg-home .home-search-error {
  margin: 6px 16px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink2);
}
#pg-home .home-search-error { color: var(--danger-500); font-weight: 600; }
#pg-home .home-search-error[hidden] { display: none; }
#pg-home .home-results-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}
#pg-home .home-results-section .section-head {
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
#pg-home .home-results-actions { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
#pg-home .home-view-all { font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
#pg-home .home-carousel-controls { display: flex; gap: 6px; }
#pg-home .home-carousel-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
#pg-home .home-carousel-arrow:hover:not(:disabled) { border-color: var(--ink2); background: var(--bg-app); }
#pg-home .home-carousel-arrow:disabled { opacity: .3; cursor: default; }
#pg-home .home-carousel-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="ltr"] #pg-home .home-carousel-arrow svg { transform: rotate(180deg); }
#pg-home .home-spaces-rail {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block: 4px 12px;
}
#pg-home .home-spaces-rail::-webkit-scrollbar { display: none; }
#pg-home .home-spaces-rail > .space-card {
  min-width: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: none;
  background: transparent;
  scroll-snap-align: start;
}
#pg-home .home-spaces-rail > .space-card:hover { transform: none; box-shadow: none; }
#pg-home .home-spaces-rail .card-thumb { height: auto; aspect-ratio: 4 / 3; border-radius: 20px; }
#pg-home .home-spaces-rail .card-slider { position: absolute; inset: 0; height: 100%; }
#pg-home .home-spaces-rail .share-btn { position: absolute; }
#pg-home .home-spaces-rail .card-body { padding: 16px 2px 4px; }
#pg-home .home-spaces-rail .card-name { font-size: 17px; }
#pg-home .home-spaces-rail .card-footer { flex-wrap: wrap; gap: 12px; }
#pg-home .home-spaces-rail .card-tip { border-radius: 12px; }
#pg-home .home-spaces-rail > :only-child:not(.space-card) { grid-column: 1 / -1; width: 100%; }
#pg-home .home-spaces-rail:has(> :only-child:not(.space-card)) { grid-auto-columns: 100%; }
@media (max-width: 1000px) {
  #pg-home .home-search-row > .fg { padding-inline: 10px; }
  #pg-home .home-search-actions { padding-inline-start: 10px; }
  #pg-home .home-spaces-rail { grid-auto-columns: calc((100% - 20px) / 2); }
}
@media (max-width: 720px) {
  #pg-home .home-search-wrap { padding-inline: 16px; margin-block: 20px; }
  #pg-home #home-search-inline { display: none; }
  #pg-home .home-search-trigger {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px;
    padding: 12px 20px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--ink); font: inherit; text-align: start;
    box-shadow: 0 4px 16px rgba(14, 18, 24, .06); cursor: pointer;
  }
  #pg-home .home-search-trigger-copy { display: grid; gap: 3px; min-width: 0; }
  #pg-home .home-search-trigger-copy strong { font-size: 14px; font-weight: 700; }
  #pg-home .home-search-trigger-copy > span { font-size: 11px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #pg-home .home-search-trigger > svg { flex-shrink: 0; }
  #pg-home .home-search-trigger:focus-visible { outline: 3px solid rgba(255, 107, 0, .4); outline-offset: 3px; }
  #pg-home .home-search-panel {
    width: calc(100% - 24px); max-width: 480px; max-height: calc(100dvh - 24px);
    margin: auto; border-radius: 24px; background: var(--bg-app); color: var(--ink);
    overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 20px 60px rgba(14, 18, 24, .18);
  }
  #pg-home .home-search-panel::backdrop { background: rgba(14, 18, 24, .35); }
  #pg-home .home-search-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1;
  }
  #pg-home .home-search-panel-head h2 { font-size: 17px; line-height: 1.5; margin: 0; }
  #pg-home .home-search-close {
    display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0;
    border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
  }
  #pg-home .home-search-panel .home-search { display: flex; flex-direction: column; padding: 16px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  #pg-home .home-search-row { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  #pg-home .home-search-row > .fg { padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
  #pg-home .home-rental-field { order: -1; }
  #pg-home #f-rental { display: none; }
  #pg-home .home-rental-options { display: block; }
  #pg-home .home-rental-options summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding-block: 8px; font-size: 16px; cursor: pointer; list-style: none; }
  #pg-home .home-rental-options summary::-webkit-details-marker { display: none; }
  #pg-home .home-rental-options summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; flex-shrink: 0; }
  #pg-home .home-rental-options[open] summary svg { transform: rotate(180deg); }
  #pg-home .home-rental-options summary:focus-visible { outline: 3px solid rgba(255, 107, 0, .4); outline-offset: 3px; border-radius: 8px; }
  #pg-home .home-rental-options summary[aria-invalid="true"] { outline: 2px solid var(--danger-500); border-radius: 8px; }
  #pg-home .home-rental-choices { display: grid; gap: 8px; padding-block-start: 8px; }
  #pg-home .home-rental-choices .home-rental-choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
  #pg-home .home-rental-choice:has(input:checked) { border-color: var(--home-search-accent); background: var(--orange-50); }
  #pg-home .home-rental-choice input { width: 18px; height: 18px; min-height: 18px; padding: 0; margin-top: 4px; flex-shrink: 0; accent-color: var(--home-search-accent); }
  #pg-home .home-rental-choice > span { display: grid; gap: 4px; min-width: 0; }
  #pg-home .home-rental-choice strong { font-size: 14px; }
  #pg-home .home-rental-choice small { font-size: 12px; font-weight: 400; line-height: 1.7; color: var(--ink2); }
  #pg-home .home-search-row label { font-size: 14px; font-weight: 700; }
  #pg-home .home-search-row select { font-size: 16px; padding: 8px 0; }
  #pg-home .home-search-actions {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
    padding: 14px 0 0; background: var(--bg-app); position: sticky; bottom: 0;
  }
  #pg-home .home-search-submit { grid-column: 3; grid-row: 1; width: 52px; height: 52px; min-height: 52px; }
  #pg-home .home-search-help { grid-column: 2; grid-row: 1; justify-self: end; }
  #pg-home .home-search-reset { display: block; grid-column: 1; grid-row: 1; min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: var(--ink); font: 700 13px var(--font-body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
  #pg-home .home-search-hint, #pg-home .home-search-error { display: block; order: -1; margin: 0 0 14px; font-size: 12px; }
  #pg-home .home-search-hint { display: none; }
  #pg-home .home-results-section { padding: 24px 16px 32px; }
  #pg-home .home-results-section .section-head { flex-direction: column; align-items: stretch; gap: 12px; }
  #pg-home .home-results-actions { justify-content: space-between; }
  #pg-home .home-spaces-rail { grid-auto-columns: 86%; gap: 16px; }
}
body.home-search-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  #pg-home .home-spaces-rail { scroll-behavior: auto; }
}
