/* ==========================================================================
   Stay search widget
   The pieces the guest search forms are built from: the labelled field, the
   guest stepper, the keyword field with suggestions, the destination picker
   and the Jalali range calendar. main.js drives every one of them; the home
   hero and the results bar differ only in how the fields are arranged.
   ========================================================================== */

/* ---------- Fields ---------- */
.search-field {position: relative; min-width: 0; display: grid; gap: 3px; padding: 10px 16px; border-radius: 18px; transition: background-color 180ms ease}
.search-field:hover {background: var(--soft)}
.search-field + .search-field::before {content: ""; position: absolute; top: 18px; bottom: 18px; inset-inline-start: 0; width: 1px; background: var(--border); transition: opacity 180ms ease}
.search-field:hover::before, .search-field:hover + .search-field::before {opacity: 0}
.search-field__label {padding-inline-start: 30px; color: var(--muted); font-size: .74rem; font-weight: 600}

/* ---------- Guest stepper ---------- */
.guest-count-stepper {width:100%; min-height:38px; display:grid; grid-template-columns:38px minmax(62px,1fr) 38px; align-items:center; margin-top:2px; overflow:hidden; border:1px solid var(--border); border-radius:12px; background:var(--soft); box-shadow:inset 0 1px 0 rgb(255 255 255 / 62%)}
.guest-count-stepper button {width:38px; height:38px; display:grid; place-items:center; padding:0; border:0; background:transparent; color:var(--brand); font:700 1.28rem/1 var(--font-ui); cursor:pointer; transition:background-color 160ms ease, color 160ms ease, transform 160ms ease}
.guest-count-stepper button:hover:not(:disabled) {background:var(--tint)}
.guest-count-stepper button:active:not(:disabled) {transform:scale(.92)}
.guest-count-stepper button:disabled {color:color-mix(in srgb, var(--muted) 56%, transparent); cursor:not-allowed}
.guest-count-stepper button:focus-visible {position:relative; z-index:1; outline:2px solid var(--brand); outline-offset:-2px}
.guest-count-stepper output {display:grid; place-items:center; min-width:0; padding:0 7px; color:var(--ink-strong); font-size:.86rem; font-weight:750; font-variant-numeric:tabular-nums; white-space:nowrap}

/* ---------- Keyword field and suggestions ---------- */
.search-field [aria-invalid="true"] {border-radius: 8px; outline: 2px solid var(--home-error); outline-offset: 4px}
.search-field--keyword {z-index: 3}
.search-query-input {min-height: 44px; display: flex; align-items: center; gap: 8px; border-radius: 10px}
.search-query-input > .ui-icon {width: 20px; height: 20px; flex: 0 0 20px; color: var(--brand)}
.search-query-input input {width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink-strong); font: 700 .9rem/1.4 var(--font-ui)}
.search-query-input input::placeholder {color: var(--muted); font-weight: 500; opacity: 1}
.search-query-input input::-webkit-search-cancel-button {display: none}
.search-query-input:focus-within {box-shadow: 0 0 0 3px var(--color-focus-ring)}
/* The field itself shows the focus ring; the bare input does not need a second one. */
.search-query-input input:focus-visible,
.destination-panel__search input:focus-visible {outline: 0}
.search-query-clear {width: 44px; height: 44px; display: grid; flex: 0 0 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); cursor: pointer}
.search-query-clear .ui-icon {width: 16px; height: 16px}
.search-query-clear[hidden],
[data-search-nights][hidden],
[data-search-calendar-clear][hidden] {display: none}
.search-query-suggestions {position: absolute; z-index: 30; top: calc(100% + 7px); inset-inline-start: 7px; width: min(370px, calc(100vw - 32px)); max-height: min(360px, 56vh); overflow-y: auto; padding: 7px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--elev-3); overscroll-behavior: contain}
.search-query-suggestions[hidden] {display: none}
.search-query-suggestions__label {display: block; padding: 7px 9px 5px; color: var(--muted); font-size: .7rem; font-weight: 700}
.search-query-suggestions button {width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 9px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: start; font-family: var(--font-ui); cursor: pointer}
.search-query-suggestions button:hover,
.search-query-suggestions button:focus-visible,
.search-query-suggestions button[aria-selected="true"] {outline: 0; background: var(--tint); color: var(--brand-dark)}
.search-query-suggestions button > span {min-width: 0; display: grid; gap: 1px}
.search-query-suggestions b {overflow: hidden; font-size: .84rem; white-space: nowrap; text-overflow: ellipsis}
.search-query-suggestions small {color: var(--muted); font-size: .7rem}
.search-query-suggestions .ui-icon {width: 17px; height: 17px; flex: 0 0 17px; color: var(--brand)}
.search-query-suggestions button .search-query-suggestions__chevron {margin-inline-start: auto; color: var(--muted)}
.search-query-suggestions button:hover .search-query-suggestions__chevron,
.search-query-suggestions button:focus-visible .search-query-suggestions__chevron,
.search-query-suggestions button[aria-selected="true"] .search-query-suggestions__chevron {color: var(--brand)}

/* ---------- Destination and Jalali-calendar dialogs (used by main.js) ---------- */
.destination-picker{position:relative}.destination-picker__trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:0;border:0;color:#fff;background:transparent;text-align:right;cursor:pointer}.destination-picker__trigger>span{min-width:0}.destination-picker__trigger b,.destination-picker__trigger small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.destination-picker__trigger b{font-size:.86rem}.destination-picker__trigger small{margin-top:1px;color:rgba(255,255,255,.58);font-size:.61rem;font-weight:400}.destination-picker__trigger>.ui-icon{width:21px;height:21px;flex:0 0 21px;color:#f2b8cc}.destination-panel{position:absolute;z-index:40;top:calc(100% + 18px);right:-24px;width:min(570px,calc(100vw - 40px));max-height:min(610px,72vh);padding:18px;border:1px solid #eadde2;border-radius:20px;color:var(--ink);background:#fff;box-shadow:0 26px 80px rgba(26,15,20,.3);overflow:hidden}.destination-panel[hidden]{display:none}.destination-panel__header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.destination-panel__header b,.destination-panel__header small{display:block}.destination-panel__header b{font-family:Peyda,IRANSansX,sans-serif;font-size:1.05rem}.destination-panel__header small{margin-top:2px;color:var(--muted);font-size:.68rem}.destination-panel__header button{display:grid;width:44px;height:44px;padding:0;place-items:center;border:0;border-radius:12px;color:var(--ink);background:var(--soft);cursor:pointer}.destination-panel__header button .ui-icon{width:20px;height:20px}.destination-panel__search{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 13px;border:1px solid var(--border);border-radius:13px;background:#fff}.destination-panel__search:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px rgba(142,23,79,.1)}.destination-panel__search .ui-icon{width:20px;height:20px;flex:0 0 20px;color:var(--muted)}.destination-panel__search input{width:100%;height:46px;padding:0;border:0;outline:0;color:var(--ink);background:transparent;font-family:inherit}.destination-panel__tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:13px 0;padding:4px;border-radius:12px;background:var(--soft)}.destination-panel__tabs button{min-height:40px;border:0;border-radius:9px;color:var(--muted);background:transparent;font-weight:700;cursor:pointer}.destination-panel__tabs button.is-active{color:var(--brand);background:#fff;box-shadow:0 3px 12px rgba(49,27,37,.08)}.destination-options{max-height:370px;overflow:auto;overscroll-behavior:contain;padding-left:4px}.destination-options[hidden]{display:none}.destination-options__heading{display:block;margin:10px 2px 8px;color:var(--muted);font-size:.65rem}.destination-options__popular{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:14px}.destination-options__popular button{min-height:68px;padding:10px;border:1px solid #eadde2;border-radius:12px;color:var(--ink);background:#fffafc;cursor:pointer}.destination-options__popular b,.destination-options__popular small{display:block}.destination-options__popular b{font-size:.78rem}.destination-options__popular small{margin-top:2px;color:var(--muted);font-size:.6rem}.destination-options__list{display:grid;grid-template-columns:1fr 1fr;gap:2px 8px}.destination-options__list button{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:8px 10px;border:0;border-radius:10px;color:var(--ink);background:transparent;text-align:right;cursor:pointer}.destination-options__list button:hover,.destination-options__list button:focus-visible,.destination-options button.is-selected{color:var(--brand);background:var(--tint);outline:0}.destination-options__list button span{min-width:0}.destination-options__list b,.destination-options__list small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.destination-options__list b{font-size:.76rem}.destination-options__list small{margin-top:2px;color:var(--muted);font-size:.58rem}.destination-options__list .ui-icon{width:16px;height:16px;flex:0 0 16px;color:var(--muted)}.destination-option__arrow{flex:0 0 auto;color:var(--muted);font-size:.9rem}.destination-panel__empty{margin:20px 0;color:var(--muted);font-size:.78rem;text-align:center}
.destination-options__global{display:grid;width:100%;grid-template-columns:42px minmax(0,1fr) 20px;align-items:center;gap:11px;min-height:64px;margin-bottom:12px;padding:10px 12px;border:1px solid #dfc6d1;border-radius:14px;color:var(--brand-dark);background:#fff8fb;text-align:right;cursor:pointer}.destination-options__global:hover,.destination-options__global:focus-visible{border-color:var(--brand);outline:3px solid rgba(142,23,79,.12)}.destination-options__global-icon{display:grid;width:42px;height:42px;place-items:center;border-radius:12px;color:var(--brand);background:var(--tint)}.destination-options__global-icon .ui-icon{width:22px;height:22px}.destination-options__global>span:nth-child(2){min-width:0}.destination-options__global b,.destination-options__global small{display:block}.destination-options__global b{font-size:.8rem}.destination-options__global small{margin-top:2px;color:var(--muted);font-size:.59rem}.destination-options__global-check{width:18px;height:18px;color:transparent}.destination-options__global.is-selected .destination-options__global-check{color:var(--brand)}
.search-date-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:44px;padding:0;border:0;color:#fff;background:transparent;text-align:right;cursor:pointer}.search-date-trigger>span{min-width:0}.search-date-trigger b,.search-date-trigger small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-date-trigger b{font-size:.82rem}.search-date-trigger small{margin-top:1px;color:rgba(255,255,255,.58);font-size:.59rem;font-weight:400}.search-date-trigger>.ui-icon{width:20px;height:20px;flex:0 0 20px;color:#f2b8cc}.search-date-trigger.has-value b{color:#fff}.search-date-trigger:focus-visible,.search-calendar-panel button:focus-visible{outline:3px solid rgba(142,23,79,.22);outline-offset:2px}.search-field .search-date-trigger[aria-invalid=true]{outline:3px solid #ffb5a3;outline-offset:3px;border-radius:8px}
.search-calendar-panel{position:fixed;z-index:240;top:50%;left:50%;width:min(470px,calc(100vw - 32px));max-height:calc(100svh - 40px);padding:18px;overflow:auto;transform:translate(-50%,-50%);border:1px solid #eadde2;border-radius:22px;color:var(--ink);background:#fff;box-shadow:0 30px 100px rgba(25,14,19,.42)}.search-calendar-panel[hidden]{display:none}.search-calendar-panel__header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.search-calendar-panel__header b,.search-calendar-panel__header small{display:block}.search-calendar-panel__header b{font-family:Peyda,IRANSansX,sans-serif;font-size:1.1rem}.search-calendar-panel__header small{min-height:20px;margin-top:2px;color:var(--muted);font-size:.7rem}.search-calendar-panel__header>button{display:grid;width:44px;height:44px;padding:0;place-items:center;border:0;border-radius:12px;color:var(--ink);background:var(--soft);cursor:pointer}.search-calendar-panel__header .ui-icon{width:20px;height:20px}.search-calendar-panel__toolbar{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:12px;padding:9px 0;border-block:1px solid var(--border)}.search-calendar-panel__toolbar button{display:grid;width:44px;height:44px;padding:0;place-items:center;border:0;border-radius:12px;color:var(--brand);background:var(--tint);cursor:pointer}.search-calendar-panel__toolbar button:disabled{color:#bcb3b7;background:var(--soft);cursor:not-allowed}.search-calendar-panel__toolbar .ui-icon{width:20px;height:20px}.search-calendar-panel__toolbar strong{text-align:center;font-family:Peyda,IRANSansX,sans-serif;font-size:.95rem}.search-calendar-panel__months{padding-top:12px}.search-calendar-panel__month[hidden]{display:none}.search-calendar-panel__weekdays,.search-calendar-panel__days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.search-calendar-panel__weekdays{margin-bottom:5px}.search-calendar-panel__weekdays span{padding:5px 0;color:var(--muted);font-size:.68rem;font-weight:700;text-align:center}.search-calendar-panel__weekdays span:last-child{color:#a83232}.search-calendar-panel__blank{min-height:48px}.search-calendar-panel__days button{position:relative;display:flex;min-width:0;min-height:48px;padding:5px 2px;align-items:center;justify-content:center;flex-direction:column;border:1px solid transparent;border-radius:11px;color:var(--ink);background:#fff;cursor:pointer}.search-calendar-panel__days button:hover:not(:disabled){border-color:#d9a9bf;background:var(--tint)}.search-calendar-panel__days button b{font-size:.76rem}.search-calendar-panel__days button small{color:var(--brand);font-size:.48rem}.search-calendar-panel__days button:disabled{color:#b9b2b6;background:#f7f5f6;cursor:not-allowed}.search-calendar-panel__days button.is-range{border-radius:5px;background:#f7e5ec}.search-calendar-panel__days button.is-entry,.search-calendar-panel__days button.is-exit{border-color:var(--brand);border-radius:11px;color:#fff;background:var(--brand);box-shadow:0 0 0 3px rgba(142,23,79,.12)}.search-calendar-panel__days button.is-entry small,.search-calendar-panel__days button.is-exit small{color:#fff}.search-calendar-panel__footer{display:grid;grid-template-columns:1fr 8px 1fr auto;align-items:center;gap:10px;margin-top:14px;padding:13px;border:1px solid #eadde2;border-radius:14px;background:#fffafb}.search-calendar-panel__footer span,.search-calendar-panel__footer b{display:block}.search-calendar-panel__footer span{color:var(--muted);font-size:.58rem}.search-calendar-panel__footer b{margin-top:2px;font-size:.68rem}.search-calendar-panel__footer i{width:5px;height:5px;border-radius:50%;background:var(--accent)}.search-calendar-panel__footer button{min-height:40px;padding:7px 9px;border:0;color:var(--brand);background:transparent;font-size:.65rem;font-weight:700;cursor:pointer}

.search-modal-backdrop{position:fixed;z-index:390;inset:0;background:rgba(22,13,18,.66);backdrop-filter:blur(8px);animation:search-modal-fade .18s ease-out}.search-modal-backdrop[hidden]{display:none}body.search-modal-open{overflow:hidden}.destination-panel,.search-calendar-panel{z-index:400;animation:search-modal-rise .2s ease-out}.destination-panel{position:fixed;top:50%;right:auto;left:50%;width:min(680px,calc(100vw - 48px));max-height:calc(100svh - 48px);transform:translate(-50%,-50%);box-shadow:0 32px 110px rgba(18,10,14,.45)}.destination-options{max-height:min(420px,calc(100svh - 300px))}.search-calendar-panel{width:min(500px,calc(100vw - 48px));max-height:calc(100svh - 48px);box-shadow:0 32px 110px rgba(18,10,14,.45)}@keyframes search-modal-fade{from{opacity:0}to{opacity:1}}@keyframes search-modal-rise{from{opacity:0;transform:translate(-50%,calc(-50% + 14px))}to{opacity:1;transform:translate(-50%,-50%)}}

/* Dialogs use the page tokens, including dark mode. */
.destination-panel, .search-calendar-panel {background: var(--surface); color: var(--ink); border-color: var(--border); border-radius: 24px; animation: none}
.destination-picker__trigger, .search-date-trigger {color: var(--ink); min-height: 44px}
.destination-picker__trigger b, .search-date-trigger b {font-size: .875rem}
.destination-picker__trigger small, .search-date-trigger small {color: var(--muted); font-size: .75rem; margin-top: 2px}
.destination-picker__trigger small {max-width: 160px}
.destination-picker__trigger > .ui-icon, .search-date-trigger > .ui-icon {color: var(--brand)}
.search-date-trigger.has-value b {color: var(--brand)}
.destination-panel__header small, .search-calendar-panel__header small {font-size: .8125rem}
.destination-panel__header button, .search-calendar-panel__header > button {background: var(--home-soft)}
.destination-panel__search {background: var(--surface); border-color: var(--border); border-radius: 12px}
.destination-options__popular button, .destination-options__global {background: var(--canvas); color: var(--ink); border-color: var(--border); border-radius: 12px}
.destination-options__popular b, .destination-options__list b, .destination-options__global b {font-size: .875rem}
.destination-options__popular small, .destination-options__list small, .destination-options__global small {font-size: .75rem}
.destination-options__heading {font-size: .8125rem}
.destination-options button.is-selected {background: var(--tint); color: var(--brand); border-color: var(--brand)}
.search-calendar-panel__days button {color: var(--ink); background: var(--surface)}
.search-calendar-panel__days button b {font-size: .875rem}
.search-calendar-panel__days button small {font-size: .6875rem}
.search-calendar-panel__days button:disabled, .search-calendar-panel__toolbar button:disabled {color: var(--muted); background: var(--home-soft); opacity: .5}
.search-calendar-panel__days button.is-range {background: var(--tint)}
.search-calendar-panel__days button.is-entry, .search-calendar-panel__days button.is-exit {background: var(--home-action); color: var(--home-on-action); border-color: var(--home-action)}
.search-calendar-panel__days button.is-entry small, .search-calendar-panel__days button.is-exit small {color: var(--home-on-action)}
.search-calendar-panel__footer {background: var(--canvas); border-color: var(--border); grid-template-columns: 1fr 1fr auto}
.search-calendar-panel__footer i {display: none}
.search-calendar-panel__footer span {font-size: .75rem}
.search-calendar-panel__footer b {font-size: .8125rem}
.search-calendar-panel__footer button {font-size: .8125rem; min-height: 44px}
.search-modal-backdrop {background: rgb(25 17 23 / 64%); backdrop-filter: none; animation: none}

/* ---------- Destination picker: one sectioned, searchable list ---------- */
.destination-options {max-height: min(480px, calc(100svh - 240px)); margin-top: 12px; scrollbar-width: thin; scrollbar-color: var(--border) transparent}
.destination-options__heading {position: sticky; top: 0; z-index: 1; margin: 0; padding: 12px 2px 8px; background: var(--surface); color: var(--muted); font-size: .8125rem; font-weight: 600}
.destination-options__heading[hidden], [data-destination-section][hidden], .destination-options [data-destination-option][hidden] {display: none}
/* While typing, the panel is reduced to one plain, single-column result list. */
.destination-options.is-searching > .destination-options__global,
.destination-options.is-searching > [data-destination-section="popular"],
.destination-options.is-searching > [data-destination-heading="popular"] {display: none}
.destination-options.is-searching .destination-options__list {grid-template-columns: 1fr; margin-bottom: 0}
.destination-options.is-searching .destination-options__list button {min-height: 48px}
.destination-options.is-searching .destination-options__list button > span {display: flex; align-items: baseline; gap: 6px}
.destination-options.is-searching .destination-options__list small {margin-top: 0; font-size: .72rem; overflow: visible}
.destination-options__popular button small {color: var(--muted)}
.destination-options__list {gap: 2px 8px; margin-bottom: 4px}
.destination-options__list button {min-height: 56px; padding: 8px 12px; border-radius: 12px}
.destination-options__list button span {display: grid; gap: 2px; min-width: 0}
.destination-options__list b {color: var(--ink)}
.destination-options__list small {color: var(--muted)}
.destination-options__list button.is-empty b {color: var(--muted); font-weight: 500}
.destination-options__list button.is-empty small {opacity: .8}
.destination-options__list .destination-option__check {width: 18px; height: 18px; flex: 0 0 18px; color: transparent}
.destination-options__list button.is-selected .destination-option__check {color: var(--brand)}
.destination-panel__search {min-height: 52px}
/* Calmer default state: a plain first row and compact popular pills instead of cards. */
.destination-options__global {display: flex; width: 100%; align-items: center; gap: 10px; min-height: 54px; margin-bottom: 6px; padding: 8px 12px; border: 0; border-radius: 12px; color: var(--ink); background: transparent; font-family: var(--font-ui); text-align: start; cursor: pointer}
.destination-options__global:hover,
.destination-options__global:focus-visible {border: 0; color: var(--ink); background: var(--soft); outline: 0}
.destination-options .destination-options__global.is-selected {border: 0; color: var(--ink); background: var(--soft)}
.destination-options__global-icon {display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; color: var(--brand); background: var(--tint)}
.destination-options__global-icon .ui-icon {width: 18px; height: 18px}
.destination-options__global > span:nth-child(2) {flex: 1; min-width: 0}
.destination-options__global b {font-size: .875rem}
.destination-options__global small {margin-top: 2px; font-size: .75rem}
.destination-options__global-check {width: 18px; height: 18px; flex: 0 0 18px}
.destination-options__popular {display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px}
.destination-options__popular button {min-height: 38px; display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); background: var(--canvas); font-family: var(--font-ui); cursor: pointer; transition: border-color 160ms ease, color 160ms ease}
.destination-options__popular button:hover,
.destination-options__popular button:focus-visible {border-color: var(--brand); color: var(--brand); outline: 0}
.destination-options__popular button.is-selected {border-color: var(--brand); color: var(--brand)}
.destination-options__popular b,
.destination-options__popular small {display: inline}
.destination-options__popular b {font-size: .8125rem}
.destination-options__popular small {margin: 0; color: var(--muted); font-size: .72rem}

/* Phones: the destination and date dialogs rise from the bottom (after the dialog base rules above). */
@media (max-width: 650px) {
    .destination-panel, .search-calendar-panel {inset: auto 0 0; width: 100%; max-height: 88dvh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); transform: none; border-radius: 24px 24px 0 0}
    .destination-options {max-height: calc(88dvh - 170px)}
    .destination-options__list {grid-template-columns: 1fr}
    .search-calendar-panel__weekdays, .search-calendar-panel__days {gap: 3px}
    .search-calendar-panel__days button, .search-calendar-panel__blank {min-height: 44px}
    .search-calendar-panel__footer {grid-template-columns: 1fr 1fr}
    .search-calendar-panel__footer button {grid-column: 1 / -1}
    body.guest-home.search-modal-open .guest-tabbar {visibility: hidden}
}
