/*
 * The search console (tabs, route, calendar, nights, travellers). Shared by the website and the B2B panel.
 * It reads the colour variables of the page that loads it.
 */

/* ---------- Search console ---------- */

.ws-console {
    position: relative;
    padding: 16px;
    border-radius: 24px;
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, .9);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 34px 70px -40px rgba(11, 37, 69, .55);
}

.ws-console.is-compact { margin-top: 26px; }

.ws-console-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ws-console-tab { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; }
.ws-console-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.ws-console-tab:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.ws-segments label.is-off span { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.ws-console-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }

.ws-field { position: relative; display: flex; flex-direction: column; gap: 6px; flex: 1 1 150px; min-width: 0; }
.ws-field-city { flex: 1 1 170px; }
.ws-field-date { flex: 1.2 1 210px; }
.ws-field-nights { flex: 0 1 170px; }
.ws-field-guests { flex: 1 1 190px; }

.ws-field label, .ws-label { font-size: .82rem; font-weight: 600; color: var(--mist); white-space: nowrap; }

.ws-field select, .ws-field input, .ws-field textarea, .ws-picker {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-weight: 500;
    color: var(--navy);
}

.ws-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%231e63ae' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.ws-field select:focus, .ws-field input:focus, .ws-field textarea:focus, .ws-picker:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(74, 155, 224, .25); }

.ws-picker { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.ws-picker svg { width: 20px; height: 20px; flex: none; color: var(--blue); }
.ws-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-swap { flex: 0 0 auto; align-self: flex-end; width: 34px; height: 52px; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--blue); pointer-events: none; }
.ws-swap svg { width: 22px; }

.ws-segments { display: flex; gap: 4px; padding: 4px; min-height: 52px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.ws-segments label { position: relative; }
.ws-segments input { position: absolute; opacity: 0; inset: 0; }
.ws-segments span { display: flex; align-items: center; justify-content: center; min-width: 42px; height: 100%; padding: 0 10px; border-radius: 10px; font-weight: 600; color: var(--navy); cursor: pointer; }
.ws-segments input:checked + span { background: var(--blue); color: #fff; box-shadow: 0 6px 14px -6px rgba(30, 99, 174, .8); }
.ws-segments input:focus-visible + span { outline: 3px solid var(--sky-500); }

.ws-console-submit { flex: 0 0 auto; min-height: 52px; padding: 0 28px; }

/* popovers */
.ws-popover[hidden] { display: none !important; }
.ws-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 40;
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(11, 37, 69, .08);
    box-shadow: 0 30px 70px -30px rgba(11, 37, 69, .55);
}

.ws-calendar { width: 640px; }
.ws-calendar-head { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.ws-calendar-nav { pointer-events: auto; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--sky-100); color: var(--blue); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.ws-calendar-nav:hover { background: var(--sky-200); }
.ws-calendar-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ws-month-title { text-align: center; font-family: var(--font-display); font-weight: 600; color: var(--navy); margin: 6px 0 12px; text-transform: capitalize; }
.ws-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ws-weekday { text-align: center; font-size: .78rem; font-weight: 600; color: var(--mist); padding-bottom: 4px; text-transform: capitalize; }
.ws-day { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.ws-day.is-off { color: #c3cdda; font-weight: 400; }
button.ws-day { cursor: pointer; color: var(--navy); background: var(--sky-100); }
button.ws-day::after { content: ''; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; }
button.ws-day.is-charter::after { background: var(--red); }
button.ws-day.is-package::after { background: var(--sky-500); }
button.ws-day:hover { background: var(--sky-200); }
button.ws-day.is-selected { background: var(--blue); color: #fff; box-shadow: 0 8px 16px -8px rgba(30, 99, 174, .9); }
button.ws-day.is-selected::after { background: #fff; }
.ws-calendar-legend { display: flex; gap: 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--mist); }
.ws-calendar-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.ws-calendar-legend .is-charter { background: var(--red); }
.ws-calendar-legend .is-package { background: var(--sky-500); }

.ws-picker-caret { margin-left: auto; width: 16px !important; height: 16px !important; color: var(--mist) !important; transition: transform .2s ease; }
.ws-picker[aria-expanded="true"] .ws-picker-caret { transform: rotate(180deg); }
.ws-nights { width: 300px; padding: 14px; }
.ws-nights-title { margin: 2px 4px 10px; font-size: .86rem; font-weight: 600; color: var(--mist); }
.ws-nights-list { display: flex; flex-direction: column; gap: 4px; }
.ws-night { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; border: 1px solid transparent; cursor: pointer; transition: background .15s ease; }
.ws-night:hover { background: var(--sky-50); }
.ws-night input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ws-night-count { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--sky-100); color: var(--blue); font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.ws-night-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ws-night-text strong { font-weight: 600; color: var(--navy); }
.ws-night-text small { font-size: .82rem; color: var(--mist); text-transform: none; }
.ws-night:has(input:checked) { background: var(--sky-100); border-color: var(--sky-300); }
.ws-night:has(input:checked) .ws-night-count { background: var(--blue); color: #fff; box-shadow: 0 6px 14px -6px rgba(30, 99, 174, .8); }
.ws-night:has(input:checked)::after { content: ''; margin-left: auto; width: 12px; height: 7px; border-left: 2.5px solid var(--blue); border-bottom: 2.5px solid var(--blue); transform: rotate(-45deg) translateY(-2px); }
.ws-night:has(input:focus-visible) { outline: 3px solid var(--sky-500); outline-offset: 1px; }
.ws-night.is-off { display: none; }

.ws-guests { width: 340px; right: 0; left: auto; display: flex; flex-direction: column; gap: 14px; }
.ws-stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-stepper strong { display: block; color: var(--navy); }
.ws-stepper span { font-size: .85rem; color: var(--mist); }
.ws-stepper-control { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: var(--sky-100); }
.ws-stepper-control button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #fff; color: var(--blue); font-size: 1.3rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px -3px rgba(11, 37, 69, .4); }
.ws-stepper-control input { width: 36px; min-height: 0; padding: 0; border: 0; background: none; text-align: center; font-weight: 700; color: var(--navy); }
.ws-ages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ws-ages:empty { display: none; }
.ws-age { display: flex; flex-direction: column; gap: 4px; }
.ws-age label { font-size: .8rem; font-weight: 600; color: var(--mist); }
.ws-age select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font-weight: 500; }
.ws-age select:invalid { border-color: rgba(225, 37, 27, .5); }
.ws-guests-done { width: 100%; }
