/* ===== base.css ===== */
/* Global reset + shared defaults */

:root {
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  --border: rgba(0, 0, 0, 0.10);
  --text: rgba(0, 0, 0, 0.88);
  --muted: rgba(0, 0, 0, 0.60);
  --bg: #fafafa;
  --card: #ffffff;

  --shadow-sm: 0 1px 10px rgba(0, 0, 0, 0.04);
}

html {
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  padding-top: 75px;
  /* Space for fixed header */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

main {
  flex: 1;
  width: 100%;
  /* Ensure it spans full width */
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  transition: opacity .15s ease, transform .05s ease, background-color .15s ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled,
button[disabled] {
  cursor: not-allowed !important;
  opacity: 0.55;
  filter: grayscale(15%);
  pointer-events: none;
}

/* Touch target (mobile) */
button,
.chip,
.home-icon {
  min-height: 44px;
}

/* Shared container */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px;
}

/* Mobile: padding + input font-size */
@media (max-width: 640px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  input {
    font-size: 16px;
  }
}

/* Header & Navigation */
/* Header & Navigation */
.topbar {
  display: flex;
  align-items: center;
  /* vertical centering */
  justify-content: space-between;
  height: 75px;
  /* increased height */
  background: #fff;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.topbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Hide back button when basket mode is active */
.basket-mode .topbar #backStepBtn {
  display: none;
}

.title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.topbar h2 {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  /* Brand Blue */
  margin: 0;
  flex: 1;
  text-align: center;
}

/* Icons */
.home-icon,
.menu-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #333;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.home-icon {
  left: 0;
}

.menu-icon {
  right: 0;
  z-index: 20;
  /* Ensure it stays on top */
}

/* Fix: SVG causing click issues */
.menu-icon svg {
  pointer-events: none;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Drawer */
.sidebar-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.sidebar-drawer.active {
  transform: translateX(0);
}

.sidebar-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: #2563eb;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  padding: 8px;
  margin-right: -8px;
  color: #666;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-group-label {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  padding: 0 20px;
  margin-bottom: 8px;
  margin-top: 16px;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.1s;
}

.nav-item:hover {
  background: #f5f9ff;
  color: #2563eb;
}

.nav-item svg {
  fill: currentColor;
  opacity: 0.7;
}

/* Site Footer */
.site-footer {
  background-color: #050505;
  color: #a1a1aa;
  padding: 30px 0 10px;
  margin-top: 40px;
  font-size: 14px;
  line-height: 1.6;
}

.site-footer .container {
  max-width: 1080px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 0.5fr 0.5fr;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-brand h2 {
  color: #2563eb;
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 10px;
}

.footer-brand p {
  color: #e4e4e7;
  max-width: 400px;
  font-size: 15px;
}

.footer-col h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-divider {
  border-top: 1px solid #27272a;
  margin: 15px 0;
}

.footer-legal-text p {
  margin: 6px 0;
  font-size: 13px;
  color: #71717a;
}

.footer-legal-text strong {
  color: #a1a1aa;
}

.footer-bottom {
  text-align: center;
  margin-top: 15px;
  font-size: 13px;
  color: #52525b;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Tooltip Z-Index Fix */
.jvm-tooltip {
  z-index: 9999 !important;
}