/* ============================================
   BA111OD Watch Details – Hotspot Section
   ============================================ */

.wd-section {
  --wd-font: "Prompt", "Helvetica Neue", Arial, sans-serif;
  --wd-accent: #123326;
  --wd-tooltip-bg: #ffffff;
  --wd-tooltip-color: #1a1a1a;
  --wd-tooltip-width: clamp(240px, 18vw + 60px, 360px);
  --wd-tooltip-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --wd-tooltip-radius: 8px;
  --wd-transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  --wd-hotspot-size: clamp(32px, 2.5vw + 12px, 48px);

  position: relative;
  font-family: var(--wd-font);
  font-weight: 300;
  line-height: 1.5;
  color: var(--wd-tooltip-color);
  max-width: 1800px;
  margin-inline: auto;
}

/* ---- Heading with decorative rules ---- */

.wd-section__heading {
  font-family: var(--wd-font);
  font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.5rem);
  font-weight: 300;
  text-align: center;
  margin: 0 0 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wd-tooltip-color);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  padding-inline: clamp(1rem, 4vw, 3rem);
}

.wd-section__heading::before,
.wd-section__heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--wd-accent);
  opacity: 0.2;
}

/* ---- Image container ---- */

.wd-container {
  position: relative;
  width: 100%;
  overflow: visible;
}

.wd-container__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Placeholder ---- */

.wd-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
}

.wd-placeholder svg {
  opacity: 0.3;
}

/* ---- Hotspot ---- */

.wd-hotspot {
  position: absolute;
  z-index: 2;
  left: var(--wd-x);
  top: var(--wd-y);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.wd-hotspot--active {
  z-index: 95;
}

/* Staggered entrance when section scrolls into view */
.wd-section--visible .wd-hotspot {
  animation: wd-hotspot-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--wd-enter-delay, 0ms);
}

@keyframes wd-hotspot-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Frosted glass hotspot button */
.wd-hotspot__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wd-hotspot-size);
  height: var(--wd-hotspot-size);
  border-radius: 50%;
  border: 1.5px solid var(--wd-accent);
  background: color-mix(in srgb, var(--wd-accent) 35%, rgba(10, 10, 10, 0.2));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--wd-icon-color, #ffffff);
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  transition:
    transform var(--wd-transition),
    background-color var(--wd-transition),
    border-color var(--wd-transition),
    box-shadow var(--wd-transition);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.wd-hotspot__btn:hover {
  transform: scale(1.08);
  background: var(--wd-accent);
  border-color: var(--wd-accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.wd-hotspot--active .wd-hotspot__btn {
  background: var(--wd-accent);
  border-color: var(--wd-accent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.wd-hotspot__btn:focus-visible {
  outline: 2px solid var(--wd-accent);
  outline-offset: 3px;
}

/* "+" icon rotates to "x" when active */
.wd-hotspot__icon {
  display: block;
  transition: transform var(--wd-transition);
  font-weight: 300;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.wd-hotspot--active .wd-hotspot__icon {
  transform: rotate(45deg);
}

/* Breathing glow animation (replaces expanding pulse) */
.wd-hotspot__pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--wd-accent);
  animation: wd-breathe 3s ease-in-out infinite;
  pointer-events: none;
}

.wd-hotspot--active .wd-hotspot__pulse {
  animation: none;
  opacity: 0;
}

@keyframes wd-breathe {
  0%, 100% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.15);
  }
}

/* ---- Tooltip ---- */

.wd-tooltip {
  position: absolute;
  z-index: 10;
  width: var(--wd-tooltip-width);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  filter: blur(3px);
  /*
   * Symmetric open/close animation: both directions use the same
   * cubic ease and the same set of properties (opacity, visibility,
   * filter), so closing a tooltip defocuses and fades out with the
   * same rhythm as opening it focuses and fades in.
   */
  transition:
    opacity var(--wd-transition),
    visibility var(--wd-transition),
    filter var(--wd-transition);
}

.wd-hotspot--active .wd-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  filter: blur(0);
}

.wd-tooltip__inner {
  position: relative;
  background: var(--wd-tooltip-bg);
  border-radius: var(--wd-tooltip-radius);
  box-shadow: var(--wd-tooltip-shadow);
  overflow: hidden;
}

/* Directional positioning */
.wd-tooltip--below {
  top: calc(100% + clamp(8px, 0.75vw + 2px, 14px));
}

.wd-tooltip--above {
  bottom: calc(100% + clamp(8px, 0.75vw + 2px, 14px));
}

.wd-tooltip--right {
  left: 50%;
}

.wd-tooltip--left {
  right: 50%;
}

/* ---- Tooltip content ---- */

.wd-tooltip__image {
  width: 100%;
  overflow: hidden;
}

.wd-tooltip__image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.wd-tooltip__image:hover img {
  transform: scale(1.04);
}

.wd-tooltip__title {
  font-family: var(--wd-font);
  font-size: clamp(0.8125rem, 0.5vw + 0.625rem, 0.9375rem);
  font-weight: 600;
  margin: 0;
  padding: clamp(10px, 1vw + 4px, 16px) clamp(12px, 1vw + 6px, 18px) 0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--wd-tooltip-color);
}

.wd-tooltip__desc {
  font-family: var(--wd-font);
  font-size: clamp(0.75rem, 0.4vw + 0.5625rem, 0.875rem);
  font-weight: 300;
  margin: 0;
  padding: clamp(4px, 0.5vw + 2px, 8px) clamp(12px, 1vw + 6px, 18px) clamp(10px, 1vw + 4px, 16px);
  color: #555;
  line-height: 1.55;
}

/* Close button – transparent by default, solid bg when overlapping an image */
.wd-tooltip__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(24px, 1.5vw + 10px, 32px);
  height: clamp(24px, 1.5vw + 10px, 32px);
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #333;
  cursor: pointer;
  padding: 0;
  transition: background var(--wd-transition);
  z-index: 1;
}

/* When an image precedes the close button, give it a visible background */
.wd-tooltip__image ~ .wd-tooltip__close {
  background: rgba(255, 255, 255, 0.9);
}

.wd-tooltip__close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.wd-tooltip__close:focus-visible {
  outline: 2px solid var(--wd-accent);
  outline-offset: 2px;
}

/* ---- Mobile overlay & bottom sheet ---- */

.wd-section--overlay::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  animation: wd-fade-in 0.2s ease;
}

@keyframes wd-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Responsive: tablet (601–900px) ---- */

@media (max-width: 900px) and (min-width: 601px) {
  .wd-section {
    --wd-tooltip-width: clamp(200px, 28vw + 40px, 300px);
    --wd-hotspot-size: clamp(28px, 3vw + 8px, 40px);
  }

  .wd-hotspot__btn {
    font-size: 16px;
  }
}

/* ---- Responsive: mobile bottom sheet (≤600px) ---- */

@media (max-width: 600px) {
  .wd-section__heading {
    padding-inline: 1rem;
  }

  /* Disable blur on mobile for performance; keep fast fadeout on close */
  .wd-tooltip {
    filter: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }

  /* Use mobile custom properties; remove transform so position:fixed on the tooltip escapes to the viewport */
  .wd-hotspot {
    left: var(--wd-mobile-x, var(--wd-x));
    top: var(--wd-mobile-y, var(--wd-y));
    transform: none;
    margin-left: calc(var(--wd-hotspot-size) / -2);
    margin-top: calc(var(--wd-hotspot-size) / -2);
    opacity: 0;
  }

  .wd-section--visible .wd-hotspot {
    animation: wd-hotspot-enter-mobile 0.5s ease forwards;
    animation-delay: var(--wd-enter-delay, 0ms);
  }

  @keyframes wd-hotspot-enter-mobile {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .wd-hotspot--active .wd-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    overflow: hidden;
    z-index: 100;
  }

  .wd-tooltip__inner {
    display: flex;
    flex-direction: column;
    border-radius: 0;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .wd-tooltip__image {
    flex-shrink: 0;
  }

  .wd-tooltip__title {
    padding: 20px 20px 0;
    font-size: 1.0625rem;
  }

  .wd-tooltip__desc {
    padding: 8px 20px 24px;
    font-size: 0.9375rem;
    line-height: 1.65;
  }

  .wd-tooltip__close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.06);
  }

  .wd-tooltip__image ~ .wd-tooltip__close {
    background: rgba(255, 255, 255, 0.9);
  }

}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .wd-hotspot__pulse {
    animation: none;
  }

  .wd-hotspot {
    opacity: 1 !important;
    animation: none !important;
  }

  .wd-tooltip {
    transition: opacity 0.1s ease, visibility 0.1s ease;
    filter: none !important;
  }

  .wd-hotspot__icon {
    transition: none;
  }

  .wd-hotspot__btn {
    transition: none;
  }

  .wd-tooltip__image img {
    transition: none;
  }
}
