/* =========================================
   1. 기본 변수 및 초기화
   ========================================= */
:root {
  --bg-dark: #0a0a0a; 
  --bg-darker: #050505; 
  --bg-light: #ffffff;
  --accent: #c5a059; 
  --amazon-gold: #f0c14b;
  --text-main: #f4f4f4; 
  --text-muted: #888888;
  --font-heading: 'Playfair Display', serif; 
  --font-body: 'Inter', sans-serif;
}

html, body { overflow-x: hidden !important; max-width: 100vw !important; width: 100% !important; margin: 0; padding: 0; }
* { margin: 0; padding: 0; box-sizing: border-box; max-width: 100%; }
body { font-family: var(--font-body); background-color: var(--bg-dark); color: var(--text-main); line-height: 1.6; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; }
.black-text h2, .black-text p { color: #111; }

/* =========================================
   2. 네비게이션 바 (공통 최신)
   ========================================= */
.navbar { position: fixed; top: 0; left: 0; width: 100%; padding: 1.5rem 4rem; display: flex; justify-content: space-between; align-items: center; background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(10px); z-index: 1000; border-bottom: 1px solid #333; }
.logo { font-size: 1.5rem; font-family: var(--font-heading); letter-spacing: 2px; text-transform: uppercase;}
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; }
.nav-links a, .nav-links button { color: var(--text-main); text-decoration: none; margin-left: 2rem; font-size: 0.9rem; letter-spacing: 1px; text-transform: uppercase; background: none; border: none; cursor: pointer; transition: 0.3s; }
.nav-links a:hover, .nav-links button:hover { color: var(--accent); }
.mobile-menu-btn { display: none; font-size: 1.8rem; cursor: pointer; color: var(--text-main); }

/* =========================================
   3. 🟢 둥둥 떠다니는 WhatsApp 버튼
   ========================================= */
.whatsapp-float {
  position: fixed; width: 60px; height: 60px; bottom: 40px; right: 40px;
  background-color: #25d366; color: #FFF; border-radius: 50px; text-align: center;
  box-shadow: 0px 4px 15px rgba(0,0,0,0.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  transition: transform 0.3s ease, background-color 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); background-color: #20b858; }
.whatsapp-float svg { width: 35px; height: 35px; fill: white; }

/* =========================================
   4. 히어로 섹션 및 공통 버튼
   ========================================= */
.hero { height: 100vh; display: flex; align-items: center; padding: 0 4rem; background: linear-gradient(rgba(10,10,10,0.7), rgba(10,10,10,0.9)), url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&q=80') center/cover; }
.hero h1 { font-size: 5rem; line-height: 1.1; margin-bottom: 1.5rem; }
.hero p { font-size: 1.2rem; color: var(--text-muted); max-width: 500px; margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem;}
.btn-primary { display: inline-block; padding: 1rem 2.5rem; background: var(--text-main); color: #0a0a0a; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; font-weight: 600; transition: all 0.3s ease; border: 1px solid var(--text-main); cursor: pointer; text-align: center; border-radius: 4px; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: white; }
.btn-secondary { display: inline-block; padding: 1rem 2.5rem; background: transparent; color: var(--text-main); text-decoration: none; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; font-weight: 600; transition: all 0.3s ease; border: 1px solid var(--text-main); cursor: pointer; text-align: center; border-radius: 4px; }
.btn-secondary:hover { background: var(--text-main); color: var(--bg-dark); }
.full-width { width: 100%; text-align: center; }

/* =========================================
   5. 섹션 레이아웃 & 기타 페이지 요소
   ========================================= */
.section-dark { padding: 8rem 4rem; text-align: center; }
.section-header { margin-bottom: 4rem; }
.section-header h2 { font-size: 3rem; margin-bottom: 0.5rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; max-width: 1000px; margin: 0 auto; }
.feature-card { background: #111; border: 1px solid #333; border-radius: 4px; padding: 1.5rem 1rem; transition: transform 0.3s ease, border-color 0.3s ease; }
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.feature-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }
.feature-card h3 { color: var(--text-main); font-size: 0.95rem; font-weight: 600; }

.profile-container { display: flex; gap: 4rem; max-width: 1200px; margin: 0 auto; align-items: center; text-align: left; }
.profile-text { flex: 1.2; }
.profile-image-box { flex: 1; height: 480px; width: 100%; background-size: cover; background-position: center; border-radius: 4px; border: 1px solid #222; box-shadow: 0 15px 40px rgba(0,0,0,0.5); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; margin-top: 3rem;}
.product-card { text-align: left; }
.img-placeholder { height: 400px; background-color: #222; margin-bottom: 1.5rem; transition: transform 0.4s ease; border-radius: 4px; background-size: cover; background-position: center; }
.product-card:hover .img-placeholder { transform: scale(1.02); }
.product-card h3 { color: #111; font-size: 1.5rem; margin-bottom: 0.5rem; }
.product-card .price { color: var(--accent); font-weight: 600; margin-bottom: 1.5rem; }

/* =========================================
   6. 상세 페이지 및 장바구니
   ========================================= */
.product-layout { display: flex; gap: 4rem; max-width: 1200px; margin: 0 auto; padding: 4rem 2rem; }
.product-image-large { flex: 1; height: 550px; width: 100%; background-size: cover; background-position: center; background-repeat: no-repeat; border-radius: 8px; border: 1px solid #ddd; display: block; }
.product-info-box { flex: 1; display: flex; flex-direction: column; }
.amazon-color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.amazon-color-box { text-align: center; padding: 15px; border: 2px solid #ccc; border-radius: 8px; cursor: pointer; transition: 0.3s; background: #fff;}
.amazon-color-box:hover { border-color: var(--accent); }
.amazon-color-box.selected { border-color: var(--accent); background: #fffaf0; box-shadow: 0 0 10px rgba(197, 160, 89, 0.3); }
.measurement-inputs { display: flex; gap: 1rem; margin-top: 15px; }
.measurement-inputs input { flex: 1; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; color: #111;}
.btn-primary.checkout-btn { background: var(--amazon-gold); color: #111; border: none; padding: 15px; font-weight: bold; cursor: pointer; width: 100%; border-radius: 4px; margin-top: 20px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px;}

.cart-drawer { position: fixed; top: 0; right: -100%; width: 100%; max-width: 400px; height: 100vh; background: var(--bg-light); color: #111; z-index: 2000; padding: 2rem; display: flex; flex-direction: column; transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1); box-shadow: -10px 0 30px rgba(0,0,0,0.2); }
.cart-drawer.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 1px solid #eee; padding-bottom: 1rem; }
#close-cart { background: none; border: none; font-size: 2rem; cursor: pointer; color: #111;}
.cart-items { flex: 1; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid #f9f9f9; padding-bottom: 1rem;}
.remove-item { background: none; border: none; color: #ff4d4d; font-size: 0.8rem; cursor: pointer; text-transform: uppercase;}
.cart-footer { border-top: 1px solid #eee; padding-top: 1.5rem; }
.cart-footer .total { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; display: flex; justify-content: space-between; color: #111;}
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1500; display: none; opacity: 0; transition: opacity 0.3s; }
.cart-overlay.active { display: block; opacity: 1; }

/* =========================================
   7. 📱 모바일 강제 호환 디자인
   ========================================= */
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; width: 100% !important; position: relative; }
  .navbar { padding: 1rem 1.5rem; left: 0; }
  .logo { font-size: 1.2rem; }
  .mobile-menu-btn { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-darker); flex-direction: column; padding: 1.5rem 0; border-top: 1px solid #222; display: none; z-index: 9999; }
  .nav-links.active { display: flex; }
  .nav-links a, .nav-links button { margin: 1rem 0; font-size: 1.1rem; margin-left: 0; }
  
  .hero { height: auto !important; min-height: 100vh !important; padding: 6rem 1.5rem 3rem 1.5rem !important; justify-content: center !important; text-align: center; width: 100% !important; overflow: hidden !important; }
  .hero h1 { font-size: 2.2rem !important; line-height: 1.2; margin-bottom: 1rem !important; } 
  .hero-buttons { flex-direction: column; width: 100%; align-items: center; gap: 0.8rem; margin-top: 0; }
  .hero-buttons a { width: 100% !important; max-width: 100% !important; padding: 1rem; font-size: 0.9rem; }
  
  .section-dark, .section-light { padding: 4rem 1.2rem; width: 100% !important; overflow: hidden !important;}
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .profile-container { flex-direction: column; gap: 2rem; text-align: left; }
  .profile-image-box { width: 100% !important; height: 250px !important; background-size: cover !important; }
  
  .product-grid { display: flex !important; flex-direction: column !important; gap: 1.5rem; width: 100% !important; } 
  .img-placeholder { height: 250px !important; width: 100% !important; }
  
  .product-layout { display: flex !important; flex-direction: column !important; gap: 2rem; padding: 6rem 1.2rem 2rem 1.2rem !important; width: 100% !important; }
  .product-image-large { min-height: 350px !important; height: 350px !important; width: 100% !important; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; display: block !important; flex: none !important; -webkit-flex-shrink: 0; flex-shrink: 0; }
  
  /* 🔥 [필독] 모바일 상품 정보 초강력 왼쪽 정렬 패치 v31 🔥 */
  /* align-items는 flex박스의 자식(내용물)들을 왼쪽(start)으로 붙입니다. */
  .product-info-box {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* 정보 창 안의 모든 글자, 가격, 제목 요소들을 무조건 왼쪽 정렬 강제 */
  .product-info-box h1,
  .product-info-box h2,
  .product-info-box h3,
  .product-info-box h4,
  .product-info-box p,
  .product-info-box span,
  .product-info-box .price {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    width: auto !important;
    display: block !important;
  }

  /* 측정값 입력창 모바일 스타일 조정 */
  .measurement-inputs { flex-direction: column; gap: 0.5rem; width: 100%; align-items: flex-start; }
  .measurement-inputs span { align-self: flex-start !important; margin: 5px 0; }
  
  /* 색상 그리드도 왼쪽에서부터 정렬 */
  .amazon-color-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; justify-content: flex-start; justify-items: start;}

  .cart-drawer { width: 90% !important; right: -90% !important; padding: 1.5rem; }
  .cart-drawer.open { right: 0 !important; }

  /* 왓츠앱 버튼 모바일 축소 */
  .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; }
  .whatsapp-float svg { width: 30px; height: 30px; }
}