/* Kili reservation bar: sticky booking bar for Tour Master tour pages.
   Matches the Tour Master booking widget: Poppins, green icons, yellow uppercase button. */
.kbar {
    --kbar-ink: #1f2429;
    --kbar-mist: #6b7280;
    --kbar-line: #e3e5e8;
    --kbar-bg: #ffffff;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    background: var(--kbar-bg); color: var(--kbar-ink);
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif; font-size: 14px; line-height: 1.35;
    border-top: 1px solid var(--kbar-line);
    box-shadow: 0 -8px 28px rgba(17, 24, 39, 0.10);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(110%); visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
    color-scheme: light;
    text-align: left;
}
.kbar.kbar-on { transform: none; visibility: visible; transition: transform 0.28s ease, visibility 0s; }
.kbar *, .kbar *::before, .kbar *::after { box-sizing: border-box; }
.kbar [hidden] { display: none !important; }
html.kbar-active body { padding-bottom: 92px; }
/* One bottom bar at a time: Tour Master's own phone bar steps aside while this one is showing. */
html.kbar-active .tourmaster-mobile-booknow-bar { display: none !important; }

.kbar button, .kbar select {
    font-family: inherit; text-transform: none; letter-spacing: normal; margin: 0; box-shadow: none;
    -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
}
.kbar button:focus-visible, .kbar select:focus-visible { outline: 2px solid var(--kbar-icon, #2fa84f); outline-offset: 2px; }

.kbar-inner {
    max-width: 1240px; margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; gap: 16px;
}
.kbar-info { flex: 0 1 260px; min-width: 0; }
.kbar-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbar-price { font-size: 13px; color: var(--kbar-mist); margin-top: 2px; }
.kbar-price b { font-size: 19px; font-weight: 800; color: var(--kbar-ink); margin-left: 4px; }

.kbar-fields { flex: 1 1 auto; display: flex; gap: 10px; min-width: 0; }
.kbar-field {
    flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center;
    border: 1px solid var(--kbar-line); border-radius: 3px; background: #fff; height: 48px; margin: 0;
    transition: border-color 0.15s;
}
.kbar-field:hover { border-color: #c9ced4; }
.kbar-field:focus-within { border-color: var(--kbar-icon, #2fa84f); box-shadow: 0 0 0 2px rgba(47, 168, 79, 0.18); }
.kbar .kbar-field select:focus-visible, .kbar .kbar-proxy:focus-visible { outline: none; }
.kbar-field.kbar-missing { border-color: #d64545; box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.15); }
.kbar-ico { flex: 0 0 auto; display: flex; padding: 0 4px 0 12px; color: var(--kbar-icon, #2fa84f); pointer-events: none; }
.kbar .kbar-field select, .kbar .kbar-proxy {
    flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; border-radius: 3px;
    padding: 0 32px 0 8px; font-size: 14px; color: #4b5563; cursor: pointer; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fa84f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}
.kbar .kbar-field select option { color: #1f2429; }

/* Departure date split into Year | Month (| Day when the month has several departures) */
.kbar-field.kbar-split { flex: 1.6 1 0; min-width: 230px; }
.kbar-split.kbar-has-day { flex-grow: 2.2; min-width: 320px; }
.kbar .kbar-split select { flex: 1 1 0; padding-right: 26px; background-position: right 8px center; }
.kbar .kbar-split select.kbar-y { flex: 0 0 auto; width: 84px; }
.kbar .kbar-split select.kbar-m { min-width: 110px; }
.kbar .kbar-split select.kbar-d { flex: 0 0 auto; width: 92px; display: none; }
.kbar-split.kbar-has-day select.kbar-d { display: block; }
.kbar-sep { flex: 0 0 1px; align-self: center; height: 22px; background: var(--kbar-line); }
.kbar-d-sep { display: none; }
.kbar-split.kbar-has-day .kbar-d-sep { display: block; }

.kbar .kbar-go, .kbar .kbar-open {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; padding: 0 26px; border: 0; border-radius: 5px; cursor: pointer;
    background: var(--kbar-btn-bg, #f5c32c); color: var(--kbar-btn-fg, #fff);
    font-size: 14px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap;
    transition: filter 0.15s, transform 0.15s;
}
.kbar .kbar-go:hover, .kbar .kbar-open:hover { filter: brightness(0.95); transform: translateY(-1px); }
.kbar .kbar-go:active, .kbar .kbar-open:active { transform: none; }
.kbar-bolt { display: flex; }
.kbar-open, .kbar-sheet-head { display: none !important; }
.kbar-no-fields .kbar-fields { display: none; }

.kbar-msg {
    position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 6px);
    background: #1f2429; color: #fff; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 8px;
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; white-space: nowrap; max-width: calc(100vw - 32px);
}
.kbar-msg.show { opacity: 1; transform: translate(-50%, 0); }

/* Small desktops: drop the title, keep the price */
@media (min-width: 1100px) and (max-width: 1279px) {
    .kbar-info { flex-basis: 120px; }
    .kbar-title { display: none; }
    .kbar .kbar-go { padding: 0 18px; letter-spacing: 0.6px; }
}

/* Tablets and phones: compact bar with a "Book Now" button that opens a bottom sheet */
@media (max-width: 1099px) {
    html.kbar-active body { padding-bottom: 76px; }
    .kbar-inner { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
    .kbar-info { flex: 1 1 0; }
    .kbar-title { display: block; font-size: 14px; }
    .kbar-price b { font-size: 17px; }
    .kbar-fields, .kbar .kbar-go { display: none; }
    .kbar .kbar-open { display: inline-flex !important; height: 46px; padding: 0 20px; }

    .kbar.kbar-sheet { border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(17, 24, 39, 0.25); }
    .kbar.kbar-sheet .kbar-sheet-head {
        display: flex !important; align-items: center; justify-content: space-between;
        padding: 14px 16px 2px; font-weight: 700; font-size: 15px;
    }
    .kbar .kbar-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3f4f6; color: #374151; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
    .kbar.kbar-sheet .kbar-info { flex-basis: 100%; }
    .kbar.kbar-sheet .kbar-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; flex-basis: 100%; }
    .kbar.kbar-sheet .kbar-inner { max-width: 760px; }
    .kbar.kbar-sheet .kbar-field { flex: 0 0 auto; height: 52px; }
    .kbar.kbar-sheet .kbar-go { display: inline-flex; flex-basis: 100%; height: 52px; }
    .kbar.kbar-sheet .kbar-open { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .kbar, .kbar-msg { transition: none; } }

/* Admin-only detection panel (?kili_debug=1) */
#kbar-debug {
    position: fixed; top: 46px; left: 12px; z-index: 99999; max-width: 380px;
    background: #111827; color: #e5e7eb; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
    padding: 12px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
#kbar-debug strong { display: block; color: #86efac; margin-bottom: 6px; font-size: 12.5px; }
#kbar-debug ul { margin: 6px 0; padding-left: 16px; }
#kbar-debug code { color: #fde68a; word-break: break-all; }
#kbar-debug .kbar-debug-note { color: #9ca3af; margin-top: 6px; }
