@charset "utf-8";
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* 팔레트/토큰(:root)은 tokens.css 로 분리했다.
   마이페이지·공급자 템플릿8 처럼 reset.css 를 안 쓰는 화면도 토큰은 필요해서다.
   ※ 모든 헤드가 tokens.css 를 이 파일보다 먼저 링크한다. */
@import url('tokens.css');

/* ================= RESET & BASE ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  color: var(--c-dark);
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--c-white);
}
html {
  overflow-x: hidden; /* body가 아닌 html에 걸어야 sticky 정상 작동 */
}
a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
ul, ol { list-style: none; }
button { border: none; background: transparent; cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
input, select { font-family: inherit; }

.-frame { width: 100%; max-width: var(--w-container); margin: 0 auto; position: relative; }
.-flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ================= HEADER LAYOUT (Modern v2) ================= */
.header-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1000;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-container.is-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid transparent;
}

/* 1. Header Top (Utility) */
.header-top {
  height: var(--h-header-top);
  border-bottom: 1px solid #f0f0f0;
  font-size: 11px; color: var(--c-gray);
  background: #fafafa;
}
.header-top .-frame { height: 100%; display: flex; justify-content: space-between; align-items: center; }
.top-left { display: flex; gap: 15px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.header-top a { transition: color 0.2s; }
.header-top a:hover { color: var(--c-primary); }
.header-top .divider { width: 1px; height: 10px; background: #ddd; display: inline-block; margin: 0 2px; }
.user-greeting strong { color: var(--c-primary); font-weight: 700; }

/* 2. Main Header */
.header-main { height: var(--h-header-main); display: flex; align-items: center; }
.header-main .-frame { width: 100%; display: flex; align-items: center; justify-content: space-between; }

/* Logo */
.logo a { display: flex; align-items: center; }
.logo img { height: 29px; width: auto; transition: opacity 0.2s; }
.logo a:hover img { opacity: 0.8; }

/* Search Bar */
.search-area { flex: 1; max-width: 540px; margin: 0 40px; position: relative; }
.search-box {
  width: 100%; height: 48px;
  border: 2px solid #f2f2f2;
  border-radius: 48px;
  display: flex; align-items: center; padding: 0 6px 0 22px;
  background: #fcfcfc;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 포커스 시 강조 테두리/그림자 없이 배경만 살짝 밝게 */
.search-box:focus-within {
  border-color: #f2f2f2;
  background: #fff;
  box-shadow: none;
}
/* height/line-height를 명시해야 포커스 시 캐럿(커서)이 글자 높이만큼 커짐 (미지정 시 폰트 메트릭 기준으로 작게 표시) */
.inp-search { flex: 1; border: none; outline: none; font-size: 16px; height: 36px; line-height: 36px; color: #333; background: transparent; }
.inp-search::placeholder { color: #aaa; }
.btn-search-submit {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-search-submit:hover { background: #0847c4; transform: scale(1.05); }
.btn-search-submit svg { width: 20px; height: 20px; stroke-width: 2.5px; stroke: #fff; }

/* Icon Menu */
.icon-menu { display: flex; gap: 8px; align-items: center; }
.icon-link {
  color: #555; position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  transition: all 0.2s;
}
.icon-link:hover { color: var(--c-primary); background: rgba(11, 92, 255, 0.08); }
.icon-link svg { width: 26px; height: 26px; stroke-width: 1.7px; }
.ico-box { position: relative; display: flex; }
.badge {
  position: absolute; top: -4px; right: -6px;
  min-width: 18px; height: 18px;
  background: var(--c-point); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid #fff;
}

/* 3. Navigation (GNB) — 스크롤 시 이것만 따라옴 */
.header-nav {
  height: var(--h-nav);
  border-bottom: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 999;
  transition: box-shadow 0.3s;
}
.nav-container { height: 100%; display: flex; align-items: center; position: relative; }

/* All Menu */
.all-menu-wrap { height: 100%; display: flex; align-items: center; margin-right: 40px; }
.btn-all-menu {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; color: #333;
  padding: 6px 14px 6px 10px; border-radius: 10px;
  transition: all 0.2s;
}
.btn-all-menu:hover { background: #f5f5f5; color: var(--c-primary); }
.hamburger span { display: block; width: 18px; height: 2px; background: currentColor; margin: 3px 0; border-radius: 2px; transition: background 0.2s; }

/* GNB List */
.gnb-menu ul { display: flex; gap: 4px; }
.gnb-menu a {
  font-size: 15px; font-weight: 600; color: #555;
  padding: 10px 16px; display: block;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
}
.gnb-menu a:hover { color: var(--c-primary); background: rgba(11, 92, 255, 0.06); }
.gnb-menu a::after {
  content: '';
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--c-primary); border-radius: 2px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.gnb-menu a:hover::after { width: 24px; }
.gnb-menu .highlight a { color: var(--c-primary); font-weight: 700; }
.gnb-menu .highlight a::after { width: 24px; }

/* Popular Keyword */
.popular-keyword-wrap { margin-left: auto; display: flex; align-items: center; font-size: 13px; color: #666; }


/* ================= DRAWER MENU ================= */
.drawer-panel {
  display: block; opacity: 0; visibility: hidden; pointer-events: none;
  position: absolute; top: 100%; left: 0; width: 100%;
  background: #fff; border: 1px solid var(--c-border); border-top: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08); padding: 30px 40px; z-index: 2000;
  transform: translateY(-10px); transition: all 0.3s ease; border-radius: 0 0 12px 12px;
}
.drawer-panel.active { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.drawer-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 30px 20px; }
.drawer-item:hover .depth1 { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.depth1 { display: block; font-size: 16px; font-weight: 700; color: #333; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid transparent; }
.depth2-list li { margin-bottom: 4px; }
.depth2-list a { font-size: 13px; color: #666; display: block; padding: 2px 0; }
.depth2-list a:hover { color: var(--c-primary); transform: translateX(3px); }


/* ================= MAIN BANNER (OASIS 3-COLUMN) ================= */
.main-banner-area { width: 100%; margin-top: 10px; margin-bottom: 50px; position: relative; }

.main_banner_B { padding-bottom: 50px; overflow: hidden; position: relative; }
.main_banner_B .swiper-slide { height: auto; transition: opacity 0.3s; }
.main_banner_B .banner-item { display: block; width: 100%; height: 100%; border-radius: 0; overflow: hidden; }
.main_banner_B img { width: 100%; height: auto; display: block; }

/* Custom Pagination (Pill) */
.custom-pagination-wrap {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #ddd; border-radius: 20px;
  padding: 6px 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); gap: 15px;
  z-index: 10; font-family: 'Montserrat', sans-serif; font-size: 13px; color: #555; font-weight: 600;
}
.btn-pause, .btn-more { cursor: pointer; display: flex; align-items: center; color: #888; }
.btn-pause:hover, .btn-more:hover { color: #333; }
.swiper-pagination-custom span.current { color: #333; font-weight: 800; }
.swiper-pagination-custom span.total { color: #999; }

/* Navigation Arrows */
.main_banner_B .swiper-button-next, .main_banner_B .swiper-button-prev {
  width: 40px; height: 40px; background: #fff; border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); color: #333; border-radius: 0; /* 네모 */
}
.main_banner_B .swiper-button-prev:after, .main_banner_B .swiper-button-next:after { font-size: 16px; font-weight: bold; }


/* ================= PRODUCT SECTIONS (OASIS STYLE) ================= */
/* 공통 섹션 스타일 */
.md-pick-section { padding: 50px 0; background-color: #fff; }

/* Header */
.md-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.md-header .text-group { display: flex; align-items: baseline; gap: 10px; }
.md-header .title { font-size: 24px; font-weight: 700; color: #333; }
.md-header .desc { font-size: 14px; color: #888; }
.md-header .link-more { font-size: 14px; color: #666; display: flex; align-items: center; gap: 2px; }
.md-header .link-more:hover { color: var(--c-primary); }

/* Grid */
.md-product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 20px; }

/* Product Card */
.md-card { display: flex; flex-direction: column; position: relative; }
.md-thumb { position: relative; width: 100%; padding-top: 100%; background: #f8f8f8; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.md-thumb .img-link img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s; }
.md-card:hover .md-thumb img { transform: scale(1.03); }

/* Cart Button */
.md-thumb .btn-cart {
  position: absolute; bottom: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.95); border: 1px solid rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: center; color: #333;
  opacity: 0; transform: translateY(10px); transition: all 0.3s ease; cursor: pointer;
}
.md-card:hover .btn-cart { opacity: 1; transform: translateY(0); }
.md-thumb .btn-cart:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* Info */
.md-info { display: flex; flex-direction: column; }
.info-link { text-decoration: none; }
.md-info .prod-name {
  font-size: 16px; color: #333; line-height: 1.4; margin-bottom: 6px; font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 44px;
}
.md-info .brand { font-weight: 700; color: #333; margin-right: 4px; }

/* Price */
.md-info .price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.md-info .discount { font-size: 18px; font-weight: 800; color: var(--c-point); }
.md-info .price { font-size: 18px; font-weight: 800; color: #111; }
.md-info .original { font-size: 16px; color: #aaa; text-decoration: line-through; margin-left: 2px; font-weight: 400; }

/* Tags */
.md-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.md-tag { font-size: 11px; color: #666; background-color: #f0f0f0; padding: 3px 6px; border-radius: 2px; }
.soldout-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center; }
.soldout-cover span { font-size: 13px; font-weight: 700; color: #555; border: 1px solid #aaa; padding: 4px 8px; border-radius: 2px; background: #fff; }


/* ================= FLOATING RAIL (NEW) ================= */
.floating-rail {
  position: fixed; z-index: 1000; top: 200px; right: 20px;
  display: flex; flex-direction: column; gap: 12px;
  right: max(20px, calc(50% - 600px - 80px));
}
.rail-group.main-group {
  background: #fff; border: 1px solid #eee; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden; width: 64px;
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 0; text-decoration: none; color: #333; transition: all 0.2s;
  border-bottom: 1px solid #f5f5f5; background: #fff;
}
.rail-item:last-child { border-bottom: none; }
.rail-item:hover { background-color: #f9f9f9; color: var(--c-primary); }
.rail-item .ico-box { position: relative; margin-bottom: 3px; display: flex; justify-content: center; }
.rail-item .label { font-size: 11px; font-weight: 500; letter-spacing: -0.5px; }
.dot-badge { position: absolute; top: 0; right: -2px; width: 6px; height: 6px; background-color: #ff3b30; border-radius: 50%; }
.count-badge {
  position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px;
  background-color: var(--c-point); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border-radius: 8px; padding: 0 3px;
}

.rail-group.sub-group { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rail-fab {
  width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #eee; box-shadow: 0 2px 8px rgba(0,0,0,0.06); color: #555;
  transition: all 0.2s; cursor: pointer; text-decoration: none;
}
.rail-fab:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.rail-fab.kakao { background-color: #FEE500; border-color: #FEE500; }
.rail-fab.top { background-color: #333; color: #fff; border-color: #333; }
.rail-fab.top:hover { background-color: #111; }


/* ================= CATEGORY WIDGET (OASIS GRID) ================= */
.category-widget-section { padding: 50px 0 70px; background: #fff; }
.cate-header { margin-bottom: 30px; text-align: center; }
.cate-title { font-size: 26px; font-weight: 800; color: #333; margin-bottom: 8px; }
.cate-title .highlight { color: var(--c-primary); }
.cate-widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 20px; }
.cate-card {
  display: block; position: relative; background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #f0f0f0; transition: all 0.3s;
  transform: translateZ(0); text-decoration: none;
}
.cate-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--c-primary); }
.card-inner { padding: 25px 15px; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.icon-area { width: 64px; height: 64px; border-radius: 50%; background: #f4f6f8; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.icon-area img { width: 100%; height: 100%; object-fit: cover; }
.text-area { text-align: center; width: 100%; }
.text-area .name { font-size: 15px; font-weight: 600; color: #333; }


/* ================= MOBILE RESPONSIVE ================= */
.mo-menu-btn { display: none; } 

@media (max-width: 1024px) {
  :root { --h-header-main: 60px; --h-nav: 0px; }
  .header-top, .header-nav, .search-area { display: none; }
  /* 모바일: 데스크탑용 sticky 카테고리바(.header-nav)가 숨겨지므로
     헤더(로고+햄버거=카테고리 진입)를 스크롤 시 따라오게 sticky 고정 */
  .header-container { position: sticky; top: 0; }
  .header-main .-frame { padding: 0 15px; }
  
  .mo-menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 30px; height: 30px; margin-left: 10px; }
  .mo-menu-btn .bar { width: 100%; height: 2px; background: #333; border-radius: 2px; }
  .logo { margin-right: auto; } .logo img {  }
  .icon-menu { margin-left: 0; gap: 0px; } .icon-menu svg { width: 24px; height: 24px; }
  
  .main_banner_B { padding-bottom: 30px; }
  .custom-pagination-wrap { display: none; }
  
  .md-product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px 12px; }
  .floating-rail { display: none; }
}

@media (max-width: 768px) {
  .md-product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
  .md-thumb .btn-cart { opacity: 1; transform: translateY(0); width: 32px; height: 32px; bottom: 6px; right: 6px; }
  .cate-widget-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 10px; }

  .main_banner_B .swiper-button-next, .main_banner_B .swiper-button-prev{display:none;}
}




/* ================= MOBILE SIDEBAR (필수 추가) ================= */

/* 사이드바 기본 스타일 (숨김 상태) */
.d1sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 80%; /* 화면 너비의 80% */
  max-width: 320px;
  height: 100vh; /* 화면 전체 높이 */
  background: #fff;
  z-index: 3000; /* 헤더(1000)보다 위에 오게 설정 */
  transform: translateX(-100%); /* 왼쪽 화면 밖으로 숨김 */
  transition: transform 0.3s ease-in-out; /* 부드러운 슬라이딩 효과 */
  box-shadow: 5px 0 15px rgba(0,0,0,0.1);
  overflow-y: auto;
}

/* 사이드바 활성화 (보임 상태) */
.d1sidebar.active {
  transform: translateX(0); /* 원래 위치로 이동 (보임) */
}

/* 배경 스크롤 막기 */
body.no-scroll {
  overflow: hidden;
}

/* 사이드바 오버레이 (선택사항: 메뉴 열렸을 때 뒤쪽 어둡게) */
.d1sidebar-overlay {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 2999;
}
.d1sidebar.active + .d1sidebar-overlay,
body.no-scroll .d1sidebar-overlay { /* JS 로직에 따라 선택자 조정 */
  display: block;
}




/* ================= MOBILE SIDEBAR INNER DESIGN ================= */

/* 1. 상단 헤더 (로그인 영역) */
.sidebar-header {
  padding: 30px 20px 20px;
  background-color: #f8f9fa; /* 연한 회색 배경 */
  position: relative;
  border-bottom: 1px solid #eee;
}

.user-info {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
  margin-bottom: 15px;
}

.auth-links {
  display: flex;
  gap: 8px;
}

.btn-auth {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  border: 1px solid #ddd;
  color: #555;
  background: #fff;
  flex: 1; /* 버튼 크기 동일하게 */
}

.btn-auth.login {
  background-color: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* 비회원 주문조회 링크 (비로그인 시에만 노출) */
.sidebar-header .guest-order-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  text-decoration: none;
}
.sidebar-header .guest-order-link:hover,
.sidebar-header .guest-order-link:active {
  background: #f1f3f5;
  color: #222;
}
.sidebar-header .guest-order-link svg {
  flex-shrink: 0;
  color: #999;
}

/* 닫기 버튼 */
.sidebar-header .closebtn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 32px;
  line-height: 1;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  padding: 0 10px;
}

/* 2. 퀵 아이콘 (홈, 마이, 장바구니) */
.sidebar-quick-icons {
  display: flex;
  border-bottom: 10px solid #f4f6f8; /* 굵은 구분선 */
  padding: 15px 0;
}

.quick-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #333;
  gap: 5px;
  font-size: 12px;
}
.quick-item .ico svg { width: 24px; height: 24px; stroke: #333; }

/* 모바일 사이드바 인기검색어 */
.sidebar-popular {
  padding: 16px 18px;
  border-bottom: 10px solid #f4f6f8;
}
.sidebar-popular-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}
.sidebar-popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-popular-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}
.sidebar-popular-list .sp-rank {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-weight: 800;
  color: #ff2d55;
  font-size: 14px;
}
.sidebar-popular-list .sp-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-popular-list li a:active { background: #f7f7f7; }
/* 접기/펼치기: 기본 3개만, 펼치면 전체 */
.sidebar-popular-list .sp-extra { display: none; }
.sidebar-popular.is-open .sidebar-popular-list .sp-extra { display: block; }
.sidebar-popular-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: #f7f7f7;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
}
.sidebar-popular-toggle .spt-caret { transition: transform 0.2s ease; }
.sidebar-popular.is-open .sidebar-popular-toggle .spt-caret { transform: rotate(180deg); }


/* 3. 메뉴 리스트 (아코디언) */
.sidebar-content {
  padding-bottom: 50px;
}

.mobile-gnb {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-gnb .divider {
  height: 10px;
  background-color: #f4f6f8;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.menu-item {
  border-bottom: 1px solid #f5f5f5;
}

/* 1차 메뉴 (Depth 1) */
.depth1-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  position: relative;
}

/* 하위 메뉴 토글 화살표 */
.head-toggle-icon {
  width: 8px;
  height: 8px;

  transform: rotate(45deg);
  transition: transform 0.3s;
  margin-right: 5px;
  margin-bottom: 3px;

  color: black;
  border-right: 2px solid #000;
    border-bottom: 2px solid #000;
}

/* 메뉴 열렸을 때 (JS로 .open 클래스 추가 시) */
.menu-item.open .depth1-link {
  color: var(--c-primary);
  font-weight: 700;
}
.menu-item.open .head-toggle-icon {
  transform: rotate(-135deg); /* 화살표 뒤집기 */
  border-color: var(--c-primary);
}

/* 2차 메뉴 (Submenu - 기본 숨김) */
.submenu {
  display: none; /* JS로 토글 */
  background-color: #fafafa;
  padding: 10px 0;
  list-style: none;
}

.submenu li a {
  display: block;
  padding: 10px 30px;
  font-size: 14px;
  color: #666;
  text-decoration: none;
}
.submenu li a:hover {
  color: var(--c-primary);
}




/* ==========================================================================
   [수정] 5. 페이지네이션 (Pagination)
   ========================================================================== */
   .tbl_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 60px 0;
    padding: 0;
    list-style: none; /* li 점 제거 */
  }
  
  /* 1. 링크가 있는 경우의 래퍼 (a 태그) */
  .tbl_pagination a {
    display: block;
    text-decoration: none;
    color: inherit;
  }
  
  /* 2. 실제 버튼 모양 (li 태그) */
  /* a태그 안에 있든, 단독으로 있든(active/disabled) 동일하게 스타일 적용 */
  .tbl_pagination li {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid #e5e5e5;
    background-color: #fff;
    color: #666;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
  }
  
  /* 3. 마우스 호버 효과 */
  /* 링크(a) 안에 있는 li에 마우스를 올렸을 때 */
  .tbl_pagination a:hover li {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background-color: #fdfdfd;
  }
  
  /* 4. 활성화된 페이지 (Current Page) */
  /* PHP에서 <li class='active'>로 출력됨 */
  .tbl_pagination li.active {
    background-color: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
    font-weight: 700;
    cursor: default; /* 클릭 안 되는 느낌 */
  }
  
  /* 5. 비활성화된 화살표 (Disabled) */
  .tbl_pagination li.disabled {
    background-color: #f9f9f9;
    color: #ccc;
    border-color: #eee;
    cursor: default;
  }
  
  /* 6. 화살표 아이콘 생성 (CSS 가상요소 사용) */
  .tbl_pagination .arrow::before {
    font-family: sans-serif; /* 특수문자 깨짐 방지 */
    font-size: 16px;
    line-height: 1;
  }
  
  /* 맨 처음 (<<) */
  .tbl_pagination .arrow-prev-2::before {
    content: "«";
  }
  /* 이전 (<) */
  .tbl_pagination .arrow-prev::before {
    content: "‹";
    font-size: 18px; /* 홑화살표는 조금 더 크게 */
  }
  /* 다음 (>) */
  .tbl_pagination .arrow-next::before {
    content: "›";
    font-size: 18px;
  }
  /* 맨 끝 (>>) */
  .tbl_pagination .arrow-next-2::before {
    content: "»";
  }




  /* ==========================================================================
   팝업 윈도우 스타일
   ========================================================================== */

/* 팝업 컨테이너 */
.popup-window {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 600px;
  max-width: 90vw;
  height: 600px;
  max-height: 90vh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 팝업 등장 애니메이션 */
@keyframes popupFadeIn {
  from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.9);
  }
  to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
  }
}

/* 팝업 이미지 링크 영역 */
.popup-window a {
  flex: 1;
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.popup-window a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.popup-window a:hover img {
  transform: scale(1.02);
}

/* 팝업 버튼 영역 */
.popup-buttons {
  display: flex;
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
}

.popup-buttons button {
  flex: 1;
  height: 50px;
  border: none;
  background: transparent;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.popup-buttons button:first-child {
  border-right: 1px solid #e5e5e5;
}

.popup-buttons button:hover {
  background: #f0f0f0;
  color: #111;
}

.popup-buttons button:active {
  background: #e5e5e5;
}

/* 닫기 버튼 강조 */
.popup-buttons button:last-child {
  color: #666;
  font-weight: 700;
}

.popup-buttons button:last-child:hover {
  color: #111;
  background: #e8e8e8;
}

/* 숨김 상태 */
.popup-window[style*="display: none"],
.popup-window[style*="display:none"] {
  display: none !important;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
  .popup-window {
      width: 95vw;
      height: auto;
      max-height: 85vh;
      border-radius: 8px;
  }
  
  .popup-buttons button {
      font-size: 13px;
      height: 45px;
  }
}

/* 반응형 - 작은 화면 (세로 모드) */
@media (max-width: 480px) {
  .popup-window {
      width: 100vw;
      height: 100vh;
      max-width: 100vw;
      max-height: 100vh;
      border-radius: 0;
      top: 0;
      left: 0;
      transform: none;
  }
}

/* 팝업 배경 딤드 (선택사항) */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
}

.popup-overlay.active {
  display: block;
}

/* 여러 팝업이 있을 때 위치 조정 */
.popup-window[data-popup-id="1"] {
  top: 10%;
  left: 10%;
  transform: none;
}

.popup-window[data-popup-id="2"] {
  top: 15%;
  left: 15%;
  transform: none;
}

.popup-window[data-popup-id="3"] {
  top: 20%;
  left: 20%;
  transform: none;
}

/* 드래그 가능하게 만들기 (선택사항) */
.popup-window.draggable {
  cursor: move;
}

/* X 닫기 버튼 추가 스타일 (HTML에 추가 가능) */
.popup-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.popup-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

/* 로딩 상태 */
.popup-window.loading {
  pointer-events: none;
  opacity: 0.6;
}

.popup-window.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 티티멤버스 회원공개 가격 마스킹 (mall 공통 — mallHead.php 로드) */
.price-guest-mask {
  display: inline-block;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff5a3c 0%, #ff2d55 100%);
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.25;
  letter-spacing: -0.3px;
  box-shadow: 0 2px 8px rgba(255, 45, 85, 0.35);
}
.price-guest-mask:hover {
  background: linear-gradient(135deg, #ff4a28 0%, #ff1744 100%);
  box-shadow: 0 3px 12px rgba(255, 45, 85, 0.45);
  text-decoration: none;
  color: #fff;
}
/* 좁은 위젯/패널 카드: 박스 대신 빨강 강조 텍스트 (카드폭 넘침 방지) */
.recent-products-widget .recent-price .price-guest-mask,
.recent-panel .rp-price .price-guest-mask {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #ff2d55;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: normal;
  word-break: keep-all;
  text-decoration: none;
  line-height: 1.4;
}
.recent-products-widget .recent-price .price-guest-mask:hover,
.recent-panel .rp-price .price-guest-mask:hover { background: none; text-decoration: underline; }
.recent-products-widget .recent-price,
.recent-panel .rp-price { min-width: 0; flex-wrap: wrap; }
/* ============================================================================
   [TTBOX] 헤더 재구성 (2026-08-07)
   ----------------------------------------------------------------------------
   떠리마켓 원본은 3단(유틸 띠 / 로고+검색 / 전체카테고리+GNB)이었다.
   티티박스는 2단으로 줄이고 배치를 바꿔 실루엣 자체를 다르게 한다.
     1단(.header-main) : 로고 · [전체] · 넓은 검색 · 우측 액션 클러스터
     2단(.header-nav)  : 얇은 카테고리 스트립
   마크업의 JS 후크 이름은 그대로라 스크립트에는 영향이 없다.
   파일 끝에 두어 위쪽 원본 선언을 덮는다.
   ============================================================================ */

:root { --h-header-main: 74px; --h-nav: 46px; }

/* 유틸 띠는 우측 클러스터로 흡수했으므로 렌더하지 않는다(마크업도 제거됨) */
.tb-head .header-top { display: none; }

.tb-head .header-main .-frame {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-start;   /* space-between → 좌측 정렬 + 검색이 남는 폭을 먹는다 */
}

/* 로고 */
.tb-head .logo { flex-shrink: 0; }
.tb-head .logo img { height: 30px; }

/* ── 전체 카테고리: 원본은 아래 줄 좌측이었는데 로고 바로 옆으로 끌어올렸다.
      여기가 실루엣 차이의 핵심이라 칩 형태로 눈에 띄게 만든다. */
.tb-head .header-main .all-menu-wrap {
  height: auto;
  margin-right: 0;
  flex-shrink: 0;
}
.tb-head .header-main .btn-all-menu {
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--c-black);
  color: #fff;
  font-size: 14.5px;
}
.tb-head .header-main .btn-all-menu:hover { background: var(--c-primary); color: #fff; }
.tb-head .header-main .hamburger span { width: 16px; margin: 2.5px 0; }

/* ★ 드로어(.drawer-panel)는 width:100% + absolute 라 "가장 가까운 positioned 조상"
   기준으로 폭이 정해진다. .all-menu-wrap 에 position:relative 를 주면 버튼 폭(≈140px)
   만큼만 열려버리므로 주지 않는다 → .-frame(position:relative)이 기준이 되어
   원본처럼 컨테이너 전체 폭으로 펼쳐진다. */
.tb-head .header-main .drawer-panel { top: 100%; left: 0; }

/* ── 검색: 최대폭 제한을 풀고 남는 폭을 전부 쓴다 */
.tb-head .search-area {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}
.tb-head .search-box { border-radius: 999px; }

/* ── 우측 액션 클러스터 (구 유틸 띠 흡수) */
.tb-head .tb-actions { flex-shrink: 0; gap: 6px; }
.tb-head .tb-util {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-gray);
  white-space: nowrap;
}
.tb-head .tb-util a { color: inherit; transition: color .15s; }
.tb-head .tb-util a:hover { color: var(--c-primary); }
.tb-head .tb-util-quiet { color: var(--c-light); font-weight: 500; }
.tb-head .tb-util-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--c-primary-light);
  color: var(--c-primary-deep);
  font-size: 11.5px;
  font-weight: 800;
}
.tb-head .tb-util-cta {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--c-primary);
  color: #fff !important;
}
.tb-head .tb-util-cta:hover { background: var(--c-primary-deep); }

/* ── 2단: 카테고리 스트립. 원본보다 얇고, 좌측에 전체버튼이 없어 카테고리가 바로 시작된다 */
.tb-head + .header-nav,
.header-nav.tb-nav { height: var(--h-nav); }
.header-nav .nav-container { gap: 2px; }
.header-nav .gnb-menu a { font-size: 14px; padding: 8px 13px; }

@media (max-width: 1200px) {
  /* 폭이 좁아지면 유틸 텍스트부터 접는다(검색바를 지키는 게 우선) */
  .tb-head .tb-util { display: none; }
}

/* ── 모바일: 새 헤더 구성 되돌리기 (1024px 이하)
      전체카테고리 칩은 햄버거가 같은 역할을 하므로 숨긴다.
      숨기지 않으면 로고+칩+아이콘이 한 줄에 안 들어가 가로 스크롤 70px 이 생긴다. */
@media (max-width: 1024px) {
  .tb-head .header-main .-frame {
    gap: 8px;
    justify-content: flex-start;
  }
  .tb-head .header-main .all-menu-wrap { display: none; }
  .tb-head .tb-util { display: none; }
  .tb-head .logo { margin-right: auto; }
  .tb-head .tb-actions { gap: 0; }
}
