* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fbfbfa;
  --ink: #17181a;
  --grey: #85878c;
  --line: #ebebe8;
  --card: #f2f2ef;
  --like: #ff2d55;
}

body {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; background: none; border: none; cursor: pointer; color: inherit; }

/* ── 헤더 ──────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251,251,250,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
}
.logo { font-size: 24px; font-weight: 800; letter-spacing: 0.04em; }
.logo-dot { color: var(--like); }
.gnb { display: flex; gap: 28px; }
.gnb-link {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--grey);
  padding: 6px 0;
  transition: color 0.25s;
}
.gnb-link:hover, .gnb-link--active { color: var(--ink); }

.header-icons { display: flex; gap: 14px; }
.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.icon-btn svg { width: 21px; height: 21px; }
.cart-count {
  position: absolute;
  top: 0; right: -2px;
  min-width: 16px; height: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* ── 히어로 ────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 380px;
  align-items: center;
  padding: 30px 32px 10px;
  gap: 30px;
}
.hero-title {
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero-sub { font-size: 15px; color: var(--grey); line-height: 1.7; max-width: 380px; }
.hero-media {
  height: 100%;
  min-height: 320px;
  border-radius: 24px;
  background-image: url('https://pub-d299de678d4f45f18e8b75dcfea7f543.r2.dev/elcorp/hero_blanc2.webp'), linear-gradient(140deg, #f4f2ec 0%, #e8e5dd 60%, #d9d5cb 100%);
  background-size: cover;
  background-position: center 30%;
}

/* ── 피드 ──────────────────────────────── */
.feed-wrap { max-width: 1400px; margin: 0 auto; padding: 50px 32px 90px; }
.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: 22px;
}
.feed-title { font-size: 22px; font-weight: 800; letter-spacing: 0.06em; }
.feed-hint { font-size: 11px; letter-spacing: 0.18em; color: var(--grey); }

.feed {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 18px;
}

.short-card { position: relative; }
.short-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(23,24,26,0.06);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.short-card:hover .short-thumb {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(23,24,26,0.14);
}
.short-thumb .yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 호버 시 유튜브 프리뷰: 세로 프레임을 꽉 채우도록 크게 깔고 클릭은 카드로 통과 */
.short-thumb .yt-hover {
  position: absolute;
  top: 50%; left: 50%;
  width: 340%;
  height: 110%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.short-views {
  position: absolute;
  left: 10px; bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23,24,26,0.55);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.short-views svg { width: 12px; height: 12px; fill: #fff; }
.short-play {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.25s;
}
.short-play svg { width: 13px; height: 13px; fill: var(--ink); margin-left: 2px; }
.short-card:hover .short-play { opacity: 0; }

.short-info { padding: 12px 4px 0; }
.short-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
.short-meta { font-size: 13px; color: var(--grey); }
.short-meta strong { color: var(--ink); font-weight: 700; }

/* ── 쇼츠 뷰어 ─────────────────────────── */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}
body.viewer-open .viewer { display: block; }
body.viewer-open { overflow: hidden; }

.viewer-dim {
  position: absolute;
  inset: 0;
  background: rgba(251,251,250,0.92);
  backdrop-filter: blur(10px);
}

.viewer-close {
  position: absolute;
  top: 22px; right: 26px;
  z-index: 3;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 16px rgba(23,24,26,0.12);
  display: grid;
  place-items: center;
  transition: transform 0.2s;
}
.viewer-close:hover { transform: scale(1.08); }
.viewer-close svg { width: 20px; height: 20px; }

.viewer-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.short-frame {
  position: relative;
  height: min(88vh, 820px);
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 70px rgba(23,24,26,0.25);
  pointer-events: auto;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.short-frame.anim-next { animation: slideNext 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.short-frame.anim-prev { animation: slidePrev 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideNext { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slidePrev { from { transform: translateY(-48px); opacity: 0; } to { transform: none; opacity: 1; } }

.short-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* iframe 위 투명 캐치 레이어 — 휠/클릭/키보드 포커스를 부모 문서가 유지 */
.short-catch {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}
.short-overlay, .short-rail { z-index: 2; }

.short-overlay {
  position: absolute;
  left: 0; right: 58px; bottom: 0;
  padding: 18px 16px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.62), rgba(0,0,0,0) 90%);
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.short-frame:hover .short-overlay { opacity: 1; transform: none; }
.short-frame:hover .short-overlay .short-buy { pointer-events: auto; }
.short-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.short-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.short-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.short-price { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.short-buy {
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 11px 22px;
  border-radius: 999px;
  transition: transform 0.2s;
}
.short-buy:hover { transform: scale(1.05); }

.short-rail {
  position: absolute;
  right: 8px; bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.short-frame:hover .short-rail { opacity: 1; pointer-events: auto; }
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
}
.rail-btn svg {
  width: 40px; height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(23,24,26,0.45);
  backdrop-filter: blur(4px);
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  transition: transform 0.2s, background 0.2s;
}
.rail-btn:hover svg { transform: scale(1.1); }
#likeBtn svg { fill: none; stroke: #fff; }
#likeBtn.liked svg { fill: var(--like); stroke: var(--like); background: rgba(255,255,255,0.9); }

.viewer-nav {
  position: absolute;
  right: max(24px, calc(50% - min(88vh, 820px) * 9 / 32 - 90px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 3;
}
.nav-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 16px rgba(23,24,26,0.12);
  display: grid;
  place-items: center;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-btn:hover { transform: scale(1.1); }
.nav-btn:disabled { opacity: 0.3; cursor: default; transform: none; }
.nav-btn svg { width: 22px; height: 22px; }

.viewer-counter {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--grey);
  z-index: 3;
}

/* ── 드로어 ────────────────────────────── */
.drawer-dim {
  position: fixed; inset: 0;
  background: rgba(23,24,26,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 400;
}
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(400px, 92vw);
  height: 100%;
  background: var(--bg);
  z-index: 401;
  transform: translateX(105%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(23,24,26,0.15);
}
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-dim { opacity: 1; pointer-events: auto; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 15px; letter-spacing: 0.2em; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 22px; }
.drawer-empty { text-align: center; color: var(--grey); font-size: 13px; padding: 60px 0; }

.cart-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item video, .cart-item img { width: 58px; height: 92px; object-fit: cover; border-radius: 10px; background: var(--card); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.cart-item-price { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-btn { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; display: grid; place-items: center; }
.qty-num { font-size: 13px; min-width: 16px; text-align: center; }
.cart-item-remove { font-size: 11px; color: var(--grey); margin-left: auto; text-decoration: underline; }

.drawer-foot { border-top: 1px solid var(--line); padding: 18px 22px 24px; }
.drawer-total { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: 0.1em; margin-bottom: 14px; }
.drawer-total strong { font-size: 17px; }
.drawer-checkout {
  width: 100%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 16px 0;
  border-radius: 14px;
  transition: opacity 0.2s;
}
.drawer-checkout:hover { opacity: 0.85; }

/* ── 토스트 ────────────────────────────── */
.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 13px 26px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s ease;
  z-index: 500;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ── 푸터 ──────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 44px 24px 50px;
}
.footer-logo { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.footer-links { display: flex; justify-content: center; gap: 22px; font-size: 12px; color: var(--grey); margin-bottom: 14px; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-size: 11.5px; color: var(--grey); }

/* ── 반응형 ────────────────────────────── */
@media (max-width: 1100px) {
  .feed { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .header-inner { padding: 0 18px; }
  .gnb { display: none; }
  .hero { grid-template-columns: 1fr; padding: 20px 18px 0; }
  .hero-media { min-height: 240px; order: -1; }
  .feed-wrap { padding: 36px 18px 70px; }
  .feed { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .viewer-nav { right: 12px; }
  .short-frame { height: min(80vh, 700px); }
}
