/* ===== Metem Hotspot Frontend ===== */

/* --- Hotspot dots on gallery slides --- */
.mh-slide-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.mh-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 7;
}

/* Dot button */
.mh-hs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mh-color, #1963A4);
  border: 3px solid rgba(255,255,255,.9);
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  cursor: pointer;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}

.mh-hs-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--mh-color, #1963A4);
  opacity: .2;
  animation: mh-hs-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes mh-hs-pulse {
  0%, 100% { transform: scale(1); opacity: .22; }
  50%       { transform: scale(1.45); opacity: 0; }
}

.mh-hs-btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  border-radius: 2px;
}

.mh-hs-btn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

/* Sticker popup */
.mh-sticker {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 160px;
  max-width: 240px;
  background: rgba(20,20,20,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 10px 12px;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}

/* Arrow at bottom */
.mh-sticker::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(20,20,20,.88);
}

/* Reposition if near bottom of slide */
.mh-hotspot.is-bottom .mh-sticker {
  bottom: auto;
  top: calc(100% + 14px);
  transform: translateX(-50%) translateY(-6px);
}
.mh-hotspot.is-bottom .mh-sticker::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(20,20,20,.88);
}

/* Reposition if near right edge */
.mh-hotspot.is-right .mh-sticker {
  left: auto;
  right: 0;
  transform: translateY(6px);
}
.mh-hotspot.is-right .mh-sticker::after {
  left: auto;
  right: 14px;
}

/* Reposition if near left edge */
.mh-hotspot.is-left .mh-sticker {
  left: 0;
  transform: translateY(6px);
}
.mh-hotspot.is-left .mh-sticker::after {
  left: 14px;
}

/* Active / hover */
.mh-hotspot:hover .mh-hs-btn,
.mh-hotspot.is-active .mh-hs-btn {
  transform: scale(1.15);
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
}

.mh-hotspot:hover .mh-sticker,
.mh-hotspot.is-active .mh-sticker {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mh-hotspot.is-right:hover .mh-sticker,
.mh-hotspot.is-right.is-active .mh-sticker {
  transform: translateY(0);
}

.mh-hotspot.is-left:hover .mh-sticker,
.mh-hotspot.is-left.is-active .mh-sticker {
  transform: translateY(0);
}

.mh-hotspot.is-bottom:hover .mh-sticker,
.mh-hotspot.is-bottom.is-active .mh-sticker {
  transform: translateX(-50%) translateY(0);
}

/* Sticker content */
.mh-sticker-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mh-sticker-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
}

.mh-sticker-texts {
  flex: 1;
  min-width: 0;
}

.mh-sticker-label {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,.62);
  line-height: 1.2;
  margin-bottom: 2px;
}

.mh-sticker-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-sticker-arrow {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  align-self: center;
  flex-shrink: 0;
  margin-left: 2px;
}

/* Accent color bar at bottom of sticker */
.mh-sticker-bar {
  height: 3px;
  border-radius: 0 0 14px 14px;
  background: var(--mh-color, #1963A4);
  margin: 8px -12px -10px;
}

/* --- Row display (Ozon style) --- */
.mh-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}

.mh-row-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.mh-row-link:hover .mh-row-item {
  border-color: var(--mh-color, #1963A4);
  background: rgba(25,99,164,.06);
}

.mh-row-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px 7px 7px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
  min-width: 110px;
  transition: border-color .18s, background .18s;
}

.mh-row-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mh-row-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

/* Item without an icon: keep label/value centered inside the plaque */
.mh-row-item.mh-no-icon {
  padding: 7px 12px;
}

.mh-row-item.mh-no-icon .mh-row-text {
  align-items: center;
}

.mh-row-item.mh-no-icon .mh-row-label,
.mh-row-item.mh-no-icon .mh-row-value {
  text-align: center;
}

.mh-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.mh-row-label {
  font-size: 10px;
  color: #787c82;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-row-value {
  font-size: 13px;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Fullscreen overlay hotspots --- */
.mh-fs-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10002;
}

.mh-fs-layer .mh-hotspot {
  pointer-events: auto;
}

/* Touch: keep sticker visible on tap */
@media (hover: none) and (pointer: coarse) {
  .mh-sticker {
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .mh-hs-btn {
    width: 26px;
    height: 26px;
  }
  .mh-sticker {
    min-width: 130px;
    max-width: 190px;
    font-size: 12px;
  }
  .mh-row-item {
    padding: 5px 8px 5px 5px;
  }
  .mh-row-label { font-size: 9px; }
  .mh-row-value { font-size: 12px; }
}

/* ===== v1.2: dot opacity, label chip, spots toggle ===== */

/* Dot opacity setting (default 50%) */
.mh-hs-btn {
  opacity: var(--mh-opacity, 0.5);
}

/* Ghost mode: on hover the dot fades away so the photo underneath is visible */
.mh-hotspot.mh-fade:hover .mh-hs-btn {
  opacity: .08;
}

.mh-hotspot:hover .mh-hs-btn,
.mh-hotspot.is-active .mh-hs-btn {
  opacity: 1;
}

/* Always-visible part of the title next to the dot */
.mh-hs-label {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(20, 20, 20, .75);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 8px;
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
}

.mh-hotspot.is-right .mh-hs-label {
  left: auto;
  right: calc(100% + 8px);
}

.mh-hotspot:hover .mh-hs-label,
.mh-hotspot.is-active .mh-hs-label {
  opacity: 0;
  visibility: hidden;
}

/* Spots toggle button (top-left corner of the gallery) */
.mlg_wrap .mlg_btn.mh_toggle {
  left: 10px !important;
  right: auto !important;
  top: 10px !important;
  bottom: auto !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  transform: none !important;
}

.mlg_wrap .mlg_btn.mh_toggle svg {
  width: 12px !important;
  height: 12px !important;
}

.mlg_wrap.mh-spots-off .mh-slide-layer {
  display: none !important;
}

/* Fullscreen eye button (next to the close X: X is 30px at right:10) */
.mlg_fs_inner .mh_toggle_fs {
  position: absolute;
  right: 48px;
  top: 10px;
  z-index: 3;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  cursor: pointer;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
}

.mlg_fs_inner .mh_toggle_fs svg {
  width: 14px;
  height: 14px;
}

.mlg_fs_inner .mh_toggle_fs:hover {
  background: rgba(255, 255, 255, .22);
}

@media (max-width: 767px) {
  .mlg_wrap .mlg_btn.mh_toggle {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
  }

  .mh-hs-label {
    max-width: 90px;
    font-size: 10px;
  }
}
