/* ═══════════════════════════════════════════════════════════════════
   MICRO-INTERACTIONS — card hover lift, button glow, scroll snap,
   nav underline, modal scale-in. Pure CSS where possible.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Cigar cards: lift + gold-tinted shadow on hover ── */
.cigar-card {
  transition: transform 0.3s ease,
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.cigar-card:hover {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(201, 148, 58, 0.35),
    0 0 18px rgba(201, 148, 58, 0.18);  /* gold tint */
  border-color: rgba(201, 148, 58, 0.55);
  z-index: 2;
  will-change: transform;
}

/* ── Buttons: subtle gold glow on hover ── */
.landing-cta,
.quiz-trigger-btn,
.btn-primary,
.search-clear,
.view-btn,
.filter-select,
.flavor-srch-clr,
.cellar-view-btn,
.lg-primary-btn,
.pk-next {
  transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.quiz-trigger-btn:hover,
.btn-primary:hover,
.lg-primary-btn:hover,
.pk-next:hover {
  box-shadow: 0 0 12px rgba(201, 148, 58, 0.3);
}

.landing-cta:hover {
  box-shadow:
    0 0 16px rgba(201, 148, 58, 0.35),
    0 0 32px rgba(201, 148, 58, 0.18);
  transform: translateY(-1px);
}

/* ── Smooth scroll-snapping between major sections ── */
html {
  scroll-behavior: smooth;
}

body {
  scroll-snap-type: y proximity;
}

#landing,
.hero,
.shelves,
.main-content,
.site-footer {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* On touch / small screens snap can feel janky; soften to proximity already,
   and disable snap entirely below 768px to keep the mobile UX fluid. */
@media (max-width: 768px) {
  body { scroll-snap-type: none; }
  #landing, .hero, .shelves, .main-content, .site-footer {
    scroll-snap-align: none;
  }
}

/* ── Nav buttons: animated gold underline ── */
.nav-btn {
  position: relative;
}

.nav-btn::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, #c9943a, #f0d674, #c9943a);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-btn:hover::after {
  transform: scaleX(0.7);
  opacity: 0.7;
}

.nav-btn.active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Footer nav buttons get a quieter underline-on-hover */
.footer-nav-btn {
  position: relative;
}
.footer-nav-btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: #c9943a;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.footer-nav-btn:hover::after { transform: scaleX(1); }

/* ── Modal: smooth scale-in animation ── */
/* The app toggles .hidden on the modal wrapper; we animate the inner panel. */
.modal,
#modal,
#detailModal,
#pairingModal {
  /* wrapper stays transparent until panel finishes entering */
}

.modal-panel,
#detailModal .modal-panel,
.modal-content,
.cigar-detail-modal .modal-panel {
  animation: modal-scale-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center center;
}

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

/* When the modal closes, reverse the animation quickly. */
.modal.closing .modal-panel,
.modal.closing .modal-content {
  animation: modal-scale-out 0.2s ease both;
}

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

/* Backdrop fade */
.modal,
#modal,
#detailModal,
#pairingModal {
  animation: modal-backdrop-in 0.3s ease both;
}
@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Cursor particle trail (landing page) ── */
/* The dots themselves are created/animated in JS (see inline script in
   index.html). Here we only style their appearance so the JS stays small. */
.cursor-particle {
  position: fixed;
  top: 0; left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #f0d674 0%, rgba(201, 148, 58, 0.6) 60%, transparent 100%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.6s ease;
}

/* ── Reduced motion: disable snap, lift, and sheen animations ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { scroll-snap-type: none; }
  .cigar-card:hover { transform: none; }
  .modal-panel,
  .modal-content,
  #detailModal .modal-panel {
    animation: none;
  }
}
