/* ============================================================================
 * MFV Quick Preview — the "Quick view" modal (PRESENTATION ONLY)
 * ----------------------------------------------------------------------------
 * Pairs with partials/quick-view.php, which renders the modal body from the
 * listing type's Quick View settings. Read that file's header first: it says
 * which parts are config-driven (all of the content) and which are chrome (the
 * header bar, the close button, the location caption, the action buttons).
 *
 * DOM this styles:
 *   #quick-view.c27-quick-view-modal
 *     > .container > .modal-dialog > .modal-content
 *       .listing-quick-view-container.mfv-qv.quick-view-<tpl>.tpl-<tpl>.type-<slug>
 *         .mfv-qv__head            eyebrow + close
 *         .mfv-qv__cols
 *           .mc-left
 *             .lf-item-container > .lf-item   photo + price chip
 *             .mfv-qv__summary               title, meta, chips, description
 *           .mc-right
 *             .mfv-qv__loc                   location caption
 *             .block-map.c27-map             mapbox, skin from MyListing
 *             .mfv-qv__actions               save / compare / view
 *
 * ⚠️ THE MAP HEIGHT IS SET BY JAVASCRIPT.
 * `quick-view-modal.js` writes an inline `height` onto `.c27-map` AND
 * `.block-map` equal to the whole modal-content height, twice, after the AJAX
 * response lands. Inline styles beat everything but `!important`, which is why
 * the map height below carries one. Removing it collapses the right column into
 * a full-height map again.
 *
 * ⚠️ `.mc-left` / `.mc-right` are floated at 50% each by the parent's
 * quick-view-modal.css. They are flex children here, so `float` and `width` are
 * both overridden — dropping either brings the float layout back.
 * ========================================================================== */

.mfv-qv {
    --mfv-qv-radius: 16px;
    --mfv-qv-line: #e8eef3;
    --mfv-qv-pad: 28px;
}


/* ============================================================================
   1. MODAL SHELL
   ========================================================================== */

/* The parent stretches the dialog to the container and squares the corners off.
   Give it a real card instead, and a width that leaves the page visible behind. */
.c27-quick-view-modal > .container {
    width: min(1360px, calc(100vw - 48px)) !important;
    max-width: none !important;
    height: auto !important;          /* JS writes a pixel height onto this */
    padding: 0 !important;
}

.c27-quick-view-modal .modal-dialog {
    width: 100% !important;
    max-width: none;
}

.c27-quick-view-modal .modal-content:has(.mfv-qv) {
    background: #fff;
    border: 0;
    border-radius: var(--mfv-qv-radius);
    box-shadow: 0 24px 70px -20px rgba(15, 23, 42, .45), 0 4px 12px rgba(15, 23, 42, .10);
    overflow: hidden;
    height: auto !important;
    /* The modal is centred with translate(-50%,-50%), so anything taller than
       the viewport loses its top AND its bottom. Cap it and scroll inside. */
    max-height: 92vh;
    display: flex;
    pointer-events: auto;
}

/* The parent makes the modal body transparent and hands pointer events to the
   card only; with a real panel the panel itself must take them. */
.mfv-qv {
    pointer-events: auto;
    background: #fff;
    border-radius: var(--mfv-qv-radius);
    overflow: hidden;
    /* Header pinned, columns scroll — so a long description can never push the
       "View full listing" button off the bottom of the screen. */
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    height: auto;
}


/* ============================================================================
   2. HEADER BAR
   ========================================================================== */

.mfv-qv__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: none;
    padding: 16px var(--mfv-qv-pad);
    border-bottom: 1px solid var(--mfv-qv-line);
}

.mfv-qv__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mfl-font-heading, sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--mfl-text-dark, #1e293b);
    letter-spacing: -0.01em;
}

.mfv-qv__eyebrow .mfv-qv__icon {
    color: var(--mfl-text-body, #475569);
    flex: none;
}

.mfv-qv__close {
    flex: none;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--mfv-qv-line);
    background: #fff;
    color: var(--mfl-text-body, #475569);
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.mfv-qv__close:hover,
.mfv-qv__close:focus-visible {
    background: var(--mfl-bg-cool, #f1f5f9);
    color: var(--mfl-text-dark, #1e293b);
    border-color: #d7e0e8;
}


/* ============================================================================
   3. TWO COLUMNS
   ========================================================================== */

.mfv-qv__cols {
    display: flex;
    align-items: stretch;
    gap: var(--mfv-qv-pad);
    padding: var(--mfv-qv-pad);
    min-height: 0;
    overflow-y: auto;
}

/* `width` and `float` both have to go — the parent floats these at 50%. */
.mfv-qv .mc-left,
.mfv-qv .mc-right {
    float: none !important;
    height: auto !important;
    min-width: 0;
}

.mfv-qv .mc-left  { width: auto !important; flex: 1 1 62%; }
.mfv-qv .mc-right { width: auto !important; flex: 1 1 38%; max-width: 460px; display: flex; flex-direction: column; gap: 16px; }

/* No coordinates → the parent falls back to the `alternate` variant, which has
   no map column at all. One column, full width. */
.mfv-qv.mfv-qv--no-map .mc-right { display: none; }
.mfv-qv.mfv-qv--no-map .mc-left  { flex: 1 1 100%; }


/* ============================================================================
   4. LEFT COLUMN — photo, name, meta, description
   ========================================================================== */

.mfv-qv .lf-item-container {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    overflow: hidden;
    background: #eef2f6;
}

.mfv-qv .lf-item {
    height: auto !important;
    position: relative;
    border-radius: 14px !important;
    overflow: hidden;
    background: #eef2f6;
}

.mfv-qv .lf-item > a {
    display: block;
    width: 100%;
    height: auto;
}

/* Nothing is printed on the photo, so the legibility scrim goes. */
.mfv-qv .lf-item .overlay { display: none !important; }

.mfv-qv .lf-background {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    max-height: clamp(200px, 34vh, 340px);
    background-size: cover;
    background-position: 50%;
    background-color: #eef2f6;
}

.mfv-qv .pc-slider .single-slide {
    height: auto !important;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: clamp(200px, 34vh, 340px);
    object-fit: cover;
    background: #eef2f6;
}

/* Gallery arrows: always visible circles on the photo, not the theme's
   hover-only chevrons floating over the middle of the card. */
.mfv-qv .gallery-nav {
    opacity: 1 !important;
    top: 50% !important;
    transform: translateY(-50%);
    height: 0;
    z-index: 4;
}

.mfv-qv .gallery-nav ul li:first-child { left: 14px; }
.mfv-qv .gallery-nav ul li:last-child  { right: 14px; }

.mfv-qv .gallery-nav ul li i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94) !important;
    color: var(--mfl-text-dark, #1e293b) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .22);
    font-size: 22px;
}

/* ── Price chip ──────────────────────────────────────────────────────────── */
.mfv-qv .lf-head {
    top: 16px;
    left: 16px;
    right: 16px;
    gap: 6px;
    align-items: flex-start;
    pointer-events: none;
}

.mfv-qv .lf-head-btn {
    background: rgba(15, 23, 42, .88) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    backdrop-filter: blur(6px) !important;
    border: 1px solid rgba(255, 255, 255, .10) !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-family: var(--mfl-font-body, sans-serif) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    height: 38px !important;
    padding: 0 16px !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .25);
    pointer-events: auto;
}

.mfv-qv .lf-head-btn .rent-price,
.mfv-qv .lf-head-btn .rent-price span.value,
.mfv-qv .lf-head-btn .event-date {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

/* ── Name ────────────────────────────────────────────────────────────────── */
.mfv-qv__summary { padding: 22px 2px 0; }

.mfv-qv__title,
.mfv-qv__title a {
    font-family: var(--mfl-font-heading, sans-serif) !important;
    font-size: clamp(22px, 2vw, 28px) !important;
    font-weight: 700 !important;
    line-height: 1.24 !important;
    letter-spacing: -0.015em;
    color: var(--mfl-text-dark, #1e293b) !important;
    margin: 0 0 14px !important;
    text-shadow: none !important;
}

.mfv-qv__title a,
.mfv-qv__title a:hover,
.mfv-qv__title a:focus { text-decoration: none !important; }

.mfv-qv__title a:hover,
.mfv-qv__title a:focus { color: var(--mfl-primary, #0e7490) !important; }

.mfv-qv__title .verified-listing {
    vertical-align: -3px;
    margin-left: 6px;
    max-height: 20px;
    width: auto;
}

/* ── Meta row: info fields, divided ──────────────────────────────────────── */
.mfv-qv__summary > ul.lf-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 8px;
    margin: 0 0 18px;
    padding: 0;
}

.mfv-qv__summary > ul.lf-contact > li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 !important;
    font-family: var(--mfl-font-body, sans-serif);
    font-size: 15px;
    line-height: 1.4;
    color: var(--mfl-text-body, #475569) !important;
    white-space: nowrap;
}

.mfv-qv__summary > ul.lf-contact > li + li {
    margin-left: 16px;
    padding-left: 16px !important;
    border-left: 1px solid var(--mfv-qv-line);
}

.mfv-qv__summary > ul.lf-contact > li i {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    flex: none;
    font-size: 18px !important;
    color: var(--mfl-text-body, #475569) !important;
    background: transparent !important;
}

/* ── Taxonomy chips ──────────────────────────────────────────────────────── */
.mfv-qv__cats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
}

.mfv-qv__cats-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mfl-text-muted, #94a3b8);
}

.mfv-qv__cats ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.mfv-qv__cats li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--mfv-qv-line);
    border-radius: 999px;
    background: #fff;
    transition: border-color .18s ease, background .18s ease;
}

.mfv-qv__cats li a:hover {
    border-color: rgba(var(--mfv-primary-rgb, 14, 116, 144), .35);
    background: var(--mfl-primary-50, rgba(14, 116, 144, .08));
}

.mfv-qv__cats .cat-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    margin: 0 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
 * The glyph inside the coloured dot.
 *
 * Term icons are `mfv-ic-*` classes — a CSS mask that paints `currentColor`, not
 * an icon font — so the dot needs an explicit colour for the mask to pick up.
 * The term stores `color:#fff` inline on the <i>, but a stale term or an icon
 * font glyph both need the fallback, hence `color` here as well as the size.
 *
 * ⚠️ Those classes live in assets/css/mfv-icon-line-set.css, which used to be
 * enqueued only on single listing pages — which is why these dots were empty
 * circles on explore. It is site-wide now; see functions.php.
 */
.mfv-qv__cats .cat-icon {
    color: #fff;
}

.mfv-qv__cats .cat-icon i,
.mfv-qv__cats .cat-icon [class^="mfv-ic-"],
.mfv-qv__cats .cat-icon [class*=" mfv-ic-"] {
    font-size: 15px !important;
    width: 15px;
    height: 15px;
    color: #fff !important;
}

.mfv-qv__cats .cat-icon img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.mfv-qv__cats .category-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--mfl-text-body, #475569);
}

/* ── Description ─────────────────────────────────────────────────────────── */
.mfv-qv__desc h6 {
    font-family: var(--mfl-font-heading, sans-serif) !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--mfl-text-dark, #1e293b) !important;
    margin: 0 0 8px !important;
}

.mfv-qv__desc-body {
    max-height: 132px;
    overflow-y: auto;
    padding-right: 6px;
}

.mfv-qv__desc-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: var(--mfl-text-body, #475569);
}


/* ============================================================================
   5. RIGHT COLUMN — location, map, actions
   ========================================================================== */

.mfv-qv__loc h6 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--mfl-font-heading, sans-serif) !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--mfl-text-dark, #1e293b) !important;
    margin: 0 0 8px !important;
}

.mfv-qv__loc h6 .mfv-qv__icon { color: var(--mfl-primary, #0e7490); flex: none; }

.mfv-qv__loc-addr {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mfl-text-dark, #1e293b);
    line-height: 1.45;
}

.mfv-qv__loc-note {
    margin: 0;
    font-size: 14px;
    color: var(--mfl-text-body, #475569);
    line-height: 1.45;
}

/*
 * ⚠️ `!important` is doing real work here — see the header. quick-view-modal.js
 * writes `height: <modal height>px` inline onto both `.c27-map` and
 * `.block-map` after the AJAX response.
 */
.mfv-qv .block-map.c27-map {
    height: clamp(200px, 28vh, 320px) !important;
    width: 100%;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    background: #e9eef3;
}

/* ── Price tag ───────────────────────────────────────────────────────────── */
/* Directly under the map — location, then price, then the actions pinned to the
   bottom. Pinning the price to the bottom as well left a dead ~140px gap under
   the map on a listing with a tall left column. */
.mfv-qv__price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid var(--mfv-qv-line);
    border-radius: 12px;
    background: var(--mfl-bg-cool, #f1f5f9);
}

.mfv-qv__price-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mfl-text-muted, #94a3b8);
    flex: none;
}

.mfv-qv__price-value {
    font-family: var(--mfl-font-heading, sans-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--mfl-text-dark, #1e293b);
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ── Actions ─────────────────────────────────────────────────────────────── */
/* This block carries `.lf-item-container` for the compare handler's DOM walk,
   so the parent's card rules reach it. Strip them back to a plain stack. */
.mfv-qv .mfv-qv__actions.lf-item-container {
    margin: 0 !important;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Claims the leftover column space itself; when a price panel is present it
       takes the `margin-top:auto` instead and this one is neutralised below. */
    margin-top: auto !important;
}



.mfv-qv__actions-row {
    display: flex;
    gap: 12px;
}

.mfv-qv__actions-row .mfv-qv__btn { flex: 1 1 0; min-width: 0; }

.mfv-qv .mfv-qv__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #d9e2ea;
    background: #fff;
    font-family: var(--mfl-font-body, sans-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--mfl-text-dark, #1e293b);
    line-height: 1.2;
    text-align: center;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.mfv-qv .mfv-qv__btn i {
    font-size: 20px;
    flex: none;
    color: inherit;
}

.mfv-qv .mfv-qv__btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mfv-qv .mfv-qv__btn:hover {
    border-color: rgba(var(--mfv-primary-rgb, 14, 116, 144), .45);
    background: var(--mfl-primary-50, rgba(14, 116, 144, .08));
    color: var(--mfl-primary, #0e7490);
}

/* Saved state, same signal as the card's filled heart. */
.mfv-qv .mfv-qv__btn.c27-bookmark-button.bookmarked,
.mfv-qv .mfv-qv__btn.c27-bookmark-button.bookmarked:hover {
    background: var(--mfl-primary, #0e7490) !important;
    border-color: var(--mfl-primary, #0e7490) !important;
    color: #fff !important;
}

.mfv-qv .mfv-qv__btn.c27-bookmark-button.bookmarked i { color: #fff !important; }

/* Full width, above the primary CTA: a clear second-choice action rather than a
   third icon competing with Save and Compare. */
.mfv-qv .mfv-qv__btn--message {
    border-color: rgba(var(--mfv-primary-rgb, 14, 116, 144), .35);
    color: var(--mfl-primary, #0e7490);
    font-weight: 700;
}

.mfv-qv .mfv-qv__btn--message i { color: inherit; }

.mfv-qv .mfv-qv__btn--message:hover {
    background: var(--mfl-primary-50, rgba(14, 116, 144, .08));
    border-color: rgba(var(--mfv-primary-rgb, 14, 116, 144), .55);
    color: var(--mfl-primary-dark, #0c5e73);
}

.mfv-qv .mfv-qv__btn--primary,
.mfv-qv .mfv-qv__btn--primary:hover {
    background: var(--mfl-primary, #0e7490);
    border-color: var(--mfl-primary, #0e7490);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 16px -8px rgba(var(--mfv-primary-rgb, 14, 116, 144), .8);
}

.mfv-qv .mfv-qv__btn--primary:hover { background: var(--mfl-primary-dark, #0c5e73); border-color: var(--mfl-primary-dark, #0c5e73); }


/* ============================================================================
   6. NARROW VIEWPORTS
   ----------------------------------------------------------------------------
   The parent hides the whole modal below 768px (`.quick-view-modal{display:none
   !important}` inside its own max-width:768px block) and sends the visitor
   straight to the listing, so only the tablet band needs a stacked layout.
   ========================================================================== */

@media (max-width: 1100px) {
    .mfv-qv { --mfv-qv-pad: 20px; }

    .mfv-qv__cols { flex-direction: column; }

    .mfv-qv .mc-right { max-width: none; }

    .c27-quick-view-modal > .container {
        width: calc(100vw - 32px) !important;
        max-height: 92vh;
        overflow-y: auto;
    }

    .mfv-qv .block-map.c27-map { height: 240px !important; }
}
