/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: #FAF8F4;
  color: #1A1A1A;
  font-size: 15px;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid #E8E4DC;
  background-color: #FAF8F4;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #6B6B6B;
  transition: color 0.2s;
}

.nav a:hover {
  color: #1A1A1A;
}

.cart-icon {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #6B6B6B;
}

/* ===== 로그인 상태 ===== */
.auth-user-btn {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-user-btn:hover { color: #6B6B6B; }

.auth-btn--ghost {
  border-color: transparent !important;
  padding-left: 4px;
  padding-right: 4px;
}
.auth-btn--ghost:hover { border-color: transparent !important; }

/* ===== HEADER RIGHT ===== */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-btn {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #6B6B6B;
  padding: 7px 16px;
  border: 1px solid #E8E4DC;
  background: none;
  transition: border-color 0.2s, color 0.2s;
}

.auth-btn:hover {
  border-color: #1A1A1A;
  color: #1A1A1A;
}

/* ===== 회원가입 모달 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(26, 26, 26, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: #FAF8F4;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s;
}

.modal-overlay.open .modal-container {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 22px;
  color: #6B6B6B;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #1A1A1A;
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13px;
  color: #6B6B6B;
  margin-bottom: 32px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #6B6B6B;
}

.form-input {
  padding: 11px 14px;
  border: 1px solid #E8E4DC;
  background-color: #FFFFFF;
  font-family: inherit;
  font-size: 14px;
  color: #1A1A1A;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #1A1A1A;
}

.form-input::placeholder {
  color: #BBBBBB;
}

.form-error {
  font-size: 12px;
  color: #C0392B;
  min-height: 16px;
}

.btn-signup-submit {
  width: 100%;
  padding: 14px;
  background-color: #1A1A1A;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 0.2s;
  margin-top: 6px;
}

.btn-signup-submit:hover {
  background-color: #444444;
}

@media (max-width: 768px) {
  .modal-container {
    padding: 40px 28px;
    margin: 0 20px;
  }
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  font-size: 12px;
  color: #6B6B6B;
}

.breadcrumb a:hover {
  color: #1A1A1A;
}

.breadcrumb span:last-child {
  color: #1A1A1A;
}

/* ===== PRODUCT LAYOUT ===== */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ===== 이미지 영역 ===== */
.product-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #F0EDE6;
  overflow: hidden;
}

.image-main img {
  transition: transform 0.4s ease;
}

.image-main:hover img {
  transform: scale(1.02);
}

.image-thumbnails {
  display: flex;
  gap: 8px;
}

.thumb {
  width: 80px;
  height: 80px;
  border: 1px solid #E8E4DC;
  overflow: hidden;
  background: none;
  padding: 0;
  transition: border-color 0.2s;
}

.thumb:hover {
  border-color: #1A1A1A;
}

.thumb.active {
  border-color: #1A1A1A;
}

/* ===== 상품 정보 영역 ===== */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-region {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #6B6B6B;
}

.product-name {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.product-price {
  font-size: 24px;
  font-weight: 500;
  margin-top: 4px;
}

/* ===== 메타 정보 ===== */
.product-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.meta-label {
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #6B6B6B;
  min-width: 80px;
  font-size: 11px;
}

.meta-value {
  color: #1A1A1A;
}

/* ===== 플레이버 노트 ===== */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #6B6B6B;
  margin-bottom: 10px;
}

/* ===== 가로형 막대 차트 ===== */
.flavor-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.flavor-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.fbar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fbar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.fbar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #8A8480;
  text-transform: uppercase;
}

.fbar-value {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  line-height: 1;
}

.fbar-max {
  font-size: 10px;
  font-weight: 400;
  color: #B8B0A8;
}

.fbar-track {
  height: 8px;
  background: #EDE9E2;
  border-radius: 99px;
  overflow: hidden;
}

.fbar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.flavor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flavor-tag {
  padding: 8px 14px;
  border: 1px solid #E8E4DC;
  font-size: 13px;
  color: #6B6B6B;
  background-color: #FFFFFF;
  letter-spacing: 0.03em;
}

/* ===== 구분선 ===== */
.divider {
  height: 1px;
  background-color: #E8E4DC;
}

/* ===== 옵션 그룹 ===== */
.option-group {
  display: flex;
  flex-direction: column;
}

.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-btn {
  padding: 10px 20px;
  border: 1px solid #E8E4DC;
  background-color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  color: #1A1A1A;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.option-btn:hover {
  border-color: #1A1A1A;
}

.option-btn.selected {
  border-color: #1A1A1A;
  background-color: #1A1A1A;
  color: #FFFFFF;
}

/* ===== 수량 선택 ===== */
.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid #E8E4DC;
  width: fit-content;
  background-color: #FFFFFF;
}

.qty-btn {
  width: 40px;
  height: 40px;
  font-size: 18px;
  color: #1A1A1A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.qty-btn:hover {
  background-color: #F0EDE6;
}

.qty-value {
  min-width: 48px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  border-left: 1px solid #E8E4DC;
  border-right: 1px solid #E8E4DC;
  height: 40px;
  line-height: 40px;
}

/* ===== 재고 상태 ===== */
.stock-status {
  font-size: 13px;
}

.in-stock {
  color: #2D6A4F;
}

.out-of-stock {
  color: #C0392B;
}

/* ===== 구매 버튼 ===== */
.purchase-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-cart,
.btn-buy {
  width: 100%;
  padding: 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}

.btn-cart {
  background-color: #FFFFFF;
  color: #1A1A1A;
  border: 1px solid #1A1A1A;
}

.btn-cart:hover {
  background-color: #F0EDE6;
}

.btn-buy {
  background-color: #1A1A1A;
  color: #FFFFFF;
}

.btn-buy:hover {
  background-color: #444444;
}

/* ===== 제품 스토리 & 추출 가이드 ===== */
.product-story,
.product-brew {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.story-text {
  font-size: 14px;
  color: #4A4A4A;
  line-height: 1.85;
}

.brew-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.brew-guide-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  background-color: #F5F2EC;
}

.brew-guide-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #6B6B6B;
}

.brew-guide-value {
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
}

/* ===== 원산지 지도 ===== */
.origin-map-section {
  background-color: #F5F2EC;
  border-top: 1px solid #E8E4DC;
  padding: 48px 40px 56px;
}

.origin-map-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.origin-map-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.origin-map-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.origin-map-sub {
  font-size: 13px;
  color: #6B6B6B;
}

#originMapIframe {
  width: 100%;
  height: 420px;
  border: 1px solid #E8E4DC;
  display: block;
}

@media (max-width: 768px) {
  .origin-map-section {
    padding: 32px 20px 40px;
  }
  #originMapIframe {
    height: 280px;
  }
}

/* ===== FOOTER ===== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  border-top: 1px solid #E8E4DC;
  margin-top: 40px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand {
  font-size: 13px;
  font-weight: 600;
  color: #6B6B6B;
  letter-spacing: 0.04em;
}

.footer-copy {
  font-size: 12px;
  color: #AAAAAA;
}

.footer-admin-link {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  text-decoration: none;
  border: 1px solid #D0CBC2;
  padding: 6px 16px;
  border-radius: 4px;
  transition: background 0.25s, border-color 0.25s;
  letter-spacing: 0.04em;
}

.footer-admin-link:hover {
  background: #1A1A1A;
  color: #FAF8F4;
  border-color: #1A1A1A;
}

/* ===== 햄버거 버튼 (PC에서 숨김) ===== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 10px;
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background-color: #1A1A1A;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* 헤더 */
  .header {
    padding: 14px 16px;
    position: sticky;
  }

  .logo {
    font-size: 13px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 모바일 nav — 드롭다운으로 전환 */
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #FAF8F4;
    border-bottom: 2px solid #E8E4DC;
    flex-direction: column;
    gap: 0;
    z-index: 50;
    box-shadow: 0 8px 20px rgba(26,26,26,0.10);
    padding: 4px 0 8px;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #1A1A1A;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #F0EDE6;
  }
  .nav a:hover,
  .nav a.active {
    background-color: #F5F2EC;
    color: #1A1A1A;
  }

  /* 햄버거 버튼 표시 */
  .mobile-menu-btn {
    display: flex;
  }

  /* header-right: cart만 */
  .header-right {
    gap: 0;
    flex-shrink: 0;
  }
  .auth-btn,
  .auth-user-btn {
    display: none !important;
  }
  .header-right .cart-icon {
    font-size: 12px;
    white-space: nowrap;
    padding: 4px 0;
  }

  /* 모바일 nav 안 auth 영역 */
  .mobile-nav-auth {
    border-top: 2px solid #E8E4DC;
    margin-top: 4px;
    padding-top: 4px;
  }
  .mobile-nav-link {
    display: block;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6B6B6B;
    text-decoration: none;
    border-bottom: 1px solid #F0EDE6;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
    letter-spacing: 0.02em;
    transition: background-color 0.15s, color 0.15s;
  }
  .mobile-nav-link:hover {
    background-color: #F5F2EC;
    color: #1A1A1A;
  }
  .mobile-nav-link--admin {
    font-size: 13px;
    color: #AAAAAA;
  }

  /* 기타 */
  .breadcrumb {
    padding: 12px 20px;
  }
  .product-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 20px 20px 60px;
  }
  .product-name { font-size: 22px; }
  .product-price { font-size: 20px; }
}
