/* vlvirtualtour — viewer Marzipano + menu + side-panel + hotspots */

.vltour-preview-banner {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
    padding: 10px 16px;
    border-radius: 4px;
    margin: 0 auto 12px;
    max-width: 1200px;
}

.vltour-embed {
    margin: 32px 0;
}

.vltour-shell {
    position: relative;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.vltour-shell--fullpage {
    aspect-ratio: auto;
    max-height: none;
    height: calc(100vh - 200px);
    min-height: 480px;
    border-radius: 0;
    box-shadow: none;
}

.vltour-viewer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #111;
}

/* ===== Placeholder lazy-load ===== */

.vltour-placeholder {
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: pointer;
    overflow: hidden;
    background: #111;
}
.vltour-placeholder__media,
.vltour-placeholder__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.vltour-placeholder__media img {
    transition: transform 0.4s ease;
}
.vltour-placeholder:hover .vltour-placeholder__media img {
    transform: scale(1.02);
}

.vltour-start {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.15s;
}
.vltour-start:hover,
.vltour-start:focus-visible {
    background: #50af47; /* veloland-primary */
    transform: translate(-50%, -50%) scale(1.04);
    outline: none;
}
.vltour-start[disabled] {
    opacity: 0.7;
    cursor: wait;
}
.vltour-shell.is-loading .vltour-start span::after {
    content: '…';
}

@media (max-width: 480px) {
    .vltour-start {
        padding: 11px 18px;
        font-size: 13px;
        gap: 8px;
    }
    .vltour-start svg { width: 16px; height: 16px; }
}

/* Cache les contrôles tant que Marzipano n'est pas booté.
   NOTE : on laisse .vltour-viewer visible (sous le placeholder, z-index 5)
   pour que Marzipano puisse mesurer correctement le conteneur à l'init.
   Si display:none, dimensions = 0×0 → écran noir au démarrage tant
   qu'un re-layout n'a pas lieu. */
.vltour-shell:not(.is-loaded) .vltour-menu-toggle,
.vltour-shell:not(.is-loaded) .vltour-fullscreen-toggle,
.vltour-shell:not(.is-loaded) .vltour-menu,
.vltour-shell:not(.is-loaded) .vltour-side-panel,
.vltour-shell:not(.is-loaded) .vltour-controls,
.vltour-shell:not(.is-loaded) .vltour-legend {
    display: none !important;
}
/* Une fois loadé, on cache le placeholder */
.vltour-shell.is-loaded .vltour-placeholder {
    display: none;
}

/* ===== Menu scènes (drawer gauche) ===== */

.vltour-menu-toggle,
.vltour-fullscreen-toggle {
    position: absolute;
    top: 12px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.vltour-menu-toggle { left: 12px; }
.vltour-fullscreen-toggle { right: 12px; }

/* Side-panel ouvert → masque le fullscreen pour ne pas chevaucher
   le bouton "Fermer" du panel (même coin) */
.vltour-shell:has(.vltour-side-panel.is-open) .vltour-fullscreen-toggle {
    visibility: hidden;
}

.vltour-menu-toggle:hover,
.vltour-menu-toggle:focus-visible,
.vltour-fullscreen-toggle:hover,
.vltour-fullscreen-toggle:focus-visible {
    background: rgba(0, 0, 0, 0.85);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* En mode fullscreen, le shell occupe tout l'écran */
.vltour-shell.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
}

/* ===== Barre de contrôles bas-centre ===== */

.vltour-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    border-radius: 24px;
}

.vltour-controls__sep {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

.vltour-control {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}
.vltour-control:hover,
.vltour-control:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}
.vltour-control:active {
    background: rgba(255, 255, 255, 0.28);
}

.vltour-control--autorotate {
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile : controls compacts */
@media (max-width: 480px) {
    .vltour-controls {
        bottom: 8px;
        padding: 4px 6px;
        gap: 0;
    }
    .vltour-control { width: 32px; height: 32px; }
    .vltour-controls__sep { margin: 0 2px; }
}

.vltour-menu {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80%;
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    padding: 60px 16px 16px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 8;
}
.vltour-menu--open .vltour-menu {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.vltour-menu__title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin: 0 0 12px;
}

.vltour-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.vltour-menu-list li {
    margin: 0 0 8px;
}

.vltour-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.vltour-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}
.vltour-menu-item.is-active {
    background: rgba(255, 255, 255, 0.14);
    border-color: #fff;
}
.vltour-menu-item img {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.vltour-menu-item__label {
    font-size: 0.9rem;
    line-height: 1.2;
}
.vltour-menu-item__badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: #c97700;
    color: #fff;
    border-radius: 3px;
    font-size: 0.65rem;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Side-panel (info hotspot) ===== */

.vltour-side-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 90%;
    background: #fff;
    color: #222;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 9;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}
.vltour-side-panel.is-open {
    transform: translateX(0);
}

.vltour-close {
    position: absolute;
    top: 12px;
    right: 12px;
    height: 36px;
    padding: 0 14px 0 12px;
    border: 0;
    background: #111;
    color: #fff;
    border-radius: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background 0.15s, transform 0.1s;
    z-index: 2;
}
.vltour-close:hover,
.vltour-close:focus-visible {
    background: #50af47; /* veloland-primary */
    outline: none;
    transform: translateY(-1px);
}
.vltour-close__label {
    line-height: 1;
}

.vltour-panel__title {
    font-size: 1.25rem;
    margin: 56px 0 12px 0;
    color: #111;
}
.vltour-panel__body {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
}
.vltour-panel__body img {
    max-width: 100%;
    border-radius: 6px;
}

/* Boutons "Voir les …" — catégories liées au hotspot */
.vltour-panel__cats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.vltour-panel__cat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #50af47; /* veloland-primary */
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}
.vltour-panel__cat-btn::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.15s;
}
.vltour-panel__cat-btn:hover,
.vltour-panel__cat-btn:focus-visible {
    background: #42873c; /* veloland-primary-dark */
    transform: translateX(2px);
    outline: none;
}
.vltour-panel__cat-btn:hover::after {
    transform: translateX(2px);
}

/* ===== Légende des hotspots (overlay haut-droite, en dessous du bouton fullscreen) ===== */

.vltour-legend {
    position: absolute;
    top: 68px; /* sous le bouton fullscreen (top:12 + h:44 + 12 marge) */
    right: 12px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    backdrop-filter: blur(6px);
    pointer-events: none;
    max-width: 200px;
}
.vltour-legend__item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vltour-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    flex-shrink: 0;
    box-sizing: content-box;
}
.vltour-legend__dot--info { background: #fff; }
.vltour-legend__dot--link { background: #2563eb; }

@media (max-width: 480px) {
    .vltour-legend { display: none; } /* trop encombrant sur mobile */
}

/* ===== Hotspots dans le panorama (chip = dot + label) ===== */

.vltour-hotspot {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    /* padding-left 6px : centre le picto (14px) à 15px du bord externe,
       soit pile au centre du demi-cercle gauche du pill. */
    padding: 6px 16px 6px 6px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.vltour-hotspot:hover,
.vltour-hotspot:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    outline: none;
}

.vltour-hotspot__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    flex-shrink: 0;
}
.vltour-hotspot__icon svg {
    width: 10px;
    height: 10px;
}
.vltour-hotspot--link .vltour-hotspot__icon {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
}

.vltour-hotspot__label {
    line-height: 1;
    margin-left: 8px;
}

/* sr-only utility (au cas où la classe n'existe pas dans le theme) */
.vltour-shell .sr-only,
.vltour-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile : on garde le label, on ne fait que rétrécir les marges */
@media (max-width: 768px) {
    .vltour-menu {
        width: 220px;
        padding-top: 56px;
    }
    .vltour-side-panel {
        width: 100%;
    }
    .vltour-hotspot {
        font-size: 11px;
        padding: 4px 10px 4px 8px;
    }
}
