/* ============================================================
   VI FEERIE — Popup chào mừng / khuyến mãi
   Hiện khi user vào trang lần đầu. "Không hiện trong 7 ngày"
   lưu localStorage.
   ============================================================ */

.welcome-modal[hidden] {
  display: none !important;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: welcome-fade 0.25s ease-out;
}

.welcome-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 12, 18, 0.6);
  backdrop-filter: blur(2px);
}

.welcome-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(20, 12, 18, 0.35);
  animation: welcome-pop 0.3s var(--ease);
}

.welcome-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(20, 12, 18, 0.18);
  transition: background 0.2s var(--ease);
}

.welcome-modal__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.welcome-modal__close:hover {
  background: #ffffff;
  color: var(--brand-deep);
}

/* ---------------- Slider ---------------- */
.welcome-modal__slider {
  position: relative;
  background: var(--bg-soft);
}

.welcome-modal__track {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.welcome-modal__track::-webkit-scrollbar {
  display: none;
}

.welcome-modal__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.welcome-modal__slide a {
  display: block;
}

.welcome-modal__slide img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

/* ---------------- Nút prev/next ---------------- */
.welcome-modal__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 12, 18, 0.2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.welcome-modal__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-modal__arrow:hover {
  background: #ffffff;
  color: var(--brand-deep);
}

.welcome-modal__arrow--prev { left: 10px; }
.welcome-modal__arrow--next { right: 10px; }

/* ---------------- Dots ---------------- */
.welcome-modal__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}

.welcome-modal__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.25s var(--ease), width 0.25s var(--ease);
}

.welcome-modal__dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: #ffffff;
}

/* ---------------- Foot ---------------- */
.welcome-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  border-top: 1px solid var(--brand-deep);
}

.welcome-modal__notice {
  font-size: 13px;
  color: var(--muted);
}

.welcome-modal__btn-close {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
  font-family: inherit;
}

.welcome-modal__btn-close:hover {
  color: var(--brand-deep);
}

/* ---------------- Utility ---------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- Animations ---------------- */
@keyframes welcome-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes welcome-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-modal,
  .welcome-modal__dialog { animation: none; }
}

/* ---------------- Responsive ---------------- */
@media screen and (max-width: 480px) {
  .welcome-modal__dialog { max-width: 100%; border-radius: 12px; }
  .welcome-modal__arrow { width: 34px; height: 34px; margin-top: -17px; }
  .welcome-modal__arrow svg { width: 16px; height: 16px; }
  .welcome-modal__foot { padding: 12px 16px; }
  .welcome-modal__notice { font-size: 12px; }
}
