/* ============================================
   Anniversary Surprise Site
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', '맑은 고딕', sans-serif;
  background: #fff;
  color: #333;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

/* --- Product Page: Nav Bar --- */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.nav-store-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.nav-icon {
  padding: 4px;
  color: #555;
}

.nav-right {
  display: flex;
  gap: 8px;
}

/* --- Product Page: Product Image --- */
.product-image-section {
  background: #f5f5f7;
  padding: 24px 0 16px;
  text-align: center;
}

.product-image-wrapper {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-main-image {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.image-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ddd;
}

.dot.active {
  background: #333;
}

/* --- Product Page: Product Info --- */
.product-info {
  padding: 16px;
}

.product-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  color: #fff;
}

.badge-sale { background: #e53935; }
.badge-ship { background: #1976d2; }
.badge-install { background: #43a047; }

.product-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  line-height: 1.5;
  margin-bottom: 8px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 12px;
}

.stars {
  color: #ffa000;
}

.rating-count {
  color: #888;
}

.purchase-count {
  color: #aaa;
  margin-left: 4px;
}

.purchase-count::before {
  content: '| ';
}

.product-price {
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.price-original {
  font-size: 13px;
  color: #aaa;
  text-decoration: line-through;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.price-discount {
  font-size: 22px;
  font-weight: 800;
  color: #e53935;
}

.price-current {
  font-size: 24px;
  font-weight: 800;
  color: #111;
}

.price-unit {
  font-size: 15px;
  color: #111;
}

.price-benefit {
  font-size: 12px;
  color: #1976d2;
  margin-top: 4px;
}

/* --- Product Page: Delivery --- */
.delivery-info {
  padding: 16px;
  border-bottom: 8px solid #f5f5f5;
}

.delivery-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.delivery-label {
  color: #888;
  min-width: 40px;
}

.delivery-value {
  color: #333;
  text-align: right;
}

/* --- Product Page: Tab Bar --- */
.tab-bar {
  display: flex;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 41px;
  background: #fff;
  z-index: 99;
}

.tab {
  flex: 1;
  padding: 13px 0;
  font-size: 13px;
  font-weight: 500;
  color: #aaa;
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tab.active {
  color: #222;
  font-weight: 600;
  border-bottom-color: #222;
}

/* --- Product Page: Spec Table --- */
.spec-section {
  padding: 20px 16px;
  border-bottom: 8px solid #f5f5f5;
}

.spec-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #222;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid #f5f5f5;
}

.spec-table td {
  padding: 10px 0;
  font-size: 13px;
  vertical-align: top;
}

.spec-label {
  color: #888;
  width: 90px;
}

.spec-value {
  color: #333;
}

/* --- Product Page: Detail Section --- */
.detail-section {
  padding-bottom: 100px;
}

.detail-divider {
  padding: 20px 0;
  text-align: center;
  background: #f5f5f5;
  font-size: 13px;
  color: #888;
  font-weight: 500;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.detail-images {
  width: 100%;
}

.detail-img {
  width: 100%;
  display: block;
}

/* --- TV Showcase in detail images --- */
.tv-showcase-wrapper {
  padding: 32px 0;
  text-align: center;
  background: #f9f9f9;
}

.tv-showcase-label {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

.tv-showcase-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-showcase-frame {
  width: 280px;
  height: 175px;
  border: 4px solid #222;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0a14;
  position: relative;
}

.tv-showcase-screen {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.tv-screen-idle {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111 0%, #1a1a2e 50%, #111 100%);
}

.tv-screen-idle-text {
  font-size: 12px;
  color: #555;
  text-align: center;
  line-height: 1.6;
}

.tv-showcase-stand {
  width: 4px;
  height: 40px;
  background: linear-gradient(to bottom, #444, #666);
}

.tv-showcase-base {
  width: 60px;
  height: 6px;
  background: #555;
  border-radius: 3px;
}

/* CRT effect inside TV frame */
.tv-showcase-screen .crt-in-tv {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.tv-showcase-screen .crt-in-tv .crt-scanlines,
.tv-showcase-screen .crt-in-tv .crt-noise,
.tv-showcase-screen .crt-in-tv .crt-flicker {
  position: absolute;
  inset: 0;
}

.tv-showcase-screen .crt-turnon-line-mini {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 15px 4px rgba(255, 255, 255, 0.5);
  transform: translateY(-50%);
  animation: crt-expand 1.2s ease-out forwards;
  z-index: 10;
}

/* --- Floating Bottom Bar --- */
.floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 200;
}

.btn-wish {
  width: 48px;
  height: 48px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 20px;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-buy {
  flex: 1;
  height: 48px;
  background: #09aa5c;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: -0.3px;
}

/* --- CRT Effect --- */
.crt-effect {
  position: absolute;
  inset: 0;
  z-index: 310;
  pointer-events: none;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.25) 2px,
    rgba(0, 0, 0, 0.25) 4px
  );
  animation: scanlines-scroll 8s linear infinite;
  z-index: 1;
}

@keyframes scanlines-scroll {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

.crt-noise {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.crt-noise::before,
.crt-noise::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.03);
  animation: noise-flicker 0.15s steps(1) infinite;
}

.crt-noise::after {
  animation-delay: 0.07s;
  background: rgba(0, 0, 0, 0.04);
}

@keyframes noise-flicker {
  0%   { opacity: 1; }
  25%  { opacity: 0; }
  50%  { opacity: 1; }
  75%  { opacity: 0.6; }
  100% { opacity: 1; }
}

.crt-flicker {
  position: absolute;
  inset: 0;
  z-index: 3;
  animation: crt-flicker 0.08s steps(1) infinite;
}

@keyframes crt-flicker {
  0%   { background: rgba(0,0,0,0); }
  10%  { background: rgba(0,0,0,0.03); }
  20%  { background: rgba(0,0,0,0); }
  50%  { background: rgba(0,0,0,0.02); }
  80%  { background: rgba(0,0,0,0); }
  90%  { background: rgba(0,0,0,0.04); }
  100% { background: rgba(0,0,0,0); }
}

.crt-turnon-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-50%);
  animation: crt-expand 1.2s ease-out forwards;
  z-index: 10;
  box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.5);
}

@keyframes crt-expand {
  0%   { clip-path: inset(0 50% 0 50%); opacity: 1; }
  60%  { clip-path: inset(0 0% 0 0%);   opacity: 1; }
  80%  { clip-path: inset(0 0% 0 0%);   opacity: 0.8; height: 4px; }
  100% { clip-path: inset(0 0% 0 0%);   opacity: 0; height: 100%; }
}

.crt-effect.fade-out {
  animation: crt-fadeout 0.8s ease-out forwards;
}

@keyframes crt-fadeout {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* --- Timeline Overlay --- */
.timeline-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
}

/* --- Timeline Container (TV Expansion) --- */
.timeline-container {
  position: absolute;
  z-index: 320;
  overflow: hidden;
  background: #000;
}

.timeline-container.in-tv-frame {
  border: 4px solid #333;
  border-radius: 8px;
  transition: none;
}

.timeline-container.expanding {
  left: 0    !important;
  top: 0     !important;
  width: 100vw  !important;
  height: 100vh !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  transition: left 1.4s cubic-bezier(0.4,0,0.2,1),
              top 1.4s cubic-bezier(0.4,0,0.2,1),
              width 1.4s cubic-bezier(0.4,0,0.2,1),
              height 1.4s cubic-bezier(0.4,0,0.2,1),
              border-color 0.5s ease,
              border-radius 0.5s ease;
}

.timeline-container.fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw  !important;
  height: 100vh !important;
  border: none;
  border-radius: 0;
}

/* --- Slide Year --- */
.slide-year {
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
  color: #ffd700;
  font-size: clamp(14px, 4vw, 22px);
  letter-spacing: 4px;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  pointer-events: none;
}

/* --- Slide Image --- */
.slide-image-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slide-image {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.slide-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 40%,
    rgba(0,0,0,0.4) 70%,
    rgba(0,0,0,0.75) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* --- Ken Burns Keyframes --- */
@keyframes kb-zoom-in {
  0%   { transform: scale(1);    }
  100% { transform: scale(1.15); }
}

@keyframes kb-zoom-out {
  0%   { transform: scale(1.15); }
  100% { transform: scale(1);    }
}

@keyframes kb-pan-right {
  0%   { transform: scale(1.1) translateX(-4%); }
  100% { transform: scale(1.1) translateX(4%);  }
}

@keyframes kb-pan-left {
  0%   { transform: scale(1.1) translateX(4%);  }
  100% { transform: scale(1.1) translateX(-4%); }
}

.slide-image.kb-zoom-in {
  animation: kb-zoom-in var(--slide-duration, 7s) ease-out forwards;
}

.slide-image.kb-zoom-out {
  animation: kb-zoom-out var(--slide-duration, 7s) ease-in forwards;
}

.slide-image.kb-pan-right {
  animation: kb-pan-right var(--slide-duration, 7s) linear forwards;
}

.slide-image.kb-pan-left {
  animation: kb-pan-left var(--slide-duration, 7s) linear forwards;
}

/* --- Letter Text --- */
.slide-text {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}

.slide-text .letter-line {
  font-family: 'Nanum Pen Script', cursive;
  font-size: clamp(22px, 6.5vw, 32px);
  color: #fff;
  line-height: 1.8;
  opacity: 0;
  transform: translateY(14px);
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
  display: block;
}

.slide-text .letter-line.visible {
  animation: letter-fade-in 0.7s ease forwards;
}

@keyframes letter-fade-in {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Silhouette Background --- */
.silhouette-anim {
  animation: silhouette-appear 1.2s ease-out forwards;
}

@keyframes silhouette-appear {
  0%   { filter: blur(12px); opacity: 0; }
  100% { filter: blur(0);    opacity: 1; }
}

/* --- Progress Bar --- */
.progress-bar {
  position: absolute;
  bottom: 4%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 10;
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #ffd700;
  width: 0%;
  transition: width 0s linear;
}

/* --- Finale --- */
.finale {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: radial-gradient(ellipse at 50% 40%, #1a0a2e 0%, #0d0016 60%, #000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  gap: 12px;
}

.finale-year {
  font-size: clamp(13px, 3.5vw, 18px);
  color: #ffd700;
  letter-spacing: 5px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-bottom: 8px;
}

.finale-year.visible {
  opacity: 1;
  transform: translateY(0);
}

.finale-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.finale-line {
  font-family: 'Nanum Pen Script', cursive;
  font-size: clamp(22px, 6vw, 30px);
  color: #fff;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.finale-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.finale-gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 24px;
}

.finale-gift.visible {
  opacity: 1;
  transform: scale(1);
}

.gift-flower {
  font-size: 48px;
  animation: flower-sway 3s ease-in-out infinite;
  display: inline-block;
}

@keyframes flower-sway {
  0%   { transform: rotate(-3deg); }
  50%  { transform: rotate(3deg);  }
  100% { transform: rotate(-3deg); }
}

.gift-ticket {
  display: inline-block;
  border: 2px solid #ffd700;
  border-radius: 16px;
  padding: 20px 32px;
  text-align: center;
  background: rgba(255, 215, 0, 0.05);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.15), inset 0 0 24px rgba(255, 215, 0, 0.03);
}

.ticket-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: #ffd700;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ticket-title {
  font-family: 'Nanum Pen Script', cursive;
  font-size: clamp(26px, 7vw, 36px);
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
}

.ticket-closing {
  font-size: 12px;
  color: #ffd700;
  letter-spacing: 1px;
  opacity: 0.8;
}

/* --- Fireworks --- */
.finale-particles {
  position: fixed;
  inset: 0;
  z-index: 401;
  pointer-events: none;
  overflow: hidden;
}

/* Individual firework spark */
.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0;
  animation: spark-burst var(--spark-duration, 1.2s) ease-out forwards;
  animation-delay: var(--spark-delay, 0s);
}

@keyframes spark-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--spark-x, 50px), var(--spark-y, -80px)) scale(0.2);
  }
}

/* Trail / streak effect */
.spark-trail {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  opacity: 0;
  animation: trail-fade var(--trail-duration, 0.8s) ease-out forwards;
  animation-delay: var(--trail-delay, 0s);
}

@keyframes trail-fade {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(var(--trail-y, -40px)); }
}

/* Launch streak going up before burst */
.firework-launch {
  position: absolute;
  width: 2px;
  background: linear-gradient(to top, transparent, #ffd700);
  opacity: 0;
  animation: launch-up var(--launch-duration, 0.5s) ease-out forwards;
  animation-delay: var(--launch-delay, 0s);
}

@keyframes launch-up {
  0% { opacity: 0; height: 0; }
  50% { opacity: 1; height: 60px; }
  100% { opacity: 0; height: 0; }
}

/* --- Silhouette (2013) --- */

/* --- Utilities --- */
.hidden {
  display: none !important;
}
