/* ═══════════════════════════════════════════════════════
   ASCENDA — Digital Archive / Lookbook Styles
   Full-screen lookbook with interactive hotspots
   ═══════════════════════════════════════════════════════ */

/* ── Archive Gallery ── */
.archive-gallery {
  width: 100%;
  min-height: 100vh;
  padding-top: 72px;
  background: var(--bg-primary);
}

.archive-header {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
}

.archive-header__overline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  margin-bottom: var(--space-sm);
}

.archive-header__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, var(--text-primary) 30%, var(--text-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.archive-header__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Slides ── */
.archive-slides {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  padding: 0 var(--space-lg) var(--space-3xl);
  max-width: 1400px;
  margin: 0 auto;
}

.archive-slide {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  transition: border-color var(--transition-base);
}

.archive-slide:hover {
  border-color: var(--glass-border-hover);
}

.archive-slide__image {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.archive-slide__title {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(10px);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  pointer-events: none;
  z-index: 5;
}

/* ── Hotspot ── */
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 10;
  cursor: pointer;
}

.hotspot__marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(200, 169, 126, 0.3);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  position: relative;
  backdrop-filter: blur(4px);
}

.hotspot__marker::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(200, 169, 126, 0.2);
  animation: hotspot-pulse 2s ease-in-out infinite;
}

.hotspot__marker::after {
  content: '+';
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  line-height: 1;
}

.hotspot:hover .hotspot__marker,
.hotspot.active .hotspot__marker {
  background: var(--accent);
  transform: scale(1.2);
  box-shadow: 0 0 20px var(--accent-glow-strong), 0 0 40px var(--accent-glow);
}

.hotspot:hover .hotspot__marker::after,
.hotspot.active .hotspot__marker::after {
  color: var(--bg-primary);
}

@keyframes hotspot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0; }
}

/* ── Touch-friendly: min 44×44px ── */
@media (max-width: 768px) {
  .hotspot__marker {
    width: 44px;
    height: 44px;
  }

  .hotspot__marker::after {
    font-size: 18px;
  }

  .archive-slide__image {
    aspect-ratio: 4/5;
  }
}

/* ── Hotspot Tooltip ── */
.hotspot__tooltip {
  position: absolute;
  width: 280px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 20;
  pointer-events: auto;

  /* Glitch-blur entry animation */
  animation: tooltip-glitch-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hotspot__tooltip--left {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 16px;
}

.hotspot__tooltip--right {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 16px;
}

.hotspot__tooltip--bottom {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 16px;
}

.hotspot__tooltip--top {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 16px;
}

/* Tooltip inner layout */
.tooltip__product {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
}

.tooltip__image {
  width: 70px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
}

.tooltip__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tooltip__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.tooltip__category {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.tooltip__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-light);
}

.tooltip__price .currency {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-right: 2px;
}

/* Tooltip actions */
.tooltip__actions {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-md);
}

.tooltip__cart-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-base);
}

.tooltip__cart-btn:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.tooltip__wish-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.tooltip__wish-btn:hover {
  border-color: #f87171;
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.tooltip__wish-btn.active {
  border-color: #f87171;
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

/* ── Glitch / Blur animations ── */
@keyframes tooltip-glitch-in {
  0% {
    opacity: 0;
    filter: blur(8px) saturate(2);
    transform: translateY(-50%) scale(0.95);
    clip-path: inset(0 0 100% 0);
  }
  30% {
    opacity: 0.7;
    filter: blur(3px) saturate(1.5);
    clip-path: inset(0 0 30% 0);
  }
  50% {
    filter: blur(1px) saturate(1.2) hue-rotate(5deg);
    clip-path: inset(0 0 0 0);
  }
  70% {
    filter: blur(0px) saturate(1);
  }
  100% {
    opacity: 1;
    filter: blur(0px) saturate(1) hue-rotate(0deg);
    transform: translateY(-50%) scale(1);
    clip-path: inset(0 0 0 0);
  }
}

/* Override for bottom/top positioned tooltips */
.hotspot__tooltip--bottom {
  animation: tooltip-glitch-in-v 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hotspot__tooltip--top {
  animation: tooltip-glitch-in-v 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tooltip-glitch-in-v {
  0% {
    opacity: 0;
    filter: blur(8px) saturate(2);
    transform: translateX(-50%) scale(0.95);
    clip-path: inset(0 0 100% 0);
  }
  30% {
    opacity: 0.7;
    filter: blur(3px) saturate(1.5);
    clip-path: inset(0 0 30% 0);
  }
  50% {
    filter: blur(1px) saturate(1.2) hue-rotate(5deg);
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 1;
    filter: blur(0px) saturate(1) hue-rotate(0deg);
    transform: translateX(-50%) scale(1);
    clip-path: inset(0 0 0 0);
  }
}

/* ── Archive Empty State ── */
.archive-empty {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  max-width: 500px;
  margin: 0 auto;
}

.archive-empty__icon {
  font-size: 4rem;
  opacity: 0.2;
  margin-bottom: var(--space-lg);
}

.archive-empty__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.archive-empty__text {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* ── Mobile Tooltip Override ── */
@media (max-width: 768px) {
  .hotspot__tooltip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0;
    transform: none;
    animation: tooltip-slide-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    z-index: var(--z-modal);
  }

  .hotspot__tooltip--left,
  .hotspot__tooltip--right,
  .hotspot__tooltip--top,
  .hotspot__tooltip--bottom {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    margin: 0;
    animation: tooltip-slide-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .tooltip__product {
    padding: var(--space-lg);
  }

  .tooltip__image {
    width: 80px;
    height: 100px;
  }

  .tooltip__actions {
    padding: 0 var(--space-lg) var(--space-lg);
  }

  .tooltip__cart-btn {
    padding: 12px;
    font-size: 0.8rem;
  }

  .tooltip__wish-btn {
    width: 44px;
    height: 44px;
  }
}

@keyframes tooltip-slide-up {
  from {
    opacity: 0;
    transform: translateY(100%);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ── Mobile overlay when tooltip is open ── */
.archive-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-modal) - 1);
  animation: fadeIn var(--transition-base);
}

.archive-overlay.visible {
  display: block;
}

/* ── Hotspot Editor (Admin) ── */
.hotspot-editor {
  position: relative;
  display: inline-block;
  cursor: crosshair;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px dashed var(--glass-border);
  transition: border-color var(--transition-base);
  max-width: 100%;
}

.hotspot-editor:hover {
  border-color: var(--accent-dark);
}

.hotspot-editor img {
  display: block;
  max-width: 100%;
  height: auto;
}

.hotspot-editor .hotspot__marker {
  pointer-events: none;
}

.hotspot-editor__dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--text-primary);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--accent-glow-strong);
  transition: all var(--transition-fast);
}

.hotspot-editor__dot:hover {
  transform: translate(-50%, -50%) scale(1.3);
}

.hotspot-editor__dot-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-primary);
  background: rgba(5, 5, 5, 0.85);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid var(--glass-border);
}

/* Product selector modal for hotspot editor */
.product-selector {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn var(--transition-base);
}

.product-selector.hidden { display: none; }

.product-selector__modal {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: modal-in var(--transition-spring);
}

.product-selector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--glass-border);
}

.product-selector__search {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--glass-border);
}

.product-selector__list {
  overflow-y: auto;
  flex: 1;
  padding: var(--space-sm);
}

.product-selector__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.product-selector__item:hover {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.product-selector__item-img {
  width: 40px;
  height: 50px;
  border-radius: 4px;
  object-fit: contain;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.product-selector__item-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
}

.product-selector__item-price {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: auto;
}
