/* ==========================================================================
   YOSHI TELECOM — Digital Curator Design System
   Designer B (Minji Seo) · Editorial Commerce
   ========================================================================== */

/* ── 1. Design Tokens (CSS Custom Properties) ─────────────────────────────── */
:root {
  /* Surface Hierarchy (Tonal Layering) */
  --surface: #F9F9F9;
  --surface-master: #F8F9FB; /* Dribbble Bento Background */
  --surface-low: #F3F3F3;
  --surface-card: #FFFFFF;
  --surface-dark: #1A1C1C;
  --surface-dark-card: rgba(255,255,255,0.08);

  /* Brand Colors */
  --primary: #2B3FF0;
  --primary-dark: #001DD4;
  --primary-gradient: linear-gradient(135deg, #001DD4, #2B3FF0);
  --sale: #FF2D55;
  --success: #00C473;
  --accent: #FF8C42;

  /* Text Colors */
  --text-primary: #1A1C1C;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-on-dark: #F9F9F9;

  /* Shadows & Glassmorphism */
  --shadow-ambient: 0 12px 32px rgba(26, 28, 28, 0.05);
  --shadow-ambient-sm: 0 8px 24px rgba(26, 28, 28, 0.05);
  --shadow-hover: 0 16px 40px rgba(26, 28, 28, 0.08);
  --shadow-float: 0 20px 48px rgba(26, 28, 28, 0.12);
  --shadow-glass: 0 8px 32px rgba(26, 28, 28, 0.08);
  --shadow-neon: 0 0 20px rgba(43, 63, 240, 0.3);
  --shadow-bento: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: blur(16px);
  --glass-dark-bg: rgba(26, 28, 28, 0.85);
  --glass-dark-border: rgba(255, 255, 255, 0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --header-h: 64px;
  --container-max: 1200px;
  --container-narrow: 1024px;

  /* Transition */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  background-color: var(--surface);
  color: var(--text-primary);
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.02em;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

app-header {
  display: contents;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Pretendard', 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* ── 3. Accessibility & Touch ─────────────────────────────────────────────── */
a, button, input[type="button"], input[type="submit"] {
  touch-action: manipulation;
}

button, .btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  min-height: 48px;
  font-family: inherit;
}

*:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(43, 63, 240, 0.2) !important;
}

/* ── 4. Layout Utilities ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

/* ── 5. Card System (Tonal Layering) ──────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-dark {
  background: var(--surface-dark);
  border-radius: var(--radius-xl);
  color: var(--text-on-dark);
}

/* ── 5.6. Bento Grid Utilities ──────────────────────────────────────── */
.bento-panel {
  background: var(--surface-card);
  border-radius: 24px;
  box-shadow: var(--shadow-bento);
  border: 1px solid rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.bento-panel-transparent {
  border-radius: 24px;
  overflow: hidden;
}

/* ── 5.5. Glassmorphism Utilities ────────────────────────────────────── */
.glass-surface {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.glass-surface-dark {
  background: var(--glass-dark-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-dark-border);
  box-shadow: var(--shadow-glass);
}

/* ── 6. Scrollbar & Swipe ─────────────────────────────────────────────────── */
.hide-scrollbar::-webkit-scrollbar,
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar, .scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.swipe-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding-bottom: 8px;
  padding-left: 16px;
  padding-right: 16px;
  scroll-padding-left: 16px;
}
.swipe-container::-webkit-scrollbar { display: none; }
.swipe-container { -ms-overflow-style: none; scrollbar-width: none; }

.swipe-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Scroll fade indicator */
.scroll-fade-right {
  position: relative;
  display: flex;
}
.scroll-fade-right::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--surface));
  pointer-events: none;
  z-index: 10;
}

/* ── 7. Animations ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

@keyframes pulse-blue {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes countdown-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(43, 63, 240, 0.3); }
  50% { text-shadow: 0 0 40px rgba(43, 63, 240, 0.6); }
}

.animate-fade-in { animation: fadeIn 0.5s var(--ease-out) forwards; }
.animate-marquee { display: inline-flex; animation: marquee 25s linear infinite; }
.animate-marquee:hover { animation-play-state: paused; }
.animate-pulse-blue { animation: pulse-blue 2s ease-in-out infinite; }

/* Hover lift (generic) */
.hover-lift {
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Phase 9 Q16 — 터치/비-호버 디바이스에서 hover-lift 잔존 방지 (iOS Safari·Android Chrome 대응)
   :active 피드백은 각 컴포넌트가 독립적으로 정의(.qm-item:active 등) → 디자인 의도 보존 */
@media (hover: none), (pointer: coarse) {
  .hover-lift:hover { transform: none; box-shadow: none; }
}

/* Image zoom on hover */
.img-zoom { transition: transform 0.4s var(--ease-out); }
.group:hover .img-zoom { transform: scale(1.05); }

@media (prefers-reduced-motion: reduce) {
  .animate-marquee { animation: none; }
  .hover-lift:hover { transform: none; box-shadow: none; }
  .animate-fade-in { animation: none; opacity: 1; transform: none; }

  /* Phase 8 — 전역 motion 억제 fallback (WCAG 2.3.3 Animation from Interactions)
     페이지별 animate-pulse / fade-in / keyframes / transition 일체를 거의 즉시 종료 */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── 8. Quick Menu Icons (colored circles) ────────────────────────────────── */
.qm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  width: 100%;
  cursor: pointer;
}
.qm-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}
.qm-item:hover .qm-circle {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.qm-item:active .qm-circle { transform: scale(0.95); }
.qm-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.qm-item:hover .qm-label { color: var(--primary); }

@media (min-width: 768px) {
  .qm-circle { width: 56px; height: 56px; font-size: 24px; }
  .qm-label { font-size: 13px; }
  .qm-item { gap: 10px; }
}

/* ── 9. Chip / Pill Styles ────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface-card);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-ambient-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: pulse-blue 2s ease-in-out infinite;
}

.badge-free {
  display: inline-flex;
  align-items: center;
  background: var(--success);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-sale {
  display: inline-flex;
  align-items: center;
  background: var(--sale);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ── 10. Product Card (Designer B Style) ──────────────────────────────────── */
.product-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.product-card .product-img {
  background: var(--surface-low);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}
.product-card .product-img img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  transition: transform 0.4s var(--ease-out);
}
.product-card:hover .product-img img {
  transform: scale(1.05);
}
.product-card .product-info {
  padding: 14px 16px 18px;
}

/* ── 11. Section Patterns ─────────────────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.section-header h2 {
  font-size: 22px;
  color: var(--text-primary);
}
.section-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

@media (min-width: 768px) {
  .section-header h2 { font-size: 28px; }
  .section-header .subtitle { font-size: 14px; }
}

/* ── 12. Mobile Bottom Nav (5-tab) — Noir Premium Dark ────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
@media (min-width: 1024px) {
  .bottom-nav { display: none !important; }
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 56px;
  max-width: var(--container-max);
  margin: 0 auto;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  text-decoration: none;
  color: #6b6b80;
  font-size: 10px;
  font-weight: 600;
  gap: 2px;
  transition: color 0.25s ease;
}
.bottom-nav-item.active {
  color: #4d9de0;
}
.bottom-nav-item:hover {
  color: #c0c7d2;
}
.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: stroke-width 0.2s ease;
}
.bottom-nav-item.active svg {
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(77, 157, 224, 0.5));
}

@media (max-width: 767px) {
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
}

/* ── 13. Carrier Modal ────────────────────────────────────────────────────── */
.carrier-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  background: rgba(26, 28, 28, 0);
  backdrop-filter: blur(0px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}
.carrier-modal-overlay.active {
  background: rgba(26, 28, 28, 0.4);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.carrier-modal-content {
  background: var(--surface-card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: 440px;
  padding: 28px 24px 32px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease;
}
.carrier-modal-overlay.active .carrier-modal-content {
  transform: translateY(0);
  opacity: 1;
}
@media (min-width: 768px) {
  .carrier-modal-overlay { align-items: center; }
  .carrier-modal-content {
    border-radius: var(--radius-2xl);
    max-width: 400px;
    transform: translateY(20px) scale(0.96);
  }
  .carrier-modal-overlay.active .carrier-modal-content {
    transform: translateY(0) scale(1);
  }
}
.carrier-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-low);
}
.carrier-option:hover {
  background: var(--surface-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-ambient-sm);
}
.carrier-option:active { transform: scale(0.97); }
.carrier-option.selected {
  background: #EEF0FF;
  box-shadow: inset 0 0 0 2px var(--primary);
}
.carrier-logo {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: 'Inter', sans-serif;
}
.carrier-logo-lg {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  font-family: 'Inter', sans-serif;
}
.carrier-step { display: none; }
.carrier-step.active { display: block; animation: fadeSlideUp 0.3s ease; }

.join-type-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-low);
  cursor: pointer;
  transition: all 0.2s;
}
.join-type-btn:hover {
  background: var(--surface-card);
  transform: translateY(-1px);
  box-shadow: var(--shadow-ambient-sm);
}
.join-type-btn:active { transform: scale(0.98); }

/* Carrier switch animation */
.carrier-switch-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.switch-from { text-align: center; opacity: 0.5; }
.switch-to { text-align: center; }
.switch-arrow { animation: arrowBounce 1s ease infinite; }
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
.switch-target {
  animation: popIn 0.5s var(--ease-spring) forwards;
  box-shadow: 0 4px 20px rgba(43, 63, 240, 0.3);
}
@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── 14. My Carrier Bar ───────────────────────────────────────────────────── */
.my-carrier-bar {
  position: sticky;
  top: var(--header-h);
  left: 0; width: 100%;
  z-index: 48;
  background: rgba(249, 249, 249, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 0;
  transition: opacity 0.35s ease;
}
.my-carrier-bar.hidden { display: none; opacity: 0; }

/* ── 15. Countdown Timer ──────────────────────────────────────────────────── */
.countdown-digits {
  font-family: 'Pretendard', sans-serif;
  font-weight: 800;
  font-size: 36px;
  color: var(--primary);
  animation: countdown-glow 2s ease-in-out infinite;
}
@media (min-width: 768px) {
  .countdown-digits { font-size: 48px; }
}

/* ── 16. Reveal Animation (Scroll) ────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── 17. Ripple Effect ────────────────────────────────────────────────────── */
.btn-ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  animation: rippleAnim 0.55s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* ── 18. Header Component — Solid White ────────────────────────────────────── */
.yoshi-header {
  position: sticky; top: 0; left: 0; width: 100%; z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.yoshi-header-inner {
  max-width: var(--container-max); margin: 0 auto;
  padding: 0 16px; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
/* 브랜드 로고 — 초기: 다크 */
.yoshi-brand {
  font-size: 20px; font-weight: 800; letter-spacing: -0.04em;
  color: var(--text-primary); text-decoration: none;
  transition: color 0.3s ease, opacity 0.2s;
}
.yoshi-brand:hover { opacity: 0.75; }
.yoshi-header-left { display: flex; align-items: center; height: 100%; gap: 40px; }
.yoshi-header-right { display: flex; align-items: center; gap: 12px; }
/* 헤더 아이콘 — 초기: 다크, 스크롤: 라이트 */
.header-icon {
  position: relative; color: var(--text-primary);
  transition: color 0.2s; display: flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  text-decoration: none;
}
.header-icon:hover { color: var(--primary); }
.search-box {
  display: none; position: relative;
  background: var(--surface-low); border-radius: 24px;
  padding: 0 16px; height: 40px; width: 240px;
  transition: all 0.3s; align-items: center;
}
.search-box input {
  width: 100%; height: 100%; border: none; outline: none;
  background: transparent; font-size: 13px; color: var(--text-primary);
  font-family: inherit;
}
.hamburger-btn {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px; border-radius: 10px;
  transition: background 0.2s; cursor: pointer;
  border: none; background: none;
}
.hamburger-btn:hover { background: var(--surface-low); }
.hamburger-line {
  display: block; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: all 0.3s;
}
.drawer-nav-icon { margin-right: 12px; opacity: 0.4; }
.drawer-footer-link {
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none; display: block;
}
.drawer-footer-link + .drawer-footer-link { margin-top: 8px; }

/* Horizontal scroll/overflow guard + vertical scroll only */
html, body {
  overflow-x: clip !important;
  width: 100%;
  position: relative;
  touch-action: pan-y;
}

/* Remove iOS tap highlight globally */
* {
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 1024px) { .lg-sidebar-flex { display: flex !important; } .lg-hidden-custom { display: none !important; } }


.active-lang { color: #2B3FF0 !important; font-weight: 800 !important; }

