/* ============================
   RESET & STRUTTURA FULLSCREEN
   ============================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  background-color: #050505;
  color: #fff;
}

main {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#tour-viewer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ============================
   HEADER FLUTTUANTE
   ============================ */
header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: transparent;
  z-index: 10;
  pointer-events: none;
}

header * {
  pointer-events: auto;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 100px;
  max-height: 100%;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
  object-fit: contain;
}

.brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.2;
  color: #000000;
  text-transform: uppercase;
}

/* ============================
   BOX TITOLO CENTRALE
   ============================ */
.title-box-container {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #d4af37;
  padding: 5px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 10px rgba(212, 175, 55, 0.3);
}

.title-box-inner {
  background: #111111;
  border: 1px solid #d4af37;
  padding: 8px 30px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title-text-main {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background-image: linear-gradient(90deg, #d4af37, #f7e9b5, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 3;
  white-space: nowrap;
  text-align: center;
}

.title-text-sub {
  font-size: 18px;
}

.title-text-glow {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: transparent;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes glowLuxuryAligned {
  0%, 100% { text-shadow: 0 0 0px rgba(212,175,55,0); }
  50% { text-shadow: 0 0 15px rgba(212,175,55,0.8); }
}

.oro-glow {
  animation: glowLuxuryAligned 3s ease-in-out infinite;
}

.header-spacer {
  width: 180px;
}

/* ============================
   PULSANTIERA LATERALE FLUTTUANTE
   ============================ */
.controls {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 14px;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 65px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.icon-btn {
  width: 68px;
  height: 68px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #d4af37;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  outline: none;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.icon-btn:hover {
  transform: scale(1.1);
  background: rgba(20, 20, 20, 0.95);
  border-color: #ffffff;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.9);
}

.icon-btn:hover img {
  transform: scale(1.08);
}

/* ============================
   FOOTER FLUTTUANTE (Desktop & Base)
   ============================ */
footer {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  z-index: 10;
  pointer-events: auto;
  white-space: nowrap;
}

#mini-screen {
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
}

#mini-screen a {
  background: linear-gradient(90deg, #ffd700, #fff4d0, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.3s ease;
}

#mini-screen a:hover {
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
  text-decoration: none;
}

/* ============================
   FINESTRA POP-UP & LIGHTBOX
   ============================ */
#htmlWindow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  z-index: 999999;
}

#htmlContent {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80vw;
  max-width: 1000px;
  height: 75vh;
  transform: translate(-50%, -50%);
  background: #121212;
  border: 2px solid #d4af37;
  border-radius: 12px;
  padding: 30px;
  box-sizing: border-box;
  overflow-y: auto;
  color: #fff;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

#modalBody {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#htmlContent.popup-map {
  height: 85vh !important;
  width: 90vw !important;
  max-width: 1400px !important;
  padding: 10px !important;
  overflow: hidden !important;
}

#htmlContent.popup-map iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
}

#htmlClose {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 35px;
  color: #d4af37;
  cursor: pointer;
  z-index: 1000000;
  transition: transform 0.2s;
}

#htmlClose:hover {
  transform: scale(1.2);
}

.info-text-container {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 16px;
  color: #e0e0e0;
}

#htmlContent.popup-catalog {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #111 !important;
}

#htmlContent.popup-catalog #modalBody {
  display: block !important;
  height: 100% !important;
}

/* STILI BIOGRAFIA E LINK ORO */
.biografia-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.biografia-title {
  color: #d4af37;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.biografia-header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.biografia-img {
  max-width: 500px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid #d4af37;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
  cursor: zoom-in;
}

.biografia-contacts {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 5px;
  margin-bottom: 10px;
}

.gold-link {
  color: #d4af37 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.4);
}

.gold-link:hover {
  color: #ffffff !important;
  border-bottom-color: #ffffff;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.gold-separator {
  color: #d4af37;
  font-weight: bold;
}

/* BANNER RECENSIONE POPUP */
.banner-recensione {
  margin-top: 25px;
  padding: 15px;
  background: rgba(212,175,55,0.1);
  border: 1px solid #d4af37;
  border-radius: 8px;
  text-align: center;
}

.banner-recensione-title {
  color: #fff;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.banner-recensione-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #d4af37;
  color: #111;
  font-weight: bold;
  text-decoration: none;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 1px;
  transition: transform 0.2s, background 0.2s;
}

.banner-recensione-btn:hover {
  transform: scale(1.05);
  background: #f7e9b5;
}

/* LIGHTBOX */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000000;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: 2px solid #d4af37;
  border-radius: 8px;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 45px;
  color: #d4af37;
  cursor: pointer;
}

/* ============================
   PULSANTE PRENOTARTE
   ============================ */
.booking-corner {
  position: absolute !important;
  bottom: 25px !important;
  left: 25px !important;
  z-index: 10 !important;
}

.booking-btn-text {
  background: rgba(10, 10, 10, 0.75) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid #d4af37 !important;
  border-radius: 30px !important;
  padding: 12px 28px !important;
  color: #d4af37 !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(212, 175, 55, 0.3) !important;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
  outline: none !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.booking-btn-text:hover {
  transform: scale(1.08) !important;
  background: rgba(20, 20, 20, 0.9) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.9) !important;
}

/* ============================
   STILI SELEZIONE POPUP VR
   ============================ */
.vr-modal-container {
  text-align: center;
  padding: 10px;
}

.vr-modal-title {
  color: #d4af37;
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.vr-modal-subtitle {
  color: #ccc;
  font-size: 14px;
  margin-bottom: 25px;
}

.vr-options-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.vr-card {
  flex: 1;
  min-width: 240px;
  max-width: 300px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #d4af37;
  border-radius: 12px;
  padding: 25px 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vr-card:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: #ffffff;
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.vr-card-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.vr-card-title {
  color: #d4af37;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.vr-card-desc {
  color: #aaa;
  font-size: 12px;
  line-height: 1.4;
}

/* ============================
   UNICO BLOCCO RESPONSIVE (MOBILE)
   ============================ */
@media screen and (max-width: 768px) {
  body, html {
    height: 100%;
    height: -webkit-fill-available;
  }

  main {
    height: 100vh;
    height: 100dvh;
  }

  header {
    padding: 10px 15px;
    height: auto;
    flex-direction: column;
    gap: 8px;
    background: transparent;
  }

  .header-spacer {
    display: none;
  }

  .logo {
    height: 65px;
  }

  .title-box-container {
    width: 92vw;
  }

  .title-box-inner {
    padding: 10px 15px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .title-text-main {
    font-size: 12px;
    white-space: normal;
    text-align: center;
    width: 100%;
    line-height: 1.4;
  }

  .title-text-glow {
    font-size: 12px;
    white-space: normal;
    text-align: center;
    width: 100%;
    line-height: 1.4;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .title-text-sub {
    font-size: 11px;
  }

  /* 1. PULSANTIERA ORIZZONTALE CENTRATA */
  .controls {
    position: fixed;
    right: 50%;
    top: auto;
    bottom: 65px; /* Spaziata correttamente sopra il footer */
    transform: translateX(50%);
    flex-direction: row;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 40px;
    max-width: 95vw;
    overflow-x: auto;
    background: rgba(10, 10, 10, 0.9);
    z-index: 998;
  }

  .icon-btn {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
  }

  .icon-btn img {
    width: 26px;
    height: 26px;
  }

  .icon-btn:hover {
    transform: none;
    box-shadow: none;
  }

  /* 2. FOOTER FISSO IN BASSO */
  footer,
  .splash-footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    z-index: 999;
    width: auto;
    white-space: nowrap;
    padding: 4px 15px;
    font-size: 10px;
  }

  /* 3. PULSANTE PRENOTA L'ARTE BEN STACCATO SOPRA */
  .booking-corner {
    position: fixed !important;
    bottom: 135px !important; /* Ben staccato dalla pulsantiera sottostante */
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100%;
    text-align: center;
    z-index: 997 !important;
  }

  .booking-btn-text {
    padding: 8px 20px !important;
    font-size: 11px !important;
    letter-spacing: 2px !important;
  }

  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  #htmlContent {
    width: 92vw;
    height: 80vh;
    padding: 20px 15px;
  }

  #htmlContent.popup-map {
    width: 95vw !important;
    height: 75vh !important;
  }

  .biografia-contacts {
    flex-direction: column;
    gap: 6px;
  }

  .gold-separator {
    display: none;
  }

  .vr-options-grid {
    flex-direction: column;
    align-items: center;
  }

  .vr-card {
    width: 100%;
  }
}

/* ============================
   SCROLLBAR LUXURY GLOBALE
   ============================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #111111;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af37 0%, #8a6d1c 100%);
  border-radius: 4px;
  border: 1px solid #111111;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f7e9b5 0%, #d4af37 100%);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #111111;
}

/* ============================
   EFFETTO PULSAZIONE MAPPA
   ============================ */
@keyframes mapPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.8);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(212, 175, 55, 0);
    transform: scale(1.06);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    transform: scale(1);
  }
}

.pulse-play {
  position: relative;
  animation: mapPulse 2s infinite ease-in-out;
}

/* FULLSCREEN */
:fullscreen main,
:-webkit-full-screen main {
  width: 100vw;
  height: 100vh;
}

:fullscreen .controls,
:fullscreen header,
:fullscreen footer,
:fullscreen .booking-corner {
  z-index: 99999 !important;
}

/* ============================
   SPIEGAZIONE PULSANTI
   ============================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid #d4af37;
  border-radius: 16px;
  padding: 30px;
  max-width: 450px;
  width: 90%;
  color: #ffffff;
  font-family: sans-serif;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  position: relative;
  text-align: left;
}

.modal-content h2 {
  color: #d4af37;
  margin-top: 0;
  font-size: 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 10px;
}

.modal-content p {
  font-size: 15px;
  line-height: 1.6;
  color: #dddddd;
  margin-top: 15px;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  color: #ffffff;
  border: 1px solid #d4af37;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(212, 175, 55, 0.3);
}

/* ============================
   TOOLTIP AL PASSAGGIO DEL MOUSE (HOVER)
   ============================ */
#customTooltip {
  position: fixed;
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid #d4af37;
  border-radius: 10px;
  padding: 12px 18px;
  max-width: 300px;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 5px 20px rgba(0,0,0,0.8);
  z-index: 10005;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#customTooltip h3 {
  color: #d4af37;
  margin: 0 0 6px 0;
  font-size: 15px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 4px;
}

#customTooltip p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #dddddd;
}

/* ============================
   STILI SPLASH SCREEN / COPERTINA
   ============================ */
#intro-cover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 1s ease;
}

#intro-cover img.bg-copertina {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  z-index: 1;
}

.splash-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  max-width: 800px;
  margin-top: 300px;
}

@media screen and (max-width: 768px) {
  .splash-content {
    margin-top: 300px;
  }

  .splash-title {
    -webkit-text-stroke: 1px #000000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  }
}

@keyframes titleGlowPulse {
  0%, 100% {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4), 0 0 20px rgba(212, 175, 55, 0.2);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.9), 0 0 35px rgba(247, 233, 181, 0.8), 0 0 50px rgba(212, 175, 55, 0.6);
    transform: scale(1.02);
  }
}

.splash-title {
  color: #d4af37;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #d4af37, #fff6d6, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGlowPulse 3s ease-in-out infinite;
}

.splash-subtitle {
  color: #ffffff;
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 1px;
  margin-bottom: 30px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.splash-btn {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  border: 2px solid #d4af37;
  color: #d4af37;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
}

.splash-btn:hover {
  background: #d4af37;
  color: #000000;
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
}

.splash-lang-switch {
  position: absolute;
  top: 25px;
  right: 30px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.lang-option-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #d4af37;
  color: #d4af37;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 20px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  transition: all 0.3s ease;
}

.lang-option-btn.active, 
.lang-option-btn:hover {
  background: #d4af37;
  color: #000000;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
  transform: scale(1.05);
}

.splash-footer {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #ffffff;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: sans-serif;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.15);
  z-index: 10;
  pointer-events: auto;
  white-space: nowrap;
}

.splash-footer a {
  color: #d4af37;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.splash-footer a:hover {
  color: #ffffff;
}

/* ============================
   VISUALIZZATORE CATALOGO NEL POPUP
   ============================ */
#popupCatalogViewer {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 75vh;
  margin: 0 auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}

#popupCatalogViewer:active {
  cursor: grabbing;
}

#popupCatalogImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

#closePopupBtn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.6);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  transition: background 0.2s, transform 0.2s;
}

#closePopupBtn:hover {
  background: rgba(212, 175, 55, 0.9);
  color: #000;
  transform: scale(1.1);
}

#popupPageIndicator {
  position: absolute;
  top: 15px;
  right: 65px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid rgba(212, 175, 55, 0.4);
  z-index: 10;
}

@keyframes popupWiggle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-8px) rotate(-10deg); }
  75% { transform: translateX(8px) rotate(10deg); }
}

#popupBadge {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, 0.85);
  border: 2px solid #d4af37;
  padding: 10px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
  z-index: 10;
}

#popupBadge span:first-child {
  font-size: 24px;
  display: inline-block;
  animation: popupWiggle 1.2s ease-in-out infinite;
}

#popupBadge span:last-child {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

