/* Stay (Otaghak) pages: stay.php, stay_room.php, stay_checkout.php, stay_reserve.php. They are built from the boomgardi styles (house.css for the list,
   house-detail.css for the room page and the booking card); this file only adds what boomgardi does not have. */

/* ===== search bar (stay.php): one bar of four parts, destination, free text, dates, guests, and the button. Each part has its icon, a small label and
   its field; the whole part is clickable (stay.js). Wide screens: one row; tablets: two by two; phones: one card of rows. Colours from the palette only. */
.stay-top {
    background: linear-gradient(to bottom, color-mix(in srgb, var(--ds-primary, #00ab6c) 5%, var(--ds-surface, #fff)), var(--ds-surface, #fff));
    border-bottom: 1px solid var(--ds-border, #e1e7ef); padding: 18px 0 20px;
}
.stay-top__title { margin: 0 0 14px; font-size: 22px; font-weight: 800; color: var(--ds-secondary, #14365c); }
.stay-sbar {
    display: flex; align-items: stretch; gap: 0; padding: 6px;
    background: var(--ds-surface, #fff); border: 1px solid var(--ds-border, #e1e7ef); border-radius: 20px;
    box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--ds-secondary, #14365c) 28%, transparent);
}
.stay-sbar__seg {
    position: relative; flex: 1 1 0; min-width: 0;
    display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center;
    padding: 9px 16px; border-radius: 14px; cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease;
}
.stay-sbar__seg--text { flex-grow: 1.35; }
.stay-sbar__seg--guests { flex-grow: .75; }
.stay-sbar__seg + .stay-sbar__seg::before { /* the thin line between two parts */
    content: ""; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%; width: 1px; background: var(--ds-border, #e1e7ef);
}
.stay-sbar__seg:hover { background: var(--ds-surface-2, #eef2f7); }
.stay-sbar__seg:focus-within { background: var(--ds-surface, #fff); box-shadow: 0 0 0 2px var(--ds-primary, #00ab6c); z-index: 1; }
.stay-sbar__seg:hover::before, .stay-sbar__seg:focus-within::before, .stay-sbar__seg:hover + .stay-sbar__seg::before, .stay-sbar__seg:focus-within + .stay-sbar__seg::before { opacity: 0; }
.stay-sbar__ico {
    grid-row: 1 / span 2; width: 22px; height: 22px; fill: none; stroke: var(--ds-primary, #00ab6c); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.stay-sbar__lbl { font-size: 12px; font-weight: 600; color: var(--ds-muted, #596579); line-height: 1.4; cursor: pointer; white-space: nowrap; }
.stay-sbar__val { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.stay-sbar__val input, .stay-sbar__val select {
    flex: 1; min-width: 0; width: 100%; height: 26px; margin: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent;
    font: inherit; font-size: 15px; font-weight: 700; color: var(--ds-text, #101828); text-align: right; cursor: pointer;
}
.stay-sbar__val input[type="text"]#stayDest, .stay-sbar__val #stayQ { cursor: text; }
.stay-sbar__val input::placeholder { color: var(--ds-muted, #596579); font-weight: 400; opacity: .85; }
.stay-sbar__val select { appearance: none; -webkit-appearance: none; padding-inline-end: 20px; }
.stay-sbar__seg--guests .stay-sbar__val::after { /* the arrow of the guests list */
    content: ""; position: absolute; inset-inline-end: 4px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
    border: solid var(--ds-muted, #596579); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.stay-sbar__nights {
    flex: none; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.8; white-space: nowrap;
    background: var(--ds-primary-soft, #e6f7f0); color: var(--ds-primary-text, #007a52);
}
.stay-sbar__nights:empty { display: none; }
.stay-clear {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
    background: var(--ds-surface-2, #eef2f7); color: var(--ds-muted, #596579); font-size: 16px; line-height: 1; cursor: pointer;
}
.stay-clear:hover { background: var(--ds-border, #e1e7ef); color: var(--ds-text, #101828); }
.stay-clear[hidden] { display: none; }
.stay-sbar__btn.ds-btn { flex: none; align-self: stretch; height: auto; min-height: 52px; margin-inline-start: 6px; padding: 0 26px; border-radius: 14px; font-size: 15px; }
.stay-sbar__btn svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.stay-sbar__error { margin: 10px 4px 0; font-size: 13px; font-weight: 600; color: var(--ds-danger, #c81e1e); }
.stay-sbar__error[hidden] { display: none; }

/* the city suggestions under the destination */
.stay-dest { position: relative; }
.stay-suggest {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: max(100%, 300px); max-height: 340px; overflow: auto; margin: 0; padding: 6px; list-style: none;
    background: var(--ds-surface, #fff); border: 1px solid var(--ds-border, #e1e7ef); border-radius: 14px; text-align: right; font-size: 14px; cursor: default;
    box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--ds-secondary, #14365c) 35%, transparent);
}
.stay-suggest[hidden] { display: none; }
.stay-suggest-head { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; color: var(--ds-muted, #596579); }
.stay-suggest-note { padding: 10px 12px; font-size: 13px; color: var(--ds-muted, #596579); }
.stay-suggest-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ds-text, #101828); }
.stay-suggest-item small { color: var(--ds-muted, #596579); }
.stay-suggest-item:hover, .stay-suggest-item.active { background: var(--ds-primary-soft, #e6f7f0); }

@media (max-width: 1023px) {
    .stay-sbar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
    .stay-sbar__seg + .stay-sbar__seg::before { display: none; }
    .stay-sbar__seg { background: var(--ds-surface-2, #eef2f7); }
    .stay-sbar__btn.ds-btn { grid-column: 1 / -1; margin: 2px 0 0; min-height: 50px; }
}
@media (max-width: 639px) {
    .stay-top { padding: 14px 0 16px; }
    .stay-top__title { font-size: 19px; margin-bottom: 12px; }
    .stay-sbar { grid-template-columns: 1fr; border-radius: 18px; }
    .stay-sbar__seg { padding: 8px 14px; }
    .stay-suggest { width: 100%; }
}

/* ===== list page ===== */
#stayResults { transition: opacity .2s ease; }
#stayResults.is-loading { opacity: .55; pointer-events: none; }
.stay-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b7280; margin: -10px 0 14px; }
.stay-status-ok { color: #047857; }
.stay-status-warn { color: #b45309; }
.stay-status-bad { color: #dc2626; }
.stay-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #00aa6b; border-top-color: transparent; animation: spin .9s linear infinite; }
.stay-note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.stay-chip-instant { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.stay-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.stay-pagination a { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; text-decoration: none; font-size: 13px; font-weight: 600; }
.stay-pagination a:hover { border-color: #00aa6b; color: #00aa6b; }
.stay-pagination a.active { background: linear-gradient(135deg, #3E3E64, #00aa6b); color: #fff; border-color: transparent; }

/* infinite scroll (stay.js): the line under the cards while the next page loads, and the retry button when it failed */
.stay-more { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 0 6px; font-size: 13px; color: #6b7280; }
.stay-more[hidden], .stay-more [hidden] { display: none; }
.stay-more.is-failed { color: #dc2626; }
.stay-more.is-failed .stay-spin { display: none; }
.stay-more button { border: 1px solid #d1d5db; background: #fff; border-radius: 8px; padding: 4px 14px; font: inherit; font-size: 12px; color: #3E3E64; cursor: pointer; }

/* ===== room page ===== */
a.bk-cta { display: block; text-align: center; text-decoration: none; }
button.bk-cta:disabled, a.bk-cta.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.stay-alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 2; margin-bottom: 12px; }
.stay-alert.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.stay-alert.bad { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.stay-alert.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.stay-alert.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
#stayQuote.is-loading { opacity: .5; }
.stay-quote-hint { font-size: 12px; color: #6b7280; margin-top: 10px; line-height: 1.9; }
.bk-summary .row.disc { color: #047857; font-size: 12px; }
.bk-select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fafbfc; font: inherit; font-size: 14px; }
.stay-sec-text { font-size: 13px; line-height: 2.1; color: #4b5563; }
.stay-pairs { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 2.1; color: #4b5563; }
.stay-pairs b { color: #111827; }
.stay-pairs .k { color: #6b7280; }
.stay-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-inline-end: 4px; }
.stay-badge.green { background: #ecfdf5; color: #047857; }
.stay-badge.red { background: #fef2f2; color: #b91c1c; }
.stay-gallery-note { grid-column: 1 / -1; font-size: 12px; color: #6b7280; padding: 6px 2px; }
.gallery.stay-gallery-empty { grid-template-rows: 200px; }
.gallery.stay-gallery-empty .g-main { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 14px; }
.gallery .g-hidden { display: none; }

/* ===== lightbox ===== */
.stay-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 16px; }
.stay-lightbox[hidden] { display: none; }
.stay-lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 8px; }
.stay-lb-cap { color: #e5e7eb; font-size: 13px; margin-top: 10px; }
.stay-lb-close, .stay-lb-prev, .stay-lb-next { position: absolute; border: 0; background: rgba(255,255,255,.15); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; cursor: pointer; line-height: 1; }
.stay-lb-close { top: 16px; left: 16px; }
.stay-lb-prev { top: 50%; right: 16px; transform: translateY(-50%); }
.stay-lb-next { top: 50%; left: 16px; transform: translateY(-50%); }
body.stay-lb-open { overflow: hidden; }

/* ===== checkout and reserve pages ===== */
.stay-form-card { background: #fff; border-radius: 14px; border: 1px solid #eef0f4; box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 20px; margin-bottom: 14px; }
.stay-form-card h2 { font-size: 15px; font-weight: 800; color: #111827; margin: 0 0 12px; }
.stay-form-card textarea.bk-input { height: auto; padding-top: 10px; }
.stay-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #374151; margin-top: 12px; cursor: pointer; line-height: 1.9; }
.stay-check input { margin-top: 6px; accent-color: #00aa6b; }
.stay-code { font-weight: 800; letter-spacing: 1px; direction: ltr; display: inline-block; }
.stay-steps { padding-right: 18px; font-size: 13px; line-height: 2.2; color: #4b5563; }
.stay-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stay-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 13px; border: 1px solid #d1d5db; background: #fff; color: #3E3E64; cursor: pointer; text-decoration: none; }
.stay-btn.main { border: 0; color: #fff; background: linear-gradient(135deg, #3E3E64, #00aa6b); }
.stay-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stay-table td { padding: 7px 0; border-top: 1px solid #f3f4f6; }
.stay-table td:last-child { text-align: left; }
.stay-table tr:first-child td { border-top: 0; }
.stay-table tr.total td { font-weight: 800; color: #111827; }
.stay-status-pill { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; }
.stay-status-pill.warning { background: #b45309; } .stay-status-pill.primary { background: #1d4ed8; } .stay-status-pill.success { background: #15803d; }
.stay-status-pill.danger { background: #b91c1c; } .stay-status-pill.secondary { background: #6b7280; } .stay-status-pill.dark { background: #374151; }

/* ===== list on the right, a big map that stays on the screen on the left ===== */
.stay-wide { max-width: 1760px; margin: 0 auto; }
.stay-split { display: flex; gap: 24px; align-items: flex-start; }
.stay-split__list { flex: 1 1 0; min-width: 0; }
.stay-split__map { flex: 0 0 44%; max-width: 44%; position: sticky; top: calc(var(--stay-top, 80px) + 12px); height: var(--stay-h, calc(100dvh - var(--stay-top, 80px) - 24px)); min-height: 0; } /* --stay-top (stay.js) is the height of whatever is pinned to the top of the screen (the site header); --stay-h is what is left of the screen under the column's real place: at the top of the page the title and search bar are above it, and it grows as they scroll away until it sticks under the header. Never taller than the screen: a taller map makes the list scroll under a mouse that is on the map */
.stay-split__scroll { min-width: 0; }
/* wide screen: the column is as tall as the map under the header, the filters stay on top of it and only the results scroll (the page itself stays still while a pin of the map brings its room into view) */
@media (min-width: 1024px) {
    .stay-split__list { display: flex; flex-direction: column; position: sticky; top: calc(var(--stay-top, 80px) + 12px); height: var(--stay-h, calc(100dvh - var(--stay-top, 80px) - 24px)); }
    .stay-split__list > .stay-filters { flex: none; }
    .stay-split__scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; padding-inline-end: 8px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
}
.stay-split__map:has(.stay-mapbox[hidden]) { display: none; } /* no room of the list has a position: no map */

/* ===== filters, laid out like Otaghak: a toolbar of dropdowns and a drawer with the rest in sections. Colours from the palette; the motion is at the end
   of this part (a dropdown drops and fades in, its rows rise one after the other, the drawer slides in, chips and counts pop). stay.js plays the closing
   ones (.is-closing, then [hidden]). ===== */
.stay-filters { position: relative; margin-bottom: 18px; --stay-ease: cubic-bezier(.2, .8, .2, 1); --stay-ring: color-mix(in srgb, var(--ds-primary, #00ab6c) 30%, transparent); }
.stay-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stay-fbtn {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border: 1px solid var(--ds-border, #e1e7ef); border-radius: 999px;
    background: var(--ds-surface, #fff); font: inherit; font-size: 13px; color: var(--ds-text, #101828); cursor: pointer; white-space: nowrap;
    transition: border-color .18s, box-shadow .18s, background-color .18s, color .18s, transform .18s var(--stay-ease);
}
.stay-fbtn:hover { border-color: color-mix(in srgb, var(--ds-text, #101828) 45%, transparent); transform: translateY(-1px); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--ds-secondary, #14365c) 55%, transparent); }
.stay-fbtn:active { transform: scale(.96); box-shadow: none; }
.stay-fbtn[aria-expanded="true"] { border-color: var(--ds-primary, #00ab6c); box-shadow: 0 0 0 3px var(--stay-ring); transform: none; }
.stay-fbtn:focus-visible, .stay-apply:focus-visible, .stay-x:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--stay-ring); }
.stay-fbtn strong { font-weight: 700; }
.stay-fbtn.on { border-color: var(--ds-primary, #00ab6c); background: var(--ds-primary-soft, #e6f7f0); color: var(--ds-primary-text, #007a52); }
.stay-fbtn--main { font-weight: 700; }
.stay-fbtn--main svg { transition: transform .35s var(--stay-ease); }
.stay-fbtn--main:hover svg { transform: rotate(-12deg) scale(1.08); }
.stay-caret { width: 7px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); opacity: .6; transition: transform .28s var(--stay-ease), margin-top .28s var(--stay-ease); }
.stay-fbtn[aria-expanded="true"] .stay-caret { transform: rotate(225deg); margin-top: 3px; }
.stay-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; margin-inline-start: 4px;
    background: var(--ds-primary, #00ab6c); color: var(--ds-on-primary, #fff); font-size: 11px; font-weight: 700; line-height: 1;
    animation: stayPop .45s var(--stay-ease) .15s both;
}
.stay-reset { height: 40px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ds-danger, #c81e1e); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.stay-reset[hidden] { display: none; }

/* a dropdown of the toolbar */
.stay-dd { position: relative; }
.stay-dd__panel {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 60; min-width: 250px; max-width: min(92vw, 420px); overflow: hidden;
    background: var(--ds-surface, #fff); border: 1px solid var(--ds-border, #e1e7ef); border-radius: 16px;
    box-shadow: 0 18px 40px -14px color-mix(in srgb, var(--ds-secondary, #14365c) 40%, transparent);
    transform-origin: top right;
}
.stay-dd__panel[hidden] { display: none; }
.stay-dd__panel--wide { min-width: 320px; }
.stay-dd__list { max-height: 330px; overflow-y: auto; padding: 8px; }
.stay-dd__head { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; color: var(--ds-muted, #596579); }
.stay-dd__foot, .stay-drawer__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--ds-border, #e1e7ef); background: var(--ds-surface, #fff); }
.stay-link { border: 0; background: none; padding: 6px 4px; font: inherit; font-size: 13px; color: var(--ds-text, #101828); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: color .15s; }
.stay-link:hover { color: var(--ds-danger, #c81e1e); }
.stay-apply {
    position: relative; height: 38px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--ds-primary, #00ab6c); color: var(--ds-on-primary, #fff);
    font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background-color .15s, transform .15s var(--stay-ease), box-shadow .15s;
}
.stay-apply:hover { background: var(--ds-primary-hover, #009560); box-shadow: 0 8px 18px -10px var(--ds-primary, #00ab6c); }
.stay-apply:active { transform: scale(.96); }
.stay-apply.is-busy { color: transparent; pointer-events: none; }
.stay-apply.is-busy::after { /* the list is being loaded with the new filters */
    content: ""; position: absolute; inset: 0; width: 16px; height: 16px; margin: auto; border: 2.5px solid var(--ds-on-primary, #fff); border-inline-end-color: transparent; border-radius: 50%;
    animation: stayTurn .7s linear infinite;
}

/* one row with a check box / radio (Otaghak's list rows) */
.stay-row { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--ds-text, #101828); transition: background-color .15s; }
.stay-row:hover { background: var(--ds-surface-2, #eef2f7); }
.stay-row:has(input:checked) { background: color-mix(in srgb, var(--ds-primary-soft, #e6f7f0) 70%, transparent); }
.stay-row input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ds-primary, #00ab6c); cursor: pointer; transition: transform .2s var(--stay-ease); }
.stay-row input:checked { animation: stayChip .3s var(--stay-ease); }
.stay-row__t { display: flex; flex-direction: column; gap: 2px; line-height: 1.6; }
.stay-row__t small { font-size: 11px; color: var(--ds-muted, #596579); font-weight: 400; }
.stay-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; align-items: start; }
.stay-dd__list.stay-cols { grid-template-columns: repeat(2, minmax(150px, 1fr)); min-width: 330px; }
.stay-opt { display: flex; flex-direction: column; }
.stay-subs { display: none; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 38px 8px 0; padding: 8px 10px; border-radius: 12px; background: var(--ds-surface-2, #eef2f7); }
.stay-opt:has(> label input:checked) > .stay-subs { display: flex; animation: stayRise .25s var(--stay-ease) both; }
.stay-subs em { flex: 0 0 100%; font-style: normal; font-size: 11px; font-weight: 700; color: var(--ds-muted, #596579); }

/* chips (bedrooms, rating, sub options) */
.stay-type { margin: 0; cursor: pointer; }
.stay-type input { position: absolute; opacity: 0; pointer-events: none; }
.stay-type span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 6px 14px; border: 1px solid var(--ds-border, #e1e7ef); border-radius: 999px;
    background: var(--ds-surface, #fff); font-size: 12px; color: var(--ds-text, #101828);
    transition: background-color .18s, border-color .18s, color .18s, transform .18s var(--stay-ease);
}
.stay-type:hover span { border-color: color-mix(in srgb, var(--ds-text, #101828) 45%, transparent); transform: translateY(-1px); }
.stay-type input:focus-visible + span { box-shadow: 0 0 0 3px var(--stay-ring); }
.stay-type input:checked + span { background: var(--ds-primary, #00ab6c); border-color: var(--ds-primary, #00ab6c); color: var(--ds-on-primary, #fff); font-weight: 700; animation: stayChip .3s var(--stay-ease); }

/* the drawer with the sections */
body.stay-drawer-open { overflow: hidden; }
/* the list column is sticky on wide screens, which makes it a layer of its own: the drawer and the dropdowns inside it could not cover the site header
   (z-index 50) or the map beside it. While one of them is open the whole column is lifted above both. */
body.stay-drawer-open .stay-split__list, .stay-split__list:has(.stay-dd__panel:not([hidden])) { z-index: 2500; }
.stay-drawer { position: fixed; inset: 0; z-index: 2500; }
.stay-drawer[hidden] { display: none; }
.stay-drawer__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ds-secondary-hover, #0f2a49) 55%, transparent); backdrop-filter: blur(2px); }
.stay-drawer__box {
    position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(460px, 100vw); display: flex; flex-direction: column;
    background: var(--ds-surface, #fff); box-shadow: 0 0 40px color-mix(in srgb, var(--ds-secondary, #14365c) 30%, transparent);
}
.stay-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ds-border, #e1e7ef); font-size: 16px; color: var(--ds-text, #101828); }
.stay-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ds-surface-2, #eef2f7); font-size: 22px; line-height: 1; color: var(--ds-text, #101828); cursor: pointer; transition: background-color .15s, transform .25s var(--stay-ease); }
.stay-x:hover { background: var(--ds-border, #e1e7ef); transform: rotate(90deg); }
.stay-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 4px 18px 16px; }
.stay-sec { border-bottom: 1px solid var(--ds-border, #e1e7ef); }
.stay-sec > summary { display: flex; align-items: center; gap: 6px; padding: 16px 0; list-style: none; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ds-text, #101828); transition: color .15s; }
.stay-sec > summary:hover { color: var(--ds-primary-text, #007a52); }
.stay-sec > summary::-webkit-details-marker { display: none; }
.stay-sec > summary::after { content: ''; margin-inline-start: auto; width: 8px; height: 8px; border: solid var(--ds-muted, #596579); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .28s var(--stay-ease); }
.stay-sec[open] > summary::after { transform: rotate(225deg); }
.stay-sec[open] > :not(summary) { animation: stayRise .28s var(--stay-ease) both; }
.stay-sec__body { padding: 0 0 16px; }
.stay-sec__body.stay-cols { grid-template-columns: 1fr; }
.stay-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.stay-filters__range { display: flex; gap: 10px; }
.stay-filters__range label { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; margin: 0; height: 46px; padding: 0 12px; border: 1px solid var(--ds-border, #e1e7ef); border-radius: 12px; font-size: 12px; color: var(--ds-muted, #596579); transition: border-color .18s, box-shadow .18s; }
.stay-filters__range label:focus-within { border-color: var(--ds-primary, #00ab6c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-primary, #00ab6c) 15%, transparent); }
.stay-filters__range input { flex: 1 1 auto; width: 0; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ds-text, #101828); direction: ltr; text-align: center; }
.stay-filters__range em { font-style: normal; font-size: 11px; }
/* toggle switch (instant / prime / nightly) */
.stay-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 10px 0; cursor: pointer; font-size: 13px; color: var(--ds-text, #101828); }
.stay-switch input { position: absolute; opacity: 0; pointer-events: none; }
.stay-switch i { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--ds-border, #e1e7ef); transition: background-color .25s var(--stay-ease); }
.stay-switch i::after {
    content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ds-surface, #fff);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--ds-secondary, #14365c) 35%, transparent); transition: transform .3s var(--stay-ease), width .2s var(--stay-ease);
}
.stay-switch:active i::after { width: 25px; } /* the knob stretches while pressed */
.stay-switch input:checked + i { background: var(--ds-primary, #00ab6c); }
.stay-switch input:checked + i::after { transform: translateX(-18px); }
.stay-switch:active input:checked + i::after { transform: translateX(-13px); }
.stay-switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--stay-ring); }

/* the motion: opening */
.stay-dd__panel:not([hidden]) { animation: stayDrop .22s var(--stay-ease) both; }
.stay-dd__panel:not([hidden]) .stay-dd__list > * { animation: stayRise .3s var(--stay-ease) both; animation-delay: calc(var(--stay-i, 9) * 28ms); }
.stay-drawer:not([hidden]) .stay-drawer__backdrop { animation: stayFade .28s ease both; }
.stay-drawer:not([hidden]) .stay-drawer__box { animation: stayIn .36s var(--stay-ease) both; }
.stay-drawer:not([hidden]) .stay-drawer__body > * { animation: stayRise .34s var(--stay-ease) both; animation-delay: calc(80ms + var(--stay-i, 9) * 35ms); }
.stay-dd__list > :nth-child(1), .stay-drawer__body > :nth-child(1) { --stay-i: 0; }
.stay-dd__list > :nth-child(2), .stay-drawer__body > :nth-child(2) { --stay-i: 1; }
.stay-dd__list > :nth-child(3), .stay-drawer__body > :nth-child(3) { --stay-i: 2; }
.stay-dd__list > :nth-child(4), .stay-drawer__body > :nth-child(4) { --stay-i: 3; }
.stay-dd__list > :nth-child(5), .stay-drawer__body > :nth-child(5) { --stay-i: 4; }
.stay-dd__list > :nth-child(6), .stay-drawer__body > :nth-child(6) { --stay-i: 5; }
.stay-dd__list > :nth-child(7), .stay-drawer__body > :nth-child(7) { --stay-i: 6; }
.stay-dd__list > :nth-child(8), .stay-drawer__body > :nth-child(8) { --stay-i: 7; }
/* closing (stay.js waits for it before [hidden]) */
.stay-dd__panel.is-closing { animation: stayLift .16s ease-in both; pointer-events: none; }
.stay-drawer.is-closing { pointer-events: none; }
.stay-drawer.is-closing .stay-drawer__backdrop { animation: stayFadeOut .24s ease both; }
.stay-drawer.is-closing .stay-drawer__box { animation: stayOut .26s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes stayDrop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes stayLift { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes stayRise { from { opacity: 0; transform: translateY(6px); } }
@keyframes stayFade { from { opacity: 0; } }
@keyframes stayFadeOut { to { opacity: 0; } }
@keyframes stayIn { from { transform: translateX(100%); } }   /* the page is right to left: the drawer is on the right and comes from there */
@keyframes stayOut { to { transform: translateX(100%); } }
@keyframes stayUp { from { transform: translateY(100%); } }
@keyframes stayDown { to { transform: translateY(100%); } }
@keyframes stayPop { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.15); } 100% { opacity: 1; transform: none; } }
@keyframes stayChip { 0% { transform: scale(.9); } 60% { transform: scale(1.07); } 100% { transform: none; } }
@keyframes stayTurn { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
    .stay-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
    .stay-bar::-webkit-scrollbar { display: none; }
    .stay-dd { position: static; }
    .stay-dd__panel { position: fixed; top: auto; bottom: 0; inset-inline: 0; max-width: none; border-radius: 18px 18px 0 0; z-index: 2400; }
    .stay-dd__panel:not([hidden]) { animation: stayUp .3s var(--stay-ease) both; } /* a sheet from the bottom of the screen */
    .stay-dd__panel.is-closing { animation: stayDown .22s ease-in both; }
    .stay-dd__list.stay-cols { min-width: 0; grid-template-columns: 1fr 1fr; }
    .stay-drawer__box { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) {
    .stay-filters *, .stay-filters *::before, .stay-filters *::after, .stay-drawer, .stay-drawer * { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .stay-apply.is-busy::after { animation-iteration-count: infinite !important; animation-duration: 1.4s !important; }
}

.stay-mapbox { isolation: isolate; /* Leaflet's own layers have z-index 400-1000: kept inside the box, the map goes under the site header (z-50) when the page scrolls, not over it */ background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.1); height: 100%; max-height: 100%; display: flex; flex-direction: column; }
.stay-mapbox[hidden] { display: none; }
.stay-mapbox__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-weight: 700; font-size: 14px; color: #111827; }
.stay-mapbox__head small { font-weight: 500; color: #6b7280; }
.stay-mapbox__head button { display: none; border: 1px solid #d1d5db; background: #fff; border-radius: 8px; padding: 4px 12px; font: inherit; font-size: 12px; color: #3E3E64; cursor: pointer; }
#stayMapView { flex: 1 1 0; width: 100%; min-height: 0; }
#stayMapView[hidden] { display: none; }
.stay-mapbox__note { padding: 6px 14px; font-size: 11px; color: #9ca3af; border-top: 1px solid #f3f4f6; }

/* narrower screens: the map goes above the list and scrolls with the page (it can be hidden) */
@media (max-width: 1023px) {
    .stay-split { flex-direction: column; align-items: stretch; } /* stretch: with flex-start the column was as wide as its widest content (the one-line filter bar) and so were the cards */
    .stay-split__list { flex: none; width: 100%; max-width: 100%; }
    .stay-split__map { position: static; flex: none; max-width: none; width: 100%; height: auto; min-height: 0; order: -1; }
    .stay-mapbox { height: auto; }
    #stayMapView { height: 260px; flex: none; }
    .stay-mapbox__head button { display: inline-block; }
}
/* a mid-size screen has less room for the list: the cards stand upright */
@media (max-width: 1399px) {
    .stay-split__list .house-card__inner { flex-direction: column; height: auto; }
    .stay-split__list .house-card__imgwrap { width: 100%; height: 210px; }
    .stay-split__list .house-card__body { min-height: 230px; }
}

.stay-pin span { display: inline-block; transform: translate(-50%, -50%); background: #fff; border: 2px solid #3E3E64; color: #111827; border-radius: 999px; padding: 2px 9px; font: 700 12px "IRANYekanXFaNum", sans-serif; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.stay-pin.is-hot { z-index: 1000 !important; }
.stay-pin.is-hot span { background: #00aa6b; border-color: #00aa6b; color: #fff; }
.stay-pop a { font-weight: 700; color: #3E3E64; text-decoration: none; }
.stay-pop div { font-size: 12px; color: #4b5563; margin-top: 4px; }

/* choice of the payment gateway (checkout, "pay again") */
.stay-gateways { display: flex; flex-wrap: wrap; gap: 10px; }
.stay-gateway { flex: 1 1 200px; margin: 0; cursor: pointer; }
.stay-gateway input { position: absolute; opacity: 0; pointer-events: none; }
.stay-gateway span { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; transition: all .15s; }
.stay-gateway b { font-size: 14px; color: #111827; }
.stay-gateway small { font-size: 11px; color: #9ca3af; }
.stay-gateway:hover span { border-color: #111827; }
.stay-gateway input:checked + span { border-color: #00aa6b; background: #ecfdf5; box-shadow: 0 0 0 1px #00aa6b inset; }
.stay-gateway input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,170,107,.3); }
.stay-gateways--inline { margin-bottom: 8px; }
.stay-gateways--inline .stay-gateway { flex: 1 1 120px; }
.stay-gateways--inline .stay-gateway span { padding: 8px 12px; }

/* the card of the pin the mouse is on (map -> list) */
.house-card.is-lit { border-color: #00aa6b; box-shadow: 0 0 0 3px rgba(0,170,107,.35), 0 20px 40px -10px rgba(0,0,0,.2); }

/* phones: the bottom row of a room card (map button, price, reserve button) did not fit one line at 360px and the reserve button was squeezed and cut off.
   Price and map button stay on one line, the reserve button gets a line of its own; the card is as tall as its content (house.css gives it a fixed 440px) */
@media (max-width: 767px) {
    #stayResults .house-card__inner { height: auto; }
    #stayResults .house-card__body { min-width: 0; }
    #stayResults .house-card__bottom { flex-wrap: wrap; align-items: center; }
    #stayResults .house-card__price-box { flex: 1 1 auto; min-width: 0; }
    #stayResults .house-card__cta { flex: 1 1 100%; width: 100%; order: 3; white-space: nowrap; }
}

/* the tick «قوانین را می‌پذیرم» of stay_checkout.php: when it is missing the card turns red and says so in big letters (it was an 11px line under the tick) */
.stay-accept.has-error { border: 2px solid #ef4444; background: #fff5f5; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
.stay-accept.has-error .stay-check span { color: #991b1b; font-weight: 700; }
.stay-accept-err {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px; padding: 12px 14px; border-radius: 10px;
    background: #ef4444; color: #fff;
    font-size: 15px; font-weight: 800; line-height: 1.8;
}
.stay-accept-err[hidden] { display: none; }
.stay-accept-err svg { flex: none; }
.stay-accept.shake { animation: stay-shake .45s ease; }
@keyframes stay-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-7px); }
    40%, 80% { transform: translateX(7px); }
}
@media (prefers-reduced-motion: reduce) { .stay-accept.shake { animation: none; } }

/* the minimum stay (stay_room.php: above the calendar and in the booking card; stay-room.js fills the text and the .cal-min tags of the days) */
.stay-min { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: #f3f4f6; border: 1px solid #e5e7eb; color: #374151; font-size: 13px; font-weight: 700; line-height: 1.8; }
.stay-min[hidden] { display: none; }
.stay-min svg { flex: none; }
.stay-min.is-strong { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.stay-min--small { margin: 8px 0 0; padding: 7px 10px; font-size: 12px; }
.cal-day.has-min { padding-top: 14px; }
.cal-day .cal-min { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 0 5px; border-radius: 6px; background: #fde68a; color: #92400e; font-size: 8px; font-weight: 800; line-height: 13px; pointer-events: none; }
.cal-day.selected .cal-min, .cal-day.in-range .cal-min { display: none; }

/* a day with a discount in the price calendar of the room page: the price before it struck through, the price now in red (stay-room.js) */
.cal-day .cal-was { font-size: 8.5px; line-height: 1.1; margin-top: 1px; color: #9ca3af; text-decoration: line-through; font-weight: 600; }
.cal-day.has-off .cal-price { margin-top: 0; color: #dc2626; font-weight: 800; }
.cal-day.in-range.has-off .cal-price { color: #b91c1c; }
.cal-day.selected .cal-was { color: rgba(255, 255, 255, .75); }
.cal-day.selected.has-off .cal-price { color: #fff; }

/* the booking card of the room page under 1024px (where it used to be at the very bottom of the page, far from the guest): a drawer from the bottom of the
   screen, folded to a bar with the price and a button; a tap on the bar unfolds it, a tap on the dark backdrop (or Esc) folds it. Wider screens keep the
   card in the side column. stay_room.php has the markup (#bkSheet, #bkSheetHead, #bkSheetBackdrop), stay-room.js opens / folds it and writes the price. */
.bk-sheet-head, .bk-sheet-backdrop { display: none; }
@media (max-width: 1023px) {
    .stay-room-page.stay-room-page { padding-bottom: 96px; }
    .stay-room-page .sidebar-booking {
        position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 55; margin: 0;
        max-height: 88vh; max-height: 88dvh;
        display: flex; flex-direction: column;
        background: #fff; border-radius: 20px 20px 0 0;
        box-shadow: 0 -14px 40px -10px rgba(17, 24, 39, .32);
        transform: translateY(calc(100% - 76px));
        transition: transform .32s cubic-bezier(.22, .8, .3, 1);
    }
    .stay-room-page .sidebar-booking.is-open { transform: none; }
    .bk-sheet-head {
        position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
        flex: none; width: 100%; height: 76px; padding: 16px 18px 10px;
        border: 0; background: transparent; text-align: right; cursor: pointer; font-family: inherit;
    }
    .bk-sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d1d5db; }
    .bk-sheet-price { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .bk-sheet-price small { font-size: 11px; color: #6b7280; }
    .bk-sheet-price b { font-size: 18px; font-weight: 800; color: #111827; white-space: nowrap; }
    .bk-sheet-cta { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 10px 16px; border-radius: 12px; background: #00aa6b; color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; }
    .bk-sheet-cta svg { transition: transform .3s; }
    .sidebar-booking.is-open .bk-sheet-cta svg { transform: rotate(180deg); }
    .stay-room-page .sidebar-booking .booking-card { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 0; box-shadow: none; padding-top: 4px; }
    .stay-room-page .sidebar-booking .booking-price { display: none; } /* the bar above says it */
    .bk-sheet-backdrop {
        display: block; position: fixed; inset: 0; z-index: 54; background: rgba(17, 24, 39, .45);
        opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s;
    }
    .bk-sheet-backdrop.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
    body.bk-sheet-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .stay-room-page .sidebar-booking, .bk-sheet-backdrop { transition-duration: .01s; }
}

/* the booking card of the room page follows the guest down the page on wide screens (it was left behind at the top of its column); under 1024px it is the drawer above.
   The column around it is as tall as the page content (grid stretch), which is the room it slides in. */
@media (min-width: 1024px) {
    .stay-room-page .sidebar-booking { position: sticky; top: 88px; align-self: start; }
}

/* the price calendar flashes when the guest clicks the date field of the booking card (stay-room.js) */
@keyframes calFlash { 0% { box-shadow: 0 0 0 0 rgba(234,88,12,.55); background: #fff7ed; } 30% { box-shadow: 0 0 0 6px rgba(234,88,12,.35); background: #fff7ed; } 100% { box-shadow: 0 0 0 0 rgba(234,88,12,0); background: transparent; } }
.dt-card.cal-flash { animation: calFlash 2.4s ease-out; }

/* Otaghak's discount at the top of the room's booking card and in its bar on small screens (stay_room.php, stay-room.js): the percent on an accent badge,
   the price before it struck through next to the label */
.stay-room-page .bk-off { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--ds-accent, #cc4420); color: var(--ds-on-accent, #fff); font-size: 12px; font-weight: 800; line-height: 1.7; white-space: nowrap; }
.stay-room-page .bk-off[hidden] { display: none; }
.stay-room-page .booking-price .bk-off { margin-bottom: 6px; }
.stay-room-page .booking-price .stay-was { margin-top: 4px; }
.stay-room-page .booking-price .stay-was[hidden] { display: none; }
.stay-room-page .bk-sheet-row { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.stay-room-page .bk-sheet-row .bk-off { padding: 1px 8px; font-size: 11px; }

/* Otaghak's discount on a card of the list (layouts/stay_results.php): the accent of the palette, like the home cards and the room page */
.house-badge-cashback.stay-off { background: var(--ds-accent, #cc4420); color: var(--ds-on-accent, #fff); box-shadow: 0 4px 12px color-mix(in srgb, var(--ds-accent, #cc4420) 35%, transparent); }
/* the price before the discount: its own line right above the price (list cards, room page), like the home cards. Struck through with a thin accent
   line slanted 12 degrees, not line-through: a Persian zero (۰) is a dot at mid-height, which any straight line hides (۳۰,۰۰۰ reads ۳-,---) */
.stay-was {
    position: relative; display: block; width: fit-content; margin-inline: auto; padding: 0 3px; font-size: 14px; font-weight: 500; line-height: 1.35;
    color: var(--ds-muted, #596579); text-decoration: none;
}
.stay-was::after {
    content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1.5px; margin-top: -1px; border-radius: 2px;
    background: var(--ds-accent, #cc4420); transform: rotate(-12deg); pointer-events: none;
}
.house-card__price-box .stay-was { margin: 1px 0 -2px; }
