/* Wholesale B2B Web App Stylesheet */
:root {
  --primary-blue: #0088cc;
  --primary-dark: #006699;
  --accent-cyan: #00c0f3;
  --bg-app: #f4f5f7;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-sub: #4b5563;
  --text-muted: #9ca3af;
  --border-light: #e5e7eb;
  --badge-red: #ff4757;
  --badge-blue: #2ed573;
  --badge-cyan: #1e90ff;
  --badge-gray: #747d8c;
  --price-red: #ff3838;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0d131f;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 10px;
}

/* Prototype Control Bar */
.proto-control-bar {
  width: 100%;
  max-width: 1100px;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: #fff;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 12px;
}

.proto-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.proto-badge {
  background: var(--primary-blue);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
}

.view-mode-toggles {
  display: flex;
  gap: 8px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.mode-btn:hover, .mode-btn.active {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

/* App Container Wrapper */
.app-viewport {
  width: 100%;
  max-width: 480px; /* Mobile First default */
  min-height: 840px;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: max-width 0.3s ease;
}

.app-viewport.desktop-mode {
  max-width: 1100px;
}

/* Top Utility Bar (레퍼런스 01 최상단) */
.top-utility-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-sub);
}

.utility-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.utility-links a {
  color: var(--text-sub);
  text-decoration: none;
  cursor: pointer;
}

.utility-links a:hover {
  color: var(--primary-blue);
}

/* B2B Policy Notice Bar */
.b2b-policy-banner {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.78rem;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.b2b-tag {
  background: #2563eb;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 6px;
}

/* Main Header */
.main-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #333;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.6rem;
  color: var(--primary-blue);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #1e293b;
}

.logo-text span {
  color: var(--accent-cyan);
}

.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #1e293b;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Search Bar (레퍼런스 01) */
.search-container {
  padding: 10px 16px;
  background: #fff;
}

.search-input-box {
  display: flex;
  align-items: center;
  border: 1.5px solid #1e293b;
  border-radius: 9999px;
  padding: 6px 14px;
  background: #fff;
}

.search-input-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: #333;
}

.search-input-box i {
  color: #333;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Main Content Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  padding-bottom: 70px;
}

/* Banner Slider */
.banner-slider {
  width: 100%;
  height: 240px;
  background: linear-gradient(rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.6)), url('../images/banner_uni.jpg') center/cover no-repeat;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}

.banner-content {
  text-align: center;
  padding: 20px;
  z-index: 2;
}

.banner-badge {
  display: inline-block;
  background: #facc15;
  color: #000;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.banner-title {
  font-size: 1.7rem;
  font-weight: 900;
  margin-bottom: 6px;
  line-height: 1.2;
}

.banner-sub {
  font-size: 0.95rem;
  opacity: 0.9;
}

.banner-indicator {
  position: absolute;
  bottom: 12px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Category Grid (레퍼런스 01) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 8px;
  padding: 20px 12px;
  background: #fff;
  border-bottom: 8px solid var(--bg-app);
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.cat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
  transition: all 0.2s;
  position: relative;
}

.cat-item:hover .cat-icon-wrap {
  background: #e0f2fe;
  transform: translateY(-2px);
}

.cat-badge {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--badge-red);
  color: #fff;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 10px;
  white-space: nowrap;
}

.cat-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
}

/* Breadcrumb & Subcategory Bar (레퍼런스 04) */
.breadcrumb-bar {
  padding: 10px 16px;
  background: #f8fafc;
  font-size: 0.8rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-subnav {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.back-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.subcategory-chips {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-light);
  scrollbar-width: none;
}
.subcategory-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.chip.active {
  background: #0f172a;
  color: #fff;
}

/* Product Sort & View Bar */
.filter-bar {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.sort-select {
  padding: 4px 8px;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  outline: none;
}

.view-icons {
  display: flex;
  gap: 6px;
  color: var(--text-muted);
}

.view-icons i {
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
}
.view-icons i.active { color: #1e293b; }

/* Product Grid (레퍼런스 04) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.desktop-mode .product-grid {
  grid-template-columns: repeat(4, 1fr);
}

.product-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}

.prod-img-box {
  width: 100%;
  aspect-ratio: 1/1;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prod-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prod-watermark {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.85);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-dark);
}

.prod-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.badge-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.prod-badge {
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.badge-new-stock { background: #059669; color: #fff; }
.badge-new-item { background: #0284c7; color: #fff; }
.badge-special { background: #dc2626; color: #fff; }

.prod-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-price-area {
  margin-top: auto;
}

.prod-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
}

.prod-subprice {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Product Detail View (레퍼런스 05) */
.detail-slider {
  width: 100%;
  aspect-ratio: 1/1;
  background: #f8fafc;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info-wrap {
  padding: 16px;
  border-bottom: 8px solid var(--bg-app);
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
}

.detail-origin-price {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.spec-table {
  width: 100%;
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.spec-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.spec-label {
  width: 90px;
  color: var(--text-sub);
}

.spec-val {
  flex: 1;
  color: #1f2937;
  font-weight: 500;
}

.detail-actions {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}

.detail-action-btn {
  flex: 1;
  padding: 12px;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #4b5563;
  cursor: pointer;
  border-right: 1px solid var(--border-light);
}
.detail-action-btn:last-child { border-right: none; }

/* Buy Bottom Sheet (레퍼런스 05_1) */
.buy-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 100;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desktop-mode .buy-bottom-sheet {
  max-width: 1100px;
}

.option-select-box {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #94a3b8;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  background: #fff;
}

.selected-option-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qty-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: #fff;
}

.qty-btn {
  padding: 4px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 700;
}

.qty-val {
  padding: 4px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.b2b-calc-info {
  font-size: 0.75rem;
  color: #0284c7;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.action-btn-row {
  display: flex;
  gap: 8px;
}

.btn-cart {
  flex: 1;
  padding: 14px;
  background: #fff;
  border: 1.5px solid #0f172a;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-buy {
  flex: 1;
  padding: 14px;
  background: #0f172a;
  border: 1.5px solid #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Side Drawer Menu (레퍼런스 02, 03) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
}

.drawer-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: #fff;
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer-overlay.active { display: block; }
.drawer-menu.active { transform: translateX(0); }

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-auth {
  display: flex;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}
.drawer-auth a { color: #111827; text-decoration: none; }

.drawer-quick-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px 8px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.quick-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #4b5563;
  cursor: pointer;
}
.quick-icon-btn i { font-size: 1.3rem; color: #1e293b; }

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}

.drawer-tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: #f1f5f9;
  font-weight: 700;
  font-size: 0.88rem;
  color: #64748b;
  cursor: pointer;
}
.drawer-tab-btn.active {
  background: #1e293b;
  color: #fff;
}

.accordion-list {
  list-style: none;
}

.acc-item {
  border-bottom: 1px solid #f1f5f9;
}

.acc-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.acc-body {
  padding: 8px 16px 12px 24px;
  background: #f8fafc;
  display: none;
}
.acc-item.open .acc-body { display: block; }
.acc-sublink {
  display: block;
  padding: 6px 0;
  font-size: 0.85rem;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
}

.drawer-section-title {
  background: #e2e8f0;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}

/* PC 와이드 대량 주문 시트 (전략 가이드 연계) */
.bulk-order-container {
  padding: 24px;
  background: #fff;
}

.bulk-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.bulk-table th, .bulk-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.bulk-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
}

.bulk-qty-input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: right;
}

/* Footer Navigation (모바일 전용 하단 탭바) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 40;
}

.desktop-mode .mobile-bottom-nav {
  max-width: 1100px;
}

.nav-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  color: #64748b;
  cursor: pointer;
  border: none;
  background: none;
}
.nav-tab-btn.active { color: #0284c7; }
.nav-tab-btn i { font-size: 1.15rem; }

/* Order Sheet Styles (레퍼런스 06_1 ~ 06_3) */
.order-sheet-wrap {
  background: #f8fafc;
  padding-bottom: 30px;
}

.order-section {
  background: #fff;
  margin-bottom: 10px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.order-sec-title {
  padding: 12px 16px;
  background: #f1f5f9;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid var(--border-light);
}

.order-item-card {
  padding: 16px;
  display: flex;
  gap: 14px;
}

.order-item-img {
  width: 76px;
  height: 76px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.order-item-detail {
  flex: 1;
}

.order-form-table {
  width: 100%;
  font-size: 0.88rem;
}

.order-form-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.order-form-row:last-child {
  border-bottom: none;
}

.order-label {
  width: 100px;
  color: #475569;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.order-label.req::before {
  content: '▪';
  color: #dc2626;
}

.order-input-col {
  flex: 1;
}

.order-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.88rem;
  outline: none;
  background: #fff;
}
.order-input:focus {
  border-color: #0284c7;
}

.btn-tab-group {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}

.btn-tab {
  flex: 1;
  padding: 10px;
  background: #fff;
  border: none;
  border-right: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}
.btn-tab:last-child { border-right: none; }
.btn-tab.active {
  background: #1e293b;
  color: #fff;
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px 16px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  color: #334155;
}

.btn-submit-order {
  width: 100%;
  padding: 16px;
  background: #0f172a;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}
.btn-submit-order:hover {
  background: #0284c7;
}

.order-complete-box {
  padding: 40px 20px;
  text-align: center;
  background: #fff;
}
