@font-face {
  font-family: "SUIT";
  src: url("/fonts/SUIT-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* ===== 브랜드 컬러 (버건디) ===== */
:root {
  --burgundy: #8c1c3f;
  --burgundy-hover: #731934;
  --burgundy-active: #5c1429;
  --burgundy-dark: #5c1429;
  --burgundy-light: #f6e4e9;
  --burgundy-ink: #ffffff;
  --burgundy-accent: #d4567e;

  /* Bootstrap 유틸리티(.text-primary, .bg-primary 등)가 참조하는 변수도 같이 교체 */
  --bs-primary: var(--burgundy);
  --bs-primary-rgb: 140, 28, 63;

  /* ===== 라이트/다크 모드 (기본값: 라이트, 페이지 본문 배경/글자색) ===== */
  --burgundy-bg: #ffffff;
  --burgundy-text: #212529;
  --burgundy-text-muted: #6c757d;
}

:root[data-theme="dark"] {
  --burgundy-bg: #121010;
  --burgundy-text: #f1e8e3;
  --burgundy-text-muted: #b9a79f;
}

body {
  font-family: "SUIT", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  background-color: var(--burgundy-bg);
  color: var(--burgundy-text);
}

/* 흰 배경 카드(.card)가 아닌, 어두운 페이지 배경에 바로 올라간 보조 텍스트 */
main .text-muted,
footer.text-muted {
  color: var(--burgundy-text-muted);
}

/* .card 안쪽은 여전히 밝은 배경이므로 기본 Bootstrap 색을 유지 */
.card .text-muted {
  color: #6c757d;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

a {
  color: var(--burgundy-accent);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--burgundy);
}

html {
  position: relative;
  min-height: 100%;
}

/* ===== 하단 고정(sticky) 푸터: 내용이 짧아도 푸터가 항상 화면 맨 아래에 붙음 ===== */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main-wrap {
  flex: 1 0 auto;
}

body.cat-mobile-overlay-open {
  overflow: hidden;
}

/* ===== Bootstrap primary 컴포넌트 재색칠 (이 빌드는 하드코딩된 블루 헥스라 변수만으론 안 바뀜) ===== */
.btn-primary {
  color: var(--burgundy-ink);
  background-color: var(--burgundy);
  border-color: var(--burgundy);
}

.btn-primary:hover {
  color: var(--burgundy-ink);
  background-color: var(--burgundy-hover);
  border-color: var(--burgundy-hover);
}

.btn-check:focus + .btn-primary, .btn-primary:focus {
  color: var(--burgundy-ink);
  background-color: var(--burgundy-hover);
  border-color: var(--burgundy-hover);
  box-shadow: 0 0 0 .25rem rgba(140, 28, 63, .5);
}

.btn-check:checked + .btn-primary, .btn-check:active + .btn-primary, .btn-primary:active, .btn-primary.active, .show > .btn-primary.dropdown-toggle {
  color: var(--burgundy-ink);
  background-color: var(--burgundy-active);
  border-color: var(--burgundy-active);
}

.btn-check:checked + .btn-primary:focus, .btn-check:active + .btn-primary:focus, .btn-primary:active:focus, .btn-primary.active:focus, .show > .btn-primary.dropdown-toggle:focus {
  box-shadow: 0 0 0 .25rem rgba(140, 28, 63, .5);
}

.btn-primary.disabled, .btn-primary:disabled {
  color: var(--burgundy-ink);
  background-color: var(--burgundy);
  border-color: var(--burgundy);
}

.btn-outline-primary {
  color: var(--burgundy-dark);
  border-color: var(--burgundy);
}

.btn-outline-primary:hover {
  color: var(--burgundy-ink);
  background-color: var(--burgundy);
  border-color: var(--burgundy);
}

.btn-check:focus + .btn-outline-primary, .btn-outline-primary:focus {
  box-shadow: 0 0 0 .25rem rgba(140, 28, 63, .5);
}

.btn-check:checked + .btn-outline-primary, .btn-check:active + .btn-outline-primary, .btn-outline-primary:active, .btn-outline-primary.active, .btn-outline-primary.dropdown-toggle.show {
  color: var(--burgundy-ink);
  background-color: var(--burgundy);
  border-color: var(--burgundy);
}

.border-primary {
  border-color: var(--burgundy) !important;
}

/* 이 Bootstrap 빌드(5.1)엔 text-bg-* 유틸리티가 없어 상품 배지가 배경 없이 렌더되던 문제도 같이 고침 */
.text-bg-primary {
  color: var(--burgundy-ink) !important;
  background-color: var(--burgundy) !important;
}

.text-bg-secondary {
  color: #fff !important;
  background-color: #6c757d !important;
}

.text-bg-danger {
  color: #fff !important;
  background-color: #dc3545 !important;
}

.text-bg-warning {
  color: #212529 !important;
  background-color: #ffc107 !important;
}

.page-link {
  color: var(--burgundy-dark);
}

.page-link:hover {
  color: var(--burgundy-active);
  background-color: var(--burgundy-light);
}

.page-link:focus {
  color: var(--burgundy-active);
  background-color: var(--burgundy-light);
  box-shadow: 0 0 0 .25rem rgba(140, 28, 63, .25);
}

.page-item.active .page-link {
  color: var(--burgundy-ink);
  background-color: var(--burgundy);
  border-color: var(--burgundy);
}

.dropdown-item.active, .dropdown-item:active {
  color: var(--burgundy-ink);
  background-color: var(--burgundy);
}

.form-check-input:checked {
  background-color: var(--burgundy);
  border-color: var(--burgundy);
}

/* ===== 검색창 ===== */
.search-form {
  max-width: 500px;
  width: 100%;
}

@media (min-width: 992px) {
  .search-form {
    transform: translateX(100px);
  }
}

.search-form .form-control:focus {
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(140, 28, 63, .15);
}

.search-form-icon {
  position: absolute;
  left: .5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 6px;
  pointer-events: none;
}

.search-form .search-submit-btn {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #98a2b3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-form .search-submit-btn:hover {
  color: var(--burgundy-dark);
  background: var(--burgundy-light);
}

/* 검색창 테두리 및 라운드 설정 (버건디 적용) */
.custom-search-input {
  border: 2px solid var(--burgundy) !important;
  border-radius: 10px !important;
  padding-left: 3rem !important;
}

.custom-search-input:focus {
  border-color: var(--burgundy) !important;
  box-shadow: 0 0 0 0.25rem rgba(140, 28, 63, 0.25) !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
}

@media (max-width: 991.98px) {
  .navbar-brand img {
    height: 48px !important;
  }
}

.navbar-nav .nav-link:hover {
  color: var(--burgundy-dark) !important;
}

/* ===== 상단 카테고리 바 (토글 버튼 + 드롭다운 패널) ===== */
.cat-topbar {
  position: relative;
  margin-bottom: 1.5rem;
}

.cat-topbar-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--burgundy);
  color: var(--burgundy-ink);
  border: none;
  border-radius: .5rem;
  padding: .7rem 1.25rem;
  font-weight: 700;
  font-size: .95rem;
}

.cat-topbar-toggle:hover {
  background: var(--burgundy-hover);
}

.cat-topbar-toggle .cat-topbar-chevron {
  margin-left: .25rem;
  transition: transform .15s ease;
}

.cat-topbar-toggle[aria-expanded="true"] .cat-topbar-chevron {
  transform: rotate(180deg);
}

.cat-topbar-panel {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  width: 320px;
  max-width: 90vw;
  background: #fff;
  border: 1px solid #eee;
  border-radius: .75rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
  padding: .5rem 0;
  z-index: 1030;
}

.cat-topbar-panel.show {
  display: block;
}

/* 카테고리 드롭다운 안의 호버 메가메뉴 (데스크톱 전용) */
.kurly-top-item {
  position: relative;
}

.kurly-top-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1rem;
  color: #212529;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}

.kurly-top-icon {
  color: #98a2b3;
  flex-shrink: 0;
}

.kurly-caret {
  color: #c9c9c9;
  flex-shrink: 0;
}

.kurly-top-item:hover > .kurly-top-link,
.kurly-top-item:focus-within > .kurly-top-link {
  background: var(--burgundy-light);
  color: var(--burgundy-active);
}

.kurly-top-item:hover > .kurly-top-link .kurly-top-icon,
.kurly-top-item:focus-within > .kurly-top-link .kurly-top-icon,
.kurly-top-item:hover > .kurly-top-link .kurly-caret,
.kurly-top-item:focus-within > .kurly-top-link .kurly-caret {
  color: var(--burgundy-active);
}

.kurly-panel {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-height: 100%;
  width: 640px;
  max-width: calc(100vw - 320px);
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0 .75rem .75rem 0;
  box-shadow: 12px 0 24px rgba(0, 0, 0, .08);
  padding: 1.5rem;
  z-index: 1030;
}

.kurly-top-item:hover .kurly-panel,
.kurly-top-item:focus-within .kurly-panel {
  display: block;
}

.kurly-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
}

.kurly-panel-col-title {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .5rem;
  color: var(--burgundy-active);
  text-decoration: none;
}

.kurly-panel-col ul li a {
  display: block;
  padding: .2rem 0;
  color: #495057;
  text-decoration: none;
  font-size: .85rem;
}

.kurly-panel-col ul li a:hover,
.kurly-panel-col-title:hover {
  color: var(--burgundy-active);
  text-decoration: underline;
}

/* ===== 카테고리 - 모바일: 좌측 대분류 탭 + 우측 하위 카테고리 전체화면 오버레이 ===== */
.kurly-mobile-cat {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: #fff;
  flex-direction: column;
}

.kurly-mobile-cat.show {
  display: flex;
}

.kurly-mobile-cat-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
}

.kurly-mobile-cat-title {
  font-weight: 700;
  font-size: 1.15rem;
}

.kurly-mobile-cat-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #212529;
}

.kurly-mobile-cat-body {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.kurly-mobile-tabs {
  flex: 0 0 auto;
  width: 34%;
  max-width: 160px;
  overflow-y: auto;
  background: #f5f5f7;
}

.kurly-mobile-tab-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #555;
  font-size: .85rem;
  font-weight: 500;
  padding: .9rem .75rem;
}

.kurly-mobile-tab-btn.active {
  background: #fff;
  color: #111;
  font-weight: 700;
  border-radius: .6rem .6rem .6rem .6rem;
  margin: 0 .35rem;
  width: calc(100% - .7rem);
}

.kurly-mobile-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: .5rem 1.1rem 1.5rem;
}

.kurly-mobile-panel {
  display: none;
}

.kurly-mobile-panel.active {
  display: block;
}

.kurly-mobile-viewall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0;
  margin-bottom: .25rem;
  border-bottom: 1px solid #f0f0f0;
  color: #111;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
}

.kurly-mobile-viewall-arrow {
  color: #98a2b3;
  font-size: 1.1rem;
}

.kurly-mobile-group {
  padding: .9rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.kurly-mobile-group-title {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: #212529;
  text-decoration: none;
  margin-bottom: .4rem;
}

.kurly-mobile-group-title:hover {
  color: var(--burgundy-active);
}

.kurly-mobile-leaf-list li a {
  display: block;
  padding: .35rem 0;
  color: #6c757d;
  text-decoration: none;
  font-size: .85rem;
}

.kurly-mobile-leaf-list li a:hover {
  color: var(--burgundy-active);
}

/* ===== 대분류 카테고리별 상품 가로열 ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-swiper-nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  z-index: 2;
}

.category-swiper-nav:hover {
  color: var(--burgundy-active);
}

.category-swiper-nav svg {
  display: block;
  width: 22px;
  height: 22px;
}

.category-swiper-prev {
  left: -26px;
}

.category-swiper-next {
  right: -26px;
}

.category-swiper-nav.swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.view-all-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 220px;
  text-decoration: none;
  color: #495057;
  background: #f8f9fa;
  border-radius: .75rem;
  gap: .5rem;
}

.view-all-slide:hover {
  color: var(--burgundy-active);
}

.view-all-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.view-all-slide:hover .view-all-arrow {
  border-color: var(--burgundy);
  color: var(--burgundy-active);
}

/* ===== 상품 카드 ===== */
a.card:hover {
  border-color: var(--burgundy);
  box-shadow: 0 .5rem 1rem rgba(140, 28, 63, .15) !important;
}

/* ===== 상품 목록 페이지 좌측 "세부검색" 선택 표시용 체크박스 ===== */
.filter-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-right: .6rem;
  border: 1.5px solid #adb5bd;
  border-radius: 3px;
  background: #fff;
}

.filter-checkbox.checked {
  background: var(--burgundy);
  border-color: var(--burgundy);
}

.filter-checkbox.checked::after {
  content: "";
  display: block;
  width: 4px;
  height: 8px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== 상품 목록 페이지 좌측 "세부검색" 카테고리 트리 ===== */
.category-filter-tree {
  font-size: 1rem;
}

.category-filter-tree li {
  margin-bottom: .5rem;
}

.category-filter-tree .category-filter-tree {
  margin: .5rem 0 .75rem 1rem;
  padding-left: 1rem;
  border-left: 1px solid #eee;
}

.category-filter-tree summary {
  cursor: pointer;
  list-style: none;
  padding: .3rem 0;
}

/* ===== 상품 상세 페이지 ===== */
.detail-thumb-strip {
  width: 72px;
  max-height: 480px;
  overflow-y: auto;
  flex: 0 0 auto;
}

.detail-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  cursor: pointer;
  opacity: .7;
}

.detail-thumb:hover {
  opacity: 1;
}

.detail-thumb.active {
  opacity: 1;
  border-color: var(--burgundy) !important;
  border-width: 2px !important;
}

.detail-zoom-badge {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  pointer-events: none;
}

.seller-mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--burgundy-light);
  font-size: .9rem;
}

.trade-info-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: .25rem;
}

.seller-card {
  background: #f8f9fa;
  border: 1px solid #eee;
}

.product-scroll-row {
  overflow-x: auto;
  padding-bottom: .5rem;
}

.product-scroll-item {
  flex: 0 0 auto;
  width: 220px;
}

.category-filter-tree summary::-webkit-details-marker {
  display: none;
}

.category-filter-tree summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: #98a2b3;
  transition: transform .15s ease;
}

.category-filter-tree details[open] > summary::before {
  transform: rotate(90deg);
}

/* ===== 상품 목록 가로형 리스트 행 ===== */
.product-list-row:last-child {
  border-bottom: none !important;
}

/* ===== 하단 회사정보 푸터 ===== */
.site-footer-links {
  background-color: #f8f6f5;
  border-bottom: 1px solid #eee;
}

@media (min-width: 992px) {
  .site-footer .border-start-lg {
    border-left: 1px solid #eee;
  }
}

/* ===== 다크 모드 토글 버튼 ===== */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #dee2e6;
  border-radius: 50%;
  background: transparent;
  color: #6c757d;
}

/* ===== 다크 모드: 헤더/푸터도 어둡게 ===== */
:root[data-theme="dark"] header .navbar.bg-white,
:root[data-theme="dark"] footer.site-footer.bg-white {
  background-color: #1c1a1a !important;
}

:root[data-theme="dark"] header .navbar.bg-white {
  border-bottom: 1px solid #3a3534;
}

:root[data-theme="dark"] .site-footer {
  border-top-color: #3a3534 !important;
}

:root[data-theme="dark"] .site-footer-links {
  background-color: #161414;
  border-bottom-color: #3a3534;
}

:root[data-theme="dark"] .site-footer .text-secondary,
:root[data-theme="dark"] header .navbar .text-secondary {
  color: #b9a79f !important;
}

:root[data-theme="dark"] .site-footer .text-dark {
  color: #f1e8e3 !important;
}

:root[data-theme="dark"] .site-footer .text-muted {
  color: #8d8178 !important;
}

:root[data-theme="dark"] .site-footer .badge.bg-light {
  background-color: #262323 !important;
  color: #b9a79f !important;
  border-color: #3a3534 !important;
}

@media (min-width: 992px) {
  :root[data-theme="dark"] .site-footer .border-start-lg {
    border-left-color: #3a3534 !important;
  }
}

:root[data-theme="dark"] .site-footer hr {
  border-color: #3a3534;
  opacity: 1;
}

:root[data-theme="dark"] header .navbar-toggler-icon {
  filter: invert(1) brightness(1.8);
}

:root[data-theme="dark"] .theme-toggle-btn {
  color: #b9a79f;
  border-color: #3a3534;
}

/* ===== CSS로 직접 그린 로고 (원본 wordmark.png 대신) — 라이트/다크 모드에 맞춰 글자색 자동 전환 ===== */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.site-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: .55rem;
  background: #f2990c;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.site-logo-text {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -.02em;
  color: var(--burgundy-text);
}

.site-logo-sm .site-logo-badge {
  width: 1.6rem;
  height: 1.6rem;
  font-size: .95rem;
  border-radius: .4rem;
}

.site-logo-sm .site-logo-text {
  font-size: 1.15rem;
}

.theme-toggle-btn:hover {
  color: var(--burgundy-dark);
  border-color: var(--burgundy);
}
