/**
 * KymmaBoats Chat Experience — full-page shortcode layout
 * Layout B: chat region (grows/scrolls) → answer zone + input (fixed) → results panel (below)
 *
 * Brand colours:
 *   Navy  #01024d  — header, user bubbles, accents
 *   Teal  #00B4D8  — assistant accent, send button, links, active tabs
 *
 * All classes prefixed kx- (or kymma-exp for the root).
 * No build step — plain CSS.
 */

/* ============================================================
   Custom properties (scoped to root)
   ============================================================ */
.kymma-exp {
    --kx-navy:     #01024d;
    --kx-teal:     #00B4D8;
    --kx-teal-h:   #0096b4;
    --kx-teal-lt:  #f2fbfd;
    --kx-light:    #f0f4f8;
    --kx-white:    #ffffff;
    --kx-text:     #1a1a2e;
    --kx-border:   rgba(1, 2, 77, 0.12);
    --kx-shadow:   0 4px 24px rgba(1, 2, 77, 0.14);
    --kx-radius:   14px;
    box-sizing: border-box;
}

.kymma-exp *,
.kymma-exp *::before,
.kymma-exp *::after {
    box-sizing: inherit;
}

/* ============================================================
   Root container
   ============================================================ */
.kymma-exp {
    display: flex;
    flex-direction: column;
    /* Fixed, viewport-bounded height so the whole widget (chat + tabs) fits on
       screen without page scroll; chat and results panel scroll INDEPENDENTLY. */
    height: min(86vh, 920px);
    max-width: 1100px;
    margin: 0 auto;
    border: 1px solid var(--kx-border);
    border-radius: var(--kx-radius);
    overflow: hidden;
    background: var(--kx-white);
    box-shadow: var(--kx-shadow);
    font-family: inherit;
    font-size: 15px;
    color: var(--kx-text);
}

/* ============================================================
   Chat region — scrollable messages
   ============================================================ */
.kx-chat {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 16px 10px;
    background: var(--kx-light);
    scroll-behavior: smooth;
    /* min-height:0 is REQUIRED for a flex child to shrink and let overflow-y scroll. */
    min-height: 0;
}

.kx-chat::-webkit-scrollbar { width: 4px; }
.kx-chat::-webkit-scrollbar-track { background: transparent; }
.kx-chat::-webkit-scrollbar-thumb {
    background: rgba(1, 2, 77, 0.15);
    border-radius: 4px;
}

/* ============================================================
   Message rows
   ============================================================ */
.kx-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.kx-msg--user {
    align-self: flex-end;
    align-items: flex-end;
}

.kx-msg--assistant {
    align-self: flex-start;
    align-items: flex-start;
}

/* ============================================================
   Bubbles
   ============================================================ */
.kx-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    max-width: 100%;
}

.kx-bubble--user {
    background: var(--kx-navy);
    color: var(--kx-white);
    border-bottom-right-radius: 4px;
}

.kx-bubble--assistant {
    background: var(--kx-white);
    color: var(--kx-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(1, 2, 77, 0.08);
}

.kx-bubble--assistant a {
    color: var(--kx-teal);
    text-decoration: underline;
}

/* ============================================================
   Typing indicator (three animated dots)
   ============================================================ */
@keyframes kx-bounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.5; }
    30%            { transform: translateY(-5px); opacity: 1;   }
}

.kx-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px 2px;
    min-height: 24px;
}

.kx-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--kx-teal);
    border-radius: 50%;
    animation: kx-bounce 1.2s infinite ease-in-out;
}

.kx-typing span:nth-child(2) { animation-delay: 0.2s; }
.kx-typing span:nth-child(3) { animation-delay: 0.4s; }

/* ============================================================
   Answer zone (quick-reply chips, date controls)
   ============================================================ */
.kx-answer {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--kx-teal-lt);
    border-top: 1px solid rgba(0, 180, 216, 0.18);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 0;
    /* A tall control (e.g. the calendar) scrolls inside the zone instead of
       pushing the chat off-screen. */
    max-height: 46vh;
    overflow-y: auto;
}

.kx-answer:empty {
    display: none;
}

/* Chips — pill buttons */
.kx-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border: 1.5px solid var(--kx-teal);
    border-radius: 999px;
    background: var(--kx-white);
    color: var(--kx-navy);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.kx-chip:hover,
.kx-chip:focus-visible {
    background: var(--kx-teal);
    color: var(--kx-white);
    outline: none;
}

/* Date control container */
.kx-datectl {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.kx-datectl__mode-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kx-datectl__cal {
    background: var(--kx-white);
    border: 1px solid var(--kx-border);
    border-radius: 10px;
    padding: 10px;
    overflow-x: auto;
}

.kx-datectl__confirm {
    align-self: flex-start;
    padding: 7px 20px;
    background: var(--kx-navy);
    color: var(--kx-white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.kx-datectl__confirm:hover,
.kx-datectl__confirm:focus-visible {
    background: var(--kx-teal);
    outline: none;
}

/* ============================================================
   Input row (textarea + circular send button)
   ============================================================ */
.kx-input {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px 12px;
    background: var(--kx-white);
    border-top: 1px solid var(--kx-border);
    flex-shrink: 0;
}

.kx-input textarea {
    flex: 1 1 auto;
    resize: none;
    border: 1px solid rgba(1, 2, 77, 0.20);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.45;
    font-family: inherit;
    color: var(--kx-text);
    background: var(--kx-light);
    outline: none;
    overflow-y: hidden;
    min-height: 38px;
    max-height: 120px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kx-input textarea:focus {
    border-color: var(--kx-teal);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
    background: var(--kx-white);
}

.kx-input textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kx-input__send {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--kx-teal);
    color: var(--kx-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.12s ease;
    padding: 0;
}

.kx-input__send svg {
    width: 18px;
    height: 18px;
    display: block;
}

.kx-input__send:hover:not(:disabled),
.kx-input__send:focus-visible:not(:disabled) {
    background: var(--kx-teal-h);
    outline: none;
}

.kx-input__send:active:not(:disabled) {
    transform: scale(0.92);
}

.kx-input__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================================
   Results panel
   ============================================================ */
.kx-panel {
    /* Collapsed by default (just the tabs row) so an empty results area doesn't
       steal space from the chat / answer zone. Expands to a bounded share once
       the agent renders content (see .kx-panel--has-content). */
    flex: 0 0 auto;
    border-top: 2px solid var(--kx-teal);
    background: var(--kx-white);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Once the agent has rendered boats/map/details/quote, give the results region a
   bounded share of the widget height; its active pane scrolls internally. */
.kx-panel.kx-panel--has-content {
    flex: 0 0 42%;
}

/* ============================================================
   Tabs row
   ============================================================ */
.kx-tabs {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--kx-border);
    background: var(--kx-light);
    flex-shrink: 0;
}

.kx-tabs::-webkit-scrollbar { display: none; }

.kx-tab {
    flex-shrink: 0;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
}

.kx-tab:hover {
    color: var(--kx-navy);
    background: rgba(0, 180, 216, 0.07);
}

.kx-tab--active {
    color: var(--kx-navy);
    background: var(--kx-white);
    /* teal underline via inset box-shadow */
    box-shadow: inset 0 -3px 0 0 var(--kx-teal);
}

/* ============================================================
   Pane content areas
   ============================================================ */
.kx-pane {
    padding: 14px 16px 18px;
    overflow-y: auto;
    /* Fill the panel's remaining height (below the tabs) and scroll internally. */
    flex: 1 1 auto;
    min-height: 0;
}

.kx-pane[hidden] { display: none; }

/* ============================================================
   Boat cards grid
   ============================================================ */
.kx-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.kx-bcard {
    border: 1px solid var(--kx-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--kx-white);
    box-shadow: 0 2px 8px rgba(1, 2, 77, 0.07);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}

.kx-bcard:hover {
    box-shadow: 0 4px 16px rgba(1, 2, 77, 0.14);
}

.kx-bcard__media {
    position: relative;
    flex-shrink: 0;
    background: var(--kx-light);
}

.kx-bcard__img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--kx-light);
    flex-shrink: 0;
}

/* Overlay badges on the image (mirrors the /search card). */
.kx-bcard__badge {
    position: absolute;
    top: 8px;
    z-index: 2;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(1, 2, 77, 0.25);
}

.kx-bcard__badge--cat {
    left: 8px;
    background: rgba(1, 2, 77, 0.82);
    color: var(--kx-white);
    text-transform: capitalize;
}

.kx-bcard__badge--discount {
    right: 8px;
    background: #e63946;
    color: var(--kx-white);
}

.kx-bcard__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
}

.kx-bcard__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--kx-navy);
    line-height: 1.3;
}

.kx-bcard__specs {
    font-size: 12px;
    color: #666;
}

.kx-bcard__location {
    font-size: 12px;
    color: #777;
}

.kx-bcard__price {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    background: var(--kx-teal);
    color: var(--kx-white);
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    align-self: flex-start;
}

.kx-bcard__price-from {
    font-weight: 600;
    opacity: 0.9;
}

.kx-bcard__price-amount {
    font-weight: 800;
}

.kx-bcard__price-unit {
    font-weight: 600;
    opacity: 0.9;
}

.kx-bcard__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kx-bcard__btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none !important;
    border: none;
    white-space: nowrap;
}

.kx-bcard__btn--primary {
    background: var(--kx-navy);
    color: var(--kx-white) !important;
}

.kx-bcard__btn--primary:hover {
    background: var(--kx-teal);
    color: var(--kx-white) !important;
}

.kx-bcard__btn--outline {
    background: transparent;
    color: var(--kx-navy) !important;
    border: 1.5px solid var(--kx-border);
}

.kx-bcard__btn--outline:hover {
    background: var(--kx-light);
    color: var(--kx-navy) !important;
}

/* ============================================================
   Map pane
   ============================================================ */
.kx-map {
    height: 320px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--kx-light);
}

/* ============================================================
   Tool indicator (searching…)
   ============================================================ */
.kx-tool-indicator {
    font-size: 12px;
    color: var(--kx-teal);
    padding: 3px 0;
    font-style: italic;
    letter-spacing: 0.01em;
    animation: kx-fade 0.3s ease;
}

@keyframes kx-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Markdown rendering inside .kx-bubble-text
   (mirrored from .kymma-chat-bubble-text, scoped to .kx-bubble-text)
   ============================================================ */
.kx-bubble-text { line-height: 1.5; word-wrap: break-word; }
.kx-bubble-text h1,
.kx-bubble-text h2,
.kx-bubble-text h3,
.kx-bubble-text h4,
.kx-bubble-text h5,
.kx-bubble-text h6 {
    margin: 0.5em 0 0.3em;
    font-weight: 700;
    color: #01024d;
    line-height: 1.25;
}
.kx-bubble-text h1 { font-size: 1.25em; }
.kx-bubble-text h2 { font-size: 1.18em; }
.kx-bubble-text h3 { font-size: 1.10em; }
.kx-bubble-text h4,
.kx-bubble-text h5,
.kx-bubble-text h6 { font-size: 1.02em; }
.kx-bubble-text p { margin: 0 0 0.5em; }
.kx-bubble-text ul,
.kx-bubble-text ol {
    margin: 0.35em 0 0.6em;
    padding-left: 1.35em;
}
.kx-bubble-text li { margin: 0.15em 0; }
.kx-bubble-text strong { font-weight: 700; }
.kx-bubble-text em { font-style: italic; }
.kx-bubble-text a {
    color: #00838f;
    text-decoration: underline;
    word-break: break-word;
}
.kx-bubble-text code {
    background: rgba(1, 2, 77, 0.06);
    border-radius: 4px;
    padding: 0.08em 0.35em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}
.kx-bubble-text pre {
    background: #f3f4f8;
    border: 1px solid #e1e4ee;
    border-radius: 8px;
    padding: 0.6em 0.75em;
    overflow-x: auto;
    margin: 0.5em 0;
}
.kx-bubble-text pre code {
    background: none;
    padding: 0;
    font-size: 0.86em;
    color: #1a1a2e;
}

/* ============================================================
   Responsive — mobile bottom sheet at max-width: 768px
   ============================================================ */
@media (max-width: 768px) {

    .kymma-exp {
        min-height: 100svh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    /* Panel becomes a fixed bottom sheet */
    .kx-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        max-height: 55vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(1, 2, 77, 0.18);
        background: var(--kx-white);
        display: flex;
        flex-direction: column;
        /* Collapsed by default — only handle + tabs visible */
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    /* Drag handle area */
    .kx-sheet-handle {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 0 4px;
        cursor: pointer;
        background: var(--kx-white);
    }

    .kx-sheet-handle::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(1, 2, 77, 0.18);
        border-radius: 999px;
    }

    /* Collapsed: show only handle + tabs, hide pane content */
    .kx-panel:not(.kx-panel--open) .kx-pane {
        display: none;
    }

    .kx-panel:not(.kx-panel--open) {
        max-height: 80px; /* handle + tabs row */
    }

    /* Expanded */
    .kx-panel--open {
        max-height: 55vh;
    }

    .kx-panel--open .kx-pane[hidden] {
        display: none;
    }

    /* Make active pane scrollable inside sheet */
    .kx-panel--open .kx-pane {
        max-height: calc(55vh - 80px);
        overflow-y: auto;
    }

    /* Chips wrap */
    .kx-answer {
        flex-wrap: wrap;
    }

    /* Cards full-width */
    .kx-cards-grid {
        grid-template-columns: 1fr;
    }

    /* Chat fills viewport above sheet */
    .kx-chat {
        padding-bottom: 90px; /* leave room for collapsed sheet */
    }
}

/* ============================================================
   Header bar  (buildShell)
   ============================================================ */
.kx-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--kx-navy);
    border-bottom: 3px solid var(--kx-teal);
}

/* Optional teal accent dot before the title */
.kx-header::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kx-teal);
    flex-shrink: 0;
}

.kx-header__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--kx-white);
    letter-spacing: 0.03em;
}

/* ============================================================
   Details pane  (renderDetails)
   ============================================================ */
.kx-detail__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--kx-navy);
    margin: 0 0 10px;
    line-height: 1.3;
}

.kx-detail__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.kx-detail__thumb {
    width: 88px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--kx-light);
    display: block;
    flex-shrink: 0;
}

.kx-detail__specs {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0;
}

.kx-detail__specs li {
    font-size: 13px;
    color: var(--kx-text);
    padding: 5px 4px 5px 0;
    border-bottom: 1px solid var(--kx-border);
}

/* Section headings inside Details and Quote panes */
.kx-detail__h {
    font-size: 11px;
    font-weight: 700;
    color: var(--kx-teal);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 14px 0 6px;
}

/* Free-week chips (per-boat Weekly Availability) */
.kx-weeks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.kx-weeks__note {
    font-size: 11px;
    color: #777;
    margin: 0 0 6px;
}

.kx-week-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1.5px solid var(--kx-teal);
    border-radius: 999px;
    background: var(--kx-white);
    color: var(--kx-navy);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.kx-week-chip:hover {
    background: var(--kx-teal);
    color: var(--kx-white);
}

.kx-detail__features {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kx-detail__features li {
    display: inline-block;
    padding: 3px 10px;
    background: var(--kx-teal-lt);
    border: 1px solid rgba(0, 180, 216, 0.30);
    border-radius: 999px;
    font-size: 12px;
    color: var(--kx-navy);
}

.kx-detail__services {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.kx-detail__services li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--kx-text);
    border-bottom: 1px solid var(--kx-border);
}

.kx-detail__services li:last-child {
    border-bottom: none;
}

.kx-detail__avail {
    font-size: 13px;
    color: #555;
    background: var(--kx-light);
    border-left: 3px solid var(--kx-teal);
    border-radius: 0 6px 6px 0;
    padding: 7px 10px;
    margin: 10px 0 0;
    line-height: 1.5;
}

/* ============================================================
   Quote pane  (renderQuote / quoteRow)
   ============================================================ */
.kx-quote__rows {
    border: 1px solid var(--kx-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.kx-quote__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--kx-border);
}

.kx-quote__row:last-child {
    border-bottom: none;
}

.kx-quote__label {
    color: #555;
    flex: 1 1 auto;
}

.kx-quote__value {
    font-weight: 600;
    color: var(--kx-navy);
    flex-shrink: 0;
    margin-left: 16px;
}

/* Total row — bold, navy, teal top border */
.kx-quote__row--total {
    font-weight: 700;
    background: var(--kx-teal-lt);
    border-top: 2px solid var(--kx-teal);
    border-bottom: none;
}

.kx-quote__row--total .kx-quote__label {
    font-weight: 700;
    color: var(--kx-navy);
}

.kx-quote__row--total .kx-quote__value {
    font-size: 15px;
    color: var(--kx-navy);
}

/* Unavailability notice — amber */
.kx-quote__unavail {
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    font-size: 14px;
    color: #7a5c00;
    margin-bottom: 12px;
    line-height: 1.5;
}

.kx-quote__h {
    font-size: 11px;
    font-weight: 700;
    color: var(--kx-teal);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 12px 0 6px;
}

.kx-quote__alts {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.kx-quote__alts li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--kx-text);
    border-bottom: 1px solid var(--kx-border);
}

.kx-quote__alts li:last-child {
    border-bottom: none;
}

/* Book button — teal override on top of kx-bcard__btn--primary */
.kx-quote__book {
    display: inline-flex;
    margin-top: 14px;
    background: var(--kx-teal) !important;
    color: var(--kx-white) !important;
}

.kx-quote__book:hover,
.kx-quote__book:focus-visible {
    background: var(--kx-teal-h) !important;
    outline: none;
}

/* ============================================================
   Map popups  (renderMap — inside Leaflet, CSS vars not in scope)
   ============================================================ */
.kx-map-popup {
    min-width: 180px;
    font-family: inherit;
    padding: 0;
}

.kx-map-popup__img {
    display: block;
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    margin-bottom: 6px;
}

.kx-map-popup__body {
    padding: 2px 4px 4px;
}

.kx-map-popup__title {
    font-size: 13px;
    font-weight: 700;
    color: #01024d;
    margin-bottom: 3px;
    line-height: 1.3;
}

.kx-map-popup__specs {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
}

.kx-map-popup__loc {
    font-size: 11px;
    color: #777;
    margin-bottom: 4px;
}

.kx-map-popup__price {
    font-size: 12px;
    font-weight: 700;
    color: #00B4D8;
    margin-bottom: 6px;
}

.kx-map-popup__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kx-map-popup__link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #00B4D8;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.kx-map-popup__link:hover {
    color: #01024d;
}

.kx-map-popup__open {
    font-size: 12px;
    font-weight: 600;
    color: #01024d !important;
    text-decoration: none !important;
}

.kx-map-popup__open:hover {
    text-decoration: underline !important;
}

/* Price-label pins (mirrors /search .bs-price-pin) */
.kx-price-pin-wrap {
    background: none;
    border: none;
}

.kx-price-pin {
    display: inline-block;
    padding: 2px 8px;
    background: #01024d;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(1, 2, 77, 0.35);
    border: 1.5px solid #fff;
}

.kx-price-pin:hover {
    background: #00B4D8;
    z-index: 1000;
}

/* ============================================================
   Answer-zone label  (renderChoices)
   ============================================================ */
.kx-answer__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--kx-teal);
    flex-shrink: 0;
}

/* ============================================================
   Empty-results message  (renderResults)
   ============================================================ */
.kx-empty {
    text-align: center;
    color: #888;
    font-size: 14px;
    padding: 28px 16px;
    font-style: italic;
}

/* ============================================================
   Date-picker calendar  (renderDateControl → buildRangeCalendar /
   buildMonthGrid — most layout applied inline by JS, these rules
   add nav button styling and hover feedback)
   ============================================================ */
.kx-cal-nav {
    font-size: 14px;
}

.kx-cal-nav__btn {
    background: none;
    border: 1px solid var(--kx-border);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 13px;
    cursor: pointer;
    color: var(--kx-navy);
    font-family: inherit;
    transition: background 0.15s ease;
}

.kx-cal-nav__btn:hover:not(:disabled) {
    background: var(--kx-light);
}

.kx-cal-nav__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.kx-cal-nav__title {
    font-size: 14px;
    color: var(--kx-navy);
}

/* Grid and weekday headers — layout set inline by JS */
.kx-cal-grid,
.kx-cal-wd,
.kx-cal-blank {
    /* Structural styles set inline; placeholder rule prevents UA overrides */
}

.kx-cal-day {
    font-family: inherit;
}

.kx-cal-day:hover:not(:disabled) {
    background: var(--kx-teal-lt) !important;
    border-color: var(--kx-teal) !important;
}

/* Month/flexible grid — layout set inline by JS */
.kx-month-grid {
    /* Structural styles set inline */
}

.kx-month-cell {
    font-family: inherit;
}

.kx-month-cell:hover:not(:disabled) {
    background: var(--kx-teal-lt) !important;
    border-color: var(--kx-teal) !important;
    color: var(--kx-navy) !important;
}

/* ---- Photo lightbox (Details gallery) — fully scoped under .kx-lightbox ---- */
.kx-detail__thumb { cursor: pointer; }

.kx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    box-sizing: border-box;
    padding: 24px;
}
.kx-lightbox[hidden] { display: none; }
.kx-lightbox__img {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.5);
}
.kx-lightbox__counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 12px;
    border-radius: 999px;
}
.kx-lightbox__close,
.kx-lightbox__nav {
    position: absolute;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kx-lightbox__close {
    top: 14px;
    right: 18px;
    width: 40px;
    height: 40px;
    font-size: 26px;
}
.kx-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 30px;
}
.kx-lightbox__nav--prev { left: 16px; }
.kx-lightbox__nav--next { right: 16px; }
.kx-lightbox__close:hover,
.kx-lightbox__nav:hover { background: rgba(255, 255, 255, 0.3); }

/* ---- Boat rich content (Details: Expert Summary / What's on Board / FAQ) ---- */
.kx-detail__summary,
.kx-detail__onboard {
    background: #f4f6fb;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.55;
    color: #2c3140;
    white-space: pre-line;
}
.kx-faq { margin: 0 0 14px; }
.kx-faq__item { border-bottom: 1px solid #e6e9f0; }
.kx-faq__q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    background: none;
    border: none;
    padding: 11px 2px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2532;
    cursor: pointer;
}
.kx-faq__chev { transition: transform 0.18s; flex-shrink: 0; opacity: 0.6; }
.kx-faq__item--open .kx-faq__chev { transform: rotate(180deg); }
.kx-faq__a {
    display: none;
    padding: 0 2px 12px;
    font-size: 14px;
    line-height: 1.55;
    color: #404656;
    white-space: pre-line;
}
.kx-faq__item--open .kx-faq__a { display: block; }

/* ---- Request-a-Boat interest form ---- */
.kx-header__req {
    margin-left: auto;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.kx-header__req:hover { background: rgba(255,255,255,0.22); }
.kx-leadform { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.kx-leadform__summary { font-size: 13px; color: #475569; background: #f4f6fb; border-radius: 8px; padding: 8px 10px; }
.kx-leadform__input {
    width: 100%; box-sizing: border-box; border: 1px solid #d6dae3; border-radius: 8px;
    padding: 9px 11px; font-size: 14px;
}
.kx-leadform__label { font-size: 12px; font-weight: 600; color: #475569; margin-top: 2px; }
.kx-leadform__channels { display: flex; gap: 6px; flex-wrap: wrap; }
.kx-leadform__ch {
    border: 1px solid #d6dae3; background: #fff; border-radius: 999px; padding: 6px 12px;
    font-size: 13px; cursor: pointer;
}
.kx-leadform__ch--on { background: #01024d; color: #fff; border-color: #01024d; }
.kx-leadform__submit {
    background: #01024d; color: #fff; border: none; border-radius: 8px; padding: 10px 14px;
    font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.kx-leadform__submit:disabled { opacity: 0.6; cursor: default; }
.kx-leadform__msg { font-size: 12px; color: #c53030; min-height: 0; }
.kx-leadform__done { font-size: 14px; color: #1f9d57; font-weight: 600; padding: 6px 0; }

/* ============================================================================
   FULL-SCREEN APP LAYOUT (public chat experience page)
   Scoped with :has(#kymma-chat-exp-root) so it ONLY affects a page that embeds
   the experience — never the rest of the site and never the admin-only widget.
   Goal: the chat fills the device screen with no page title and no page scroll.
   The exact height is set by JS (fitChatToViewport) which MEASURES the space
   below the site header / admin bar; the calc() here is just a pre-JS fallback.
   ============================================================================ */
body:has(#kymma-chat-exp-root) #titlebar,
body:has(#kymma-chat-exp-root) #breadcrumbs,
body:has(#kymma-chat-exp-root) #footer,
body:has(#kymma-chat-exp-root) #footer-bottom,
body:has(#kymma-chat-exp-root) .footer { display: none !important; }

html:has(#kymma-chat-exp-root),
body:has(#kymma-chat-exp-root) { overflow: hidden !important; }

body:has(#kymma-chat-exp-root) .content-container,
body:has(#kymma-chat-exp-root) .content-container > .row,
body:has(#kymma-chat-exp-root) article.page-container-col {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body:has(#kymma-chat-exp-root) .kymma-exp {
    /* Fallback height (pre-JS / no-JS). JS (fitChatToViewport) overrides all three
       with the precise MEASURED height. We pin height AND min/max-height because the
       base styles set height:min(86vh,920px) on desktop and min-height:100svh on
       mobile — both must be overridden or they pin the box and cause overflow. */
    height: calc(100dvh - 80px) !important;
    min-height: calc(100dvh - 80px) !important;
    max-height: calc(100dvh - 80px) !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
}

/* Composer visibility fixes ------------------------------------------------
   1) The Listeo theme's style.min.css forces `textarea { min-width:100%; width:100% }`,
      which makes the textarea take the whole flex row and pushes the round send
      button off the right edge (clipped by overflow:hidden). Let it shrink so the
      send button always fits beside it. */
.kymma-exp .kx-input textarea {
    min-width: 0 !important;
    width: auto !important;
}

/* 1b) The theme's separate "Chat with us" contact widget (WhatsApp/email/phone)
       renders a fixed popup panel (#chatPopupPanel, z-index 1001) that overlaps
       our composer. On a dedicated AI-chat page it is redundant and conflicting,
       so hide it (and its launcher) here only. Does NOT touch our kx-/kymma- UI. */
body:has(#kymma-chat-exp-root) .chat-with-us-wrapper,
body:has(#kymma-chat-exp-root) #chatPopupPanel,
body:has(#kymma-chat-exp-root) .chat-popup-panel { display: none !important; }

/* 2) On mobile the results panel becomes a fixed bottom sheet
      (position:fixed; bottom:0; ~80px collapsed) that would sit ON TOP of the
      composer. Reserve that height at the bottom of the app so the composer
      (Type a message + send) stays fully visible above the collapsed sheet. */
@media (max-width: 768px) {
    body:has(#kymma-chat-exp-root) .kymma-exp {
        box-sizing: border-box !important;
        padding-bottom: 84px !important;
    }
}
