/* VFK slide-in panel (7.24.0): shared by the locations map and the vendor
 * directory. Script: assets/js/vfk-slide-panel.js. First built for the map
 * in 7.23.0, where these rules lived in vfk-map.css. */

/* ───────────────────────────────────────────────────────────────────
 * v7.23.0: slide-in panel for marker links
 *
 * Covers the whole map wrapper (map + list pane) and slides in from the
 * right. The map underneath is left running, so closing the panel shows
 * it exactly as it was. On phones the panel fills the screen instead:
 * the map there is short, and a page squeezed into it is hard to read.
 * ─────────────────────────────────────────────────────────────────── */
.vfk-slide {
    position: absolute;
    inset: 0;
    z-index: 20; /* above every map overlay (locpick is 7) */
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -8px 0 24px rgba(15, 23, 42, .18);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
}
.vfk-slide.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s ease, visibility 0s linear 0s;
}
.vfk-map-wrap--slide-open {
    overflow: hidden; /* no sideways scrollbar while the panel moves */
}
@media (prefers-reduced-motion: reduce) {
    .vfk-slide,
    .vfk-slide.is-open { transition: none; }
}
@media (max-width: 640px) {
    .vfk-slide {
        position: fixed;
        z-index: 100000;
    }
}

.vfk-slide__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    font-size: 14px;
    line-height: 1.3;
}
.vfk-slide__back {
    flex: 0 0 auto;
    border: 1px solid #0b8276;
    border-radius: 999px;
    background: #fff;
    color: #0b8276;
    font-weight: 700;
    font-size: 14px;
    padding: 7px 14px;
    cursor: pointer;
}
.vfk-slide__back:hover,
.vfk-slide__back:focus-visible { background: #0b8276; color: #fff; }
.vfk-slide__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #1f2937;
}
.vfk-slide__full {
    flex: 0 0 auto;
    color: #0b8276;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.vfk-slide__full:hover { text-decoration: underline; }
.vfk-slide__close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}
.vfk-slide__close:hover { color: #1f2937; }
@media (max-width: 480px) {
    .vfk-slide__title,
    .vfk-slide__full { display: none; } /* keep Back and X on a phone */
    .vfk-slide__bar { justify-content: space-between; }
}

.vfk-slide__body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}
.vfk-slide__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.vfk-slide__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    background: #fff;
}
.vfk-slide__loading[hidden] { display: none; }


/* ───────────────────────────────────────────────────────────────────
 * Fixed mode (vendor directory): a right-hand drawer over the whole
 * window, with a backdrop that closes it. Phones get the full screen
 * from the rule above.
 * ─────────────────────────────────────────────────────────────────── */
.vfk-slide--fixed {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(1000px, 92vw);
    z-index: 100000;
}
@media (max-width: 640px) {
    .vfk-slide--fixed { inset: 0; width: 100%; }
}
.vfk-slide-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.vfk-slide-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s ease, visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
    .vfk-slide-backdrop,
    .vfk-slide-backdrop.is-open { transition: none; }
}
/* No page scrolling behind an open drawer. */
html.vfk-slide-lock,
html.vfk-slide-lock body { overflow: hidden; }

/* v7.25.0: optional tabs under the bar (vendor directory: Profile | Menu |
 * Gallery). Hidden unless the panel was opened with two or more tabs. */
.vfk-slide__tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
    padding: 0 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    overflow-x: auto;
}
.vfk-slide__tabs[hidden] { display: none; }
.vfk-slide__tab {
    flex: 0 0 auto;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 14px 7px;
    cursor: pointer;
}
.vfk-slide__tab:hover { color: #0b8276; }
.vfk-slide__tab[aria-selected="true"] {
    color: #0b8276;
    border-bottom-color: #0b8276;
}
