/* ================================================
   GLOWPORT CLINIC — Common Stylesheet
   ================================================ */

/* ---------- Variables ---------- */
:root {
  --dark:       #1a1a1a;
  --text:       #333;
  --mid:        #666;
  --light:      #999;
  --border:     #e5e5e5;
  --bg-warm:    #f8f5f0;
  --accent:     #6490B9;
  --sans:       'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --serif:      'Georgia', 'Times New Roman', serif;
  --header-h:   64px;
  --max-w:      1100px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: #fff;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
img { display: block; max-width: 100%; height: auto; }

/* ================================================
   HEADER
   ================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

/* Logo */
.logo { display: flex; align-items: center; }
.logo-img { height: 32px; width: auto; display: block; transition: opacity .2s; }
.logo:hover .logo-img { opacity: 0.75; }

/* Main nav */
.site-nav { display: flex; gap: 36px; }
.site-nav a {
  font-size: 16px; color: #444; letter-spacing: 0.5px;
  position: relative;
  transition: color .2s;
}
.site-nav a::after {
  content: ''; display: block;
  height: 1px; background: #222;
  position: absolute; bottom: -2px; left: 0; right: 0;
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.site-nav a:hover, .site-nav a.active { color: #111; }
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }

/* Header right */
.header-right { display: flex; align-items: center; gap: 14px; }
.btn-consult {
  padding: 7px 18px;
  border: 1.5px solid #222; border-radius: 30px;
  font-size: 12px; letter-spacing: 0.5px; color: #222;
  transition: all .2s;
}
.btn-consult:hover { background: #222; color: #fff; }

/* ===== TRANSPARENT HEADER (for pages with hero image) ===== */
.site-header.header-transparent {
  background: transparent !important;
  border-bottom-color: transparent !important;
  transition: background .3s, border-color .3s;
  /* 슬라이드/페이지별 색상 — JS로 덮어씀 */
  --hc: rgba(255,255,255,0.9);
  --hc-hover: #fff;
  --hc-btn-border: rgba(255,255,255,0.7);
  --hc-logo: brightness(0) invert(1);
}
.site-header.header-transparent .logo-img { filter: var(--hc-logo); }
.site-header.header-transparent .site-nav a { color: var(--hc); }
.site-header.header-transparent .site-nav a:hover { color: var(--hc-hover); }
.site-header.header-transparent .site-nav a.active { color: var(--hc-hover); }
.site-header.header-transparent .btn-consult { border-color: var(--hc-btn-border); color: var(--hc); background: transparent; }
.site-header.header-transparent .btn-consult:hover { background: rgba(128,128,128,0.15); }
.site-header.header-transparent .hamburger span { background: var(--hc); }

body[data-header-theme="dark"] .page-hero-content {
  color: #222;
}

body[data-header-theme="dark"] .page-hero .hero-sub {
  color: rgba(34,34,34,0.7);
}

body[data-header-theme="dark"] .page-hero .hero-title {
  color: #222;
  text-shadow: none;
}

body[data-header-theme="dark"] .page-hero .hero-tagline {
  color: rgba(34,34,34,0.72);
}

/* ===== GLOBAL SCROLL REVEAL ===== */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

[data-reveal="left"] {
  transform: translate3d(-28px, 36px, 0);
}

[data-reveal="right"] {
  transform: translate3d(28px, 36px, 0);
}

[data-reveal="soft"] {
  transform: translate3d(0, 24px, 0);
}

[data-reveal="zoom"] {
  transform: translate3d(0, 36px, 0) scale(0.96);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fnav-overlay,
  .fnav-item,
  .fnav-top,
  .fnav-bottom,
  .fnav-sub {
    transition: none !important;
    transform: none !important;
  }
}

/* ===== CART BADGE ===== */
.cart-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #6490B9; color: #fff;
  border-radius: 50%; width: 16px; height: 16px;
  font-size: 9px; font-weight: 700;
  margin-left: 6px; vertical-align: middle;
  line-height: 1;
}

.cart-count-badge.is-hidden {
  display: none;
}

/* ===== CART TOAST ===== */
.cart-toast {
  position: fixed; bottom: 36px; left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a; color: #fff;
  padding: 14px 24px; border-radius: 8px;
  font-size: 13px; z-index: 9999;
  display: flex; align-items: center; gap: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: cartToastIn .3s ease;
}
@keyframes cartToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.cart-toast-link { color: #6490B9; font-weight: 600; text-decoration: underline; }

/* ================================================
   HERO
   ================================================ */
.hero {
  margin-top: var(--header-h);
  height: 400px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 10px;
}
.hero-sub {
  font-size: 11px; letter-spacing: 4px;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--serif);
  font-size: 58px; font-weight: 300; letter-spacing: 10px;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.12);
}
.hero-tagline {
  font-size: 13px; font-style: italic; letter-spacing: 2px;
  color: rgba(255,255,255,0.82);
}

/* Hero variants */
.hero-main {
  background: linear-gradient(185deg,
    #5b9dc8 0%, #87adc4 20%, #b8a8c8 40%,
    #cbb09a 65%, #dfc9a8 85%, #ecdab0 100%);
}
.hero-warm {
  background: linear-gradient(145deg,
    #aad4d8 0%, #8db8c8 18%, #c8b8d8 38%,
    #d4c0a4 60%, #e4caa0 80%, #eedab8 100%);
}
.hero-blue {
  background: linear-gradient(160deg,
    #a8cce0 0%, #90bdd8 20%, #b4ccd0 40%,
    #ccd0b8 65%, #ddd4a8 85%, #e8d4a0 100%);
}

/* ================================================
   SUB-NAV (TABS)
   ================================================ */
.sub-nav {
  display: flex; justify-content: center;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.sub-nav a {
  display: block; padding: 14px 36px;
  font-size: 13px; color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.sub-nav a:hover { color: #555; }
.sub-nav a.active { color: #222; border-bottom-color: #222; font-weight: 600; }

/* ================================================
   LAYOUT
   ================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}
.section        { padding: 90px 0; }
.section-sm     { padding: 64px 0; }
.section-xs     { padding: 48px 0; }

.row {
  display: flex; align-items: flex-start; gap: 60px;
}
.col { flex: 1; }

/* ================================================
   TYPOGRAPHY
   ================================================ */
.label {
  font-size: 10px; letter-spacing: 3px;
  color: #bbb; text-transform: uppercase;
  margin-bottom: 12px; display: block;
}
.heading-lg {
  font-size: 30px; font-weight: 400; line-height: 1.35;
  color: #1a1a1a; margin-bottom: 20px;
}
.heading-md {
  font-size: 22px; font-weight: 400; line-height: 1.4;
  color: #1a1a1a; margin-bottom: 14px;
}
.heading-sm {
  font-size: 17px; font-weight: 600; line-height: 1.4;
  color: #1a1a1a; margin-bottom: 10px;
}
.body-text {
  font-size: 16px; color: #666; line-height: 1.9;
}
.more-btn {
  font-size: 11px; letter-spacing: 1px; color: #888;
  transition: color .2s;
}
.more-btn:hover { color: #333; }
.more-btn::after { content: ' ›'; }

/* ================================================
   IMAGE PLACEHOLDERS
   ================================================ */
.img-box {
  width: 100%; background: #ece8e2;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 11px; letter-spacing: 1px;
  overflow: hidden; position: relative;
}
.img-box.ratio-4-3  { aspect-ratio: 4 / 3; }
.img-box.ratio-3-4  { aspect-ratio: 3 / 4; }
.img-box.ratio-16-9 { aspect-ratio: 16 / 9; }
.img-box.ratio-1-1  { aspect-ratio: 1 / 1; }
.img-box.ratio-5-3  { aspect-ratio: 5 / 3; }
.img-box.ratio-2-3  { aspect-ratio: 2 / 3; }

/* Gradient skins */
.skin-blue   { background: linear-gradient(135deg, #a8c8dc, #c8d8e8); }
.skin-gold   { background: linear-gradient(135deg, #c8a870, #dfc898); }
.skin-pink   { background: linear-gradient(135deg, #dcc0c0, #e8d0d0); }
.skin-sage   { background: linear-gradient(135deg, #b0c8b4, #c8d8c0); }
.skin-cream  { background: linear-gradient(135deg, #e0d8c8, #ece8dc); }
.skin-dark   { background: linear-gradient(135deg, #2c2820, #3c3028); }
.skin-purple { background: linear-gradient(135deg, #a898c8, #c0b4d8); }
.skin-teal   { background: linear-gradient(135deg, #88b8c4, #a8ccd4); }

/* ================================================
   CARDS
   ================================================ */
.card { overflow: hidden; }
.card-body { padding: 16px 0; }
.card-cat  { font-size: 10px; letter-spacing: 2px; color: #bbb; text-transform: uppercase; margin-bottom: 6px; }
.card-name { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.card-desc { font-size: 12px; color: #888; line-height: 1.8; }

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 40px; border-radius: 40px;
  font-size: 13px; letter-spacing: 1px;
  transition: background .2s, color .2s, border-color .2s;
  cursor: pointer;
}
.btn-dark  { background: #222; color: #fff; }
.btn-dark:hover  { background: #000; }
.btn-light { background: transparent; border: 1.5px solid #222; color: #222; }
.btn-light:hover { background: #222; color: #fff; }
.btn-full  { width: 100%; }

/* ================================================
   DIVIDER
   ================================================ */
.divider { height: 1px; background: var(--border); }
.divider-dark { height: 1px; background: #2a2a2a; }

/* ================================================
   FOOTER
   ================================================ */
.site-footer {
  background: #1a1a1a; color: #aaa;
  padding: 48px 44px;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap;
}
.footer-logo { margin-bottom: 14px; }
.footer-logo .logo-img { height: 28px; width: auto; display: block; opacity: 0.8; }
.footer-info { font-size: 11px; line-height: 2.2; color: #666; }
.footer-copy { font-size: 10px; color: #484848; margin-top: 10px; }

.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { font-size: 11px; color: #777; transition: color .2s; }
.footer-links a:hover { color: #ccc; }
.social-row { display: flex; gap: 10px; }
.social-btn {
  width: 30px; height: 30px;
  border: 1px solid #444; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #888;
  transition: border-color .2s, color .2s;
  cursor: pointer;
}
.social-btn:hover { border-color: #999; color: #ccc; }

/* ================================================
   HAMBURGER — 3선 → X 변환
   ================================================ */
.hamburger { width: 22px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 0; }
.hamburger span { display: block; height: 1.5px; background: #444; border-radius: 2px; transition: transform .35s ease, opacity .25s ease, background .2s; }
.hamburger:hover span { background: #111; }

/* 투명 헤더일 때 */
.header-transparent .hamburger span { background: var(--hc); }

/* X 변환 */
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: #fff; }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: #fff; }

/* ================================================
   FULLSCREEN NAV
   ================================================ */

/* 헤더를 오버레이 위로 올리기 */
body.nav-open .site-header {
  z-index: 1200;
  background: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}
body.nav-open .site-header .logo,
body.nav-open .site-header .site-nav,
body.nav-open .site-header .btn-consult {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
body.nav-open .site-header .hamburger span { background: #fff; }

/* 오버레이 */
.fnav-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1);
}
.fnav-overlay.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}
.fnav-overlay.closing {
  opacity: 0;
  transform: translateY(-10px);
  transition-duration: .32s;
  pointer-events: none;
}

.fnav-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100%;
  padding: 0 max(48px, calc((100vw - 1100px) / 2));
}

/* 메뉴 항목 스태거 */
.fnav-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1);
}
.fnav-overlay.open .fnav-item:nth-child(1) { opacity:1; transform:none; transition-delay:.14s; }
.fnav-overlay.open .fnav-item:nth-child(2) { opacity:1; transform:none; transition-delay:.22s; }
.fnav-overlay.open .fnav-item:nth-child(3) { opacity:1; transform:none; transition-delay:.30s; }
.fnav-overlay.open .fnav-item:nth-child(4) { opacity:1; transform:none; transition-delay:.38s; }
.fnav-overlay.open .fnav-item:nth-child(5) { opacity:1; transform:none; transition-delay:.46s; }
.fnav-overlay.closing .fnav-item { opacity:0; transform:translateY(18px); transition:opacity .18s, transform .18s; transition-delay:0s !important; }

/* top/bottom */
.fnav-top, .fnav-bottom { opacity:0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
.fnav-overlay.open .fnav-top    { opacity:1; transform:none; transition-delay:.08s; }
.fnav-overlay.open .fnav-bottom { opacity:1; transform:none; transition-delay:.42s; }
.fnav-overlay.closing .fnav-top,
.fnav-overlay.closing .fnav-bottom { opacity:0; transform: translateY(8px); transition-delay:0s; }

.fnav-top {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.fnav-logo {
  font-size: 13px; letter-spacing: 4px; font-weight: 700; color: #fff;
}
.fnav-reserve {
  font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.25);
  padding: 8px 18px; border-radius: 30px;
  transition: border-color .2s, color .2s;
}
.fnav-reserve:hover { color: #fff; border-color: rgba(255,255,255,.7); }

.fnav-menu {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 0;
}

.fnav-item {
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.fnav-main-btn {
  width: 100%; display: flex; align-items: center; gap: 20px;
  padding: 22px 0;
  background: none; border: none; text-align: left; cursor: pointer;
  color: #fff;
  transition: opacity .2s;
}
.fnav-main-btn:hover { opacity: .7; }

.fnav-en {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 28px; font-weight: 300; letter-spacing: 2px;
  color: #fff;
  min-width: 200px;
}
.fnav-ko {
  font-size: 12px; letter-spacing: 1.5px; color: rgba(255,255,255,.45);
}
.fnav-arrow {
  margin-left: auto; font-size: 20px; color: rgba(255,255,255,.35);
  transition: transform .3s, color .2s;
  line-height: 1;
}
.fnav-item.open .fnav-arrow { transform: rotate(45deg); color: #6490B9; }

.fnav-sub {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .4s ease, opacity .28s ease, transform .28s ease;
}
.fnav-item.open .fnav-sub { max-height: 160px; opacity: 1; transform: translateY(0); }

.fnav-sub-inner {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  padding: 12px 0 20px 0;
}

.fnav-sub-link {
  font-size: 12px; letter-spacing: 1px; color: rgba(255,255,255,.5);
  transition: color .2s;
  position: relative; padding-left: 14px;
}
.fnav-sub-link::before { content: '—'; position: absolute; left: 0; font-size: 9px; color: #6490B9; }
.fnav-sub-link:hover { color: #fff; }

.fnav-bottom {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; gap: 32px;
  font-size: 11px; color: rgba(255,255,255,.25);
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 900px) {
  .site-header { padding: 0 20px; }
  .site-nav { gap: 20px; }
  .hero-title { font-size: 44px; }
  .container { padding: 0 24px; }
  .row { flex-direction: column; gap: 40px; }
  .sub-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sub-nav::-webkit-scrollbar { display: none; }
  .sub-nav a { flex: 0 0 auto; white-space: nowrap; padding: 14px 20px; }
}
@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .site-nav { display: none; }
  .logo-img { height: 28px; }
  .header-right { gap: 10px; }
  .btn-consult { padding: 6px 12px; font-size: 11px; }
  .cart-count-badge { width: 14px; height: 14px; font-size: 8px; }
  .hero-title { font-size: 34px; letter-spacing: 6px; }
  .hero { height: 300px; }
  .section { padding: 60px 0; }
  .container { padding: 0 20px; }
  .sub-nav { padding: 0 16px; }
  .sub-nav a { padding: 13px 16px; font-size: 12px; }
  .site-footer { padding: 36px 20px; }
  .footer-inner { flex-direction: column; }
  .footer-right { align-items: flex-start; }
  .footer-links ul { gap: 12px; }
  .fnav-inner { padding: 0 20px; }
  .fnav-main-btn { gap: 12px; padding: 18px 0; }
  .fnav-en { min-width: 140px; font-size: 22px; }
  .fnav-ko { font-size: 11px; letter-spacing: 1px; }
  .fnav-sub-inner { gap: 10px 16px; padding: 10px 0 16px; }
  .fnav-bottom {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 0;
  }
}
