/* ══════════════════════════════════════════════════
   Localisation outil sur le panneau — index.php / viewer.php (v1-3)
══════════════════════════════════════════════════ */

/* ── Bouton dans le header ─────────────────────── */
.btn-localiser {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  flex-shrink: 0;
}

.btn-localiser:hover { color: var(--text-primary); }

/* ── Overlay fond ──────────────────────────────── */
#loc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#loc-overlay.visible {
  display: flex;
}

/* ── Modal ─────────────────────────────────────── */
.loc-modal {
  background: var(--color-surface, #1e2a3a);
  border-radius: 20px;
  overflow: hidden;
  max-width: 800px;
  width: 100%;
  /* 1-3 : la modale ne dépasse jamais l'overlay (panneaux portrait) */
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: loc-modal-in 0.18s ease-out;
}

@keyframes loc-modal-in {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ── Header du modal ───────────────────────────── */
.loc-modal-header {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.panneau-loc-link {
  margin-left: auto;
  font-size: 12px;
  color: #e5a000;
  text-decoration: none;
  font-weight: 600;
}

.panneau-loc-link:hover { text-decoration: underline; }

.loc-close {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 2px;
  margin-left: 4px;
}

.loc-close:hover { opacity: 1; }

/* ── Thème clair ─────────────────────────────────── */
[data-theme="light"] .loc-modal {
  background: var(--color-surface, #ffffff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .loc-modal-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .loc-close {
  color: var(--text-primary);
}

/* ── Image panneau ─────────────────────────────── */
/* 1-3 : le wrapper épouse l'image (le hotspot est positionné en % du
   wrapper, il doit donc avoir exactement les dimensions de l'image) et
   la hauteur de l'image est plafonnée à la fenêtre : un panneau portrait
   (ex. « Direction ») ne déborde plus de l'écran en desktop/tablette.
   Hauteur max = hauteur écran − padding overlay (2×20) − header modale (~48). */
.panneau-loc-wrap {
  position: relative;
  line-height: 0;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.panneau-loc-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 88px);
  max-height: calc(100dvh - 88px);
}

/* ── Hotspot surligné ──────────────────────────── */
.panneau-loc-spot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-primary);
  background: #e53535;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

@keyframes loc-pulse {
  0%   { box-shadow: 0 0 0 0px  rgba(229,53,53,0.8),
                     0 0 0 0px  rgba(229,53,53,0.4); }
  70%  { box-shadow: 0 0 0 24px rgba(229,53,53,0),
                     0 0 0 36px rgba(229,53,53,0); }
  100% { box-shadow: 0 0 0 0px  rgba(229,53,53,0),
                     0 0 0 0px  rgba(229,53,53,0); }
}

.panneau-loc-pulse {
  animation: loc-pulse .5s ease-out infinite;
}

/* ══════════════════════════════════════════════════
   Sélection de l'atelier préférentiel — index.php/viewer.php
   Réutilise .loc-modal / .loc-modal-header / .loc-close ci-dessus,
   même overlay que #loc-overlay (fond, centrage, animation) — seul
   l'id change puisque les deux modales peuvent exister simultanément
   dans le DOM (jamais visibles en même temps en pratique).
══════════════════════════════════════════════════ */
#atelier-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#atelier-overlay.visible { display: flex; }

.atelier-modal { max-width: 420px; }

.atelier-modal-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.atelier-modal-intro {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.atelier-select {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: var(--bg-page, #12192a);
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 14px;
}
[data-theme="light"] .atelier-select {
  background: #fff;
  border-color: rgba(0,0,0,.14);
}
.btn-atelier-valider {
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--accent-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-atelier-valider:hover { background: #5aa3ff; }

/* ── Logo de l'atelier sélectionné, accolé au bouton storefront (index-atelier.php)
   40x40 dans TOUS les affichages (header desktop/tablette paysage ET barre
   sticky mobile) — pas de variante par breakpoint, contrairement au bandeau
   "Votre atelier" (panneau-atelier.php), qui lui varie de taille. ── */
.btn-atelier-logo {
  width: 40px; height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: var(--bg-surface);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-atelier-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
[data-theme="light"] .btn-atelier-logo { border-color: rgba(0,0,0,.14); }

/* Bouton "changer d'atelier" dans le header — même habillage que .btn-back-cat
   (index.php) pour le desktop/tablette paysage, et .btn-icon-sticky pour la
   barre sticky mobile, réutilisés tels quels : aucune règle propre requise ici. */
