:root {
  --ink: #1a2421;
  --muted: #5c6b66;
  --paper: #f3f6f4;
  --card: #ffffff;
  --line: #d5e0db;
  --accent: #0f6b4c;
  --accent-2: #c45c26;
  --accent-soft: #e7f3ee;
  --danger: #b42318;
  --ok: #0f6b4c;
  --shadow: 0 10px 30px rgba(26, 36, 33, 0.08);
  --radius: 14px;
  --font-display: "Outfit", "Noto Sans KR", sans-serif;
  --font-body: "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #d8efe5 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #f7e6d8 0%, transparent 50%),
    var(--paper);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(243, 246, 244, 0.9);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 1rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.35rem;
  color: var(--ink); letter-spacing: -0.02em;
  text-decoration: none;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.85rem 1.1rem; align-items: center; }
.site-nav a { color: var(--ink); font-weight: 500; text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover { color: var(--accent); }
.btn-nav {
  background: var(--accent); color: #fff !important;
  padding: 0.4rem 0.85rem; border-radius: 999px;
}
.btn-nav:hover { filter: brightness(1.05); text-decoration: none !important; }
.nav-toggle {
  display: none; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 0.35rem 0.6rem; font-size: 1.1rem; cursor: pointer;
}

.site-main { flex: 1; padding: 1.5rem 0 3rem; }
.site-footer {
  border-top: 1px solid var(--line);
  background: #e8eeeb;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 0;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700; color: var(--ink); margin: 0 0 0.35rem;
}
.footer-html p {
  margin: 0.25rem 0;
  line-height: 1.45;
}
.footer-html p:first-child { margin-top: 0; }
.footer-html p:last-child { margin-bottom: 0; }
.footer-html > *:first-child { margin-top: 0; }
.footer-html > *:last-child { margin-bottom: 0; }

.flash {
  margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 10px;
  font-size: 0.95rem;
}
.flash-ok, .flash-success { background: var(--accent-soft); color: var(--ok); }
.flash-error { background: #fdecea; color: var(--danger); }

.hero {
  position: relative;
  border-radius: 0;
  margin: -1.5rem 0 2rem;
  min-height: min(68vh, 520px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 40, 32, 0.15) 0%, rgba(15, 40, 32, 0.72) 100%),
    linear-gradient(120deg, #0f6b4c 0%, #1a3d32 45%, #c45c26 120%);
  color: #fff;
}
.hero-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 2.5rem;
  animation: rise 0.7s ease both;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero p { margin: 0 0 1.25rem; opacity: 0.92; max-width: 36ch; }
.hero .cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem;
  border: none; border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #fff; color: var(--ink); }
.btn-accent { background: var(--accent-2); color: #fff; }
.btn-outline {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.55);
}
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.btn-solid { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.45rem; margin: 0 0 0.35rem;
}
.section-desc { color: var(--muted); margin: 0 0 1.25rem; }

.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.goods-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  animation: rise 0.55s ease both;
}
.goods-card:hover { transform: translateY(-3px); }
.goods-card a { color: inherit; text-decoration: none; }
.goods-thumb {
  aspect-ratio: 1;
  background: #e8eeeb;
  overflow: hidden;
}
.goods-thumb img { width: 100%; height: 100%; object-fit: cover; }
.goods-body { padding: 0.9rem 1rem 1.1rem; }
.goods-body h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.price { font-weight: 700; color: var(--accent); }

.page-head { margin-bottom: 1.5rem; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: 1.75rem; margin: 0 0 0.25rem;
}

.form-box, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  max-width: 520px;
}
.form-box.wide, .panel.wide { max-width: none; }

.form-row { margin-bottom: 0.9rem; }
.form-row label {
  display: block; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 0.3rem;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 0.65rem 0.75rem;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff;
}
.form-row textarea { min-height: 120px; resize: vertical; }
.radio-row {
  display: flex; flex-wrap: wrap; gap: 0.85rem 1.25rem;
  align-items: center; min-height: 2.5rem;
}
.radio-label {
  display: inline-flex !important; align-items: center; gap: 0.4rem;
  margin: 0 !important; font-weight: 500 !important; cursor: pointer;
}
.radio-label input { width: auto; margin: 0; }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line);
  text-align: left; font-size: 0.92rem; vertical-align: middle;
}
table.data th { background: #eef4f1; font-weight: 600; }
table.data tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.badge-warn { background: #fff1e6; color: var(--accent-2); }
.badge-mute { background: #eee; color: #666; }

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.admin-side {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem;
  position: sticky; top: 80px;
}
.admin-side a {
  display: block; padding: 0.45rem 0.5rem; color: var(--ink);
  border-radius: 8px; text-decoration: none; font-weight: 500;
}
.admin-side a:hover, .admin-side a.active {
  background: var(--accent-soft); color: var(--accent); text-decoration: none;
}
.admin-side h2 {
  font-family: var(--font-display);
  font-size: 1.1rem; margin: 0 0 0.75rem;
}

.pager { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 1.25rem; }
.pager a, .pager span {
  padding: 0.35rem 0.65rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none;
}
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); }

.detail-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}
.detail-img {
  border-radius: var(--radius); overflow: hidden;
  background: #e8eeeb; aspect-ratio: 1;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }

.cate-tree { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cate-tree-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line);
}
.cate-tree-row:last-child { border-bottom: none; }
.cate-tree-name { font-weight: 600; flex: 1; min-width: 8rem; }
.cate-tree-actions { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }

.shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.shop-cate {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 0.5rem; position: sticky; top: 80px;
}
.shop-cate-title {
  font-family: var(--font-display); font-size: 1.05rem;
  margin: 0 0.5rem 0.65rem;
}
.shop-cate-link {
  display: block; padding: 0.35rem 0.5rem; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 0.92rem;
}
.shop-cate-link:hover, .shop-cate-link.active {
  background: var(--accent-soft); color: var(--accent); text-decoration: none;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.editor-html img { max-width: 100%; height: auto; }
.editor-html table { max-width: 100%; border-collapse: collapse; }
.goods-detail-html { line-height: 1.7; }

.shop-popup-layer {
  display: flex; flex-direction: column;
  border-radius: 8px; overflow: hidden;
}
.shop-popup-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; padding: 0.55rem 0.75rem;
  background: #eef4f1; border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.shop-popup-close {
  border: 0; background: transparent; font-size: 1.35rem;
  line-height: 1; cursor: pointer; color: var(--muted); padding: 0 0.25rem;
}
.shop-popup-body { flex: 1; overflow: auto; padding: 0.75rem; }
.shop-popup-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; flex-wrap: wrap; padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--line); background: var(--paper); font-size: 0.85rem;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch;
    background: #f3f6f4; border-bottom: 1px solid var(--line);
    padding: 0.75rem 1rem 1rem; gap: 0.5rem;
  }
  .site-nav.open { display: flex; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-cate { position: static; display: flex; flex-wrap: wrap; gap: 0.15rem; }
  .shop-cate-title { width: 100%; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .shop-popup-layer {
    left: 0.75rem !important; right: 0.75rem !important; width: auto !important;
    transform: none !important; max-height: 70vh;
  }
}
