:root {
  --wood: #7c5c3e;
  --wood-dark: #4a3521;
  --cream: #f7f3ec;
  --charcoal: #262320;
  --muted: #6b6259;
  --line: #e4dccf;
  --accent: #b5713f;
  --white: #ffffff;
  --radius: 6px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--wood-dark);
  margin: 0 0 .5em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 100;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.logo {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: .5px;
  color: var(--wood-dark);
}
.logo span { color: var(--accent); }
nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}
nav a {
  font-size: .95rem;
  color: var(--charcoal);
  transition: color .2s;
}
nav a:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 780px) {
  nav ul {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  nav ul.open { display: flex; }
  nav li { padding: 14px 24px; border-top: 1px solid var(--line); }
  .nav-toggle { display: block; }
}

/* Hero */
.hero {
  position: relative;
  height: 62vh;
  min-height: 420px;
  background: linear-gradient(rgba(20,15,10,.35), rgba(20,15,10,.45)), var(--cream);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.hero-inner { color: var(--white); max-width: 640px; }
.hero h1 { color: var(--white); font-size: 2.6rem; margin-bottom: .3em; }
.hero p { font-size: 1.15rem; opacity: .95; }
.btn {
  display: inline-block;
  padding: 13px 28px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .95rem;
  letter-spacing: .3px;
  transition: background .2s;
}
.btn:hover { background: var(--wood-dark); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--white);
  color: var(--white);
}
.btn-outline:hover { background: var(--white); color: var(--wood-dark); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--wood);
  color: var(--wood-dark);
}
.btn-secondary:hover { background: var(--wood); color: var(--white); }
.btn-danger { background: #a33; }
.btn-danger:hover { background: #822; }

/* Section */
section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 2rem; }
.section-title p { color: var(--muted); }

/* Grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.card .thumb {
  aspect-ratio: 4/3;
  background: var(--cream);
  overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card .cat-tag {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.card .desc { color: var(--muted); font-size: .9rem; flex: 1; }
.card .price { margin-top: 10px; font-weight: 600; color: var(--wood-dark); }

/* Filters bar */
.filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius);
}
.filters input[type=text], .filters select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--white);
}
.filters input[type=text] { flex: 1; min-width: 200px; }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: .85rem;
  cursor: pointer;
  background: var(--white);
  transition: all .15s;
}
.chip.active { background: var(--wood-dark); color: var(--white); border-color: var(--wood-dark); }

/* Detail pages */
.detail-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  padding: 48px 0;
}
@media (max-width: 800px) { .detail-hero { grid-template-columns: 1fr; } }
.detail-gallery img.main {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img {
  width: 70px; height: 70px; object-fit: cover;
  border-radius: 4px; cursor: pointer; border: 2px solid transparent;
}
.thumbs img.active { border-color: var(--accent); }
.detail-info h1 { font-size: 2rem; }
.detail-info .meta { color: var(--muted); margin-bottom: 20px; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.spec-table td:first-child { color: var(--muted); width: 140px; }

/* Footer */
footer {
  background: var(--wood-dark);
  color: var(--cream);
  padding: 50px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
footer h4 { color: var(--white); font-family: Georgia, serif; font-size: 1rem; }
footer a { color: var(--cream); opacity: .85; }
footer a:hover { opacity: 1; text-decoration: underline; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 20px;
  font-size: .85rem;
  opacity: .7;
  text-align: center;
}

/* Blog */
.post-content { max-width: 760px; margin: 0 auto; padding: 40px 0; }
.post-content img { border-radius: var(--radius); margin: 20px 0; }
.post-content h2 { margin-top: 1.5em; }
.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
}
.pagination button.active { background: var(--wood-dark); color: var(--white); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--muted); }

/* Admin */
body.admin-body { background: var(--cream); }
.admin-header {
  background: var(--wood-dark);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-header .logo { color: var(--white); }
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar {
  width: 220px;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 24px 0;
}
.admin-sidebar a {
  display: block;
  padding: 12px 24px;
  color: var(--charcoal);
  font-size: .95rem;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--cream); color: var(--accent); border-left: 3px solid var(--accent); padding-left: 21px; }
.admin-main { flex: 1; padding: 32px; max-width: 900px; }
.admin-main h1 { font-size: 1.6rem; }

.login-box {
  max-width: 380px;
  margin: 100px auto;
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.login-box h1 { text-align: center; font-size: 1.5rem; }

form .field { margin-bottom: 18px; }
form label { display: block; font-size: .88rem; margin-bottom: 6px; color: var(--muted); }
form input[type=text], form input[type=password], form input[type=number], form input[type=date],
form textarea, form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: .95rem;
  font-family: inherit;
}
form textarea { resize: vertical; min-height: 100px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--white); }
table.admin-table th, table.admin-table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem;
}
table.admin-table th { background: var(--cream); font-weight: 600; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions button, .admin-actions a { font-size: .82rem; padding: 6px 12px; }

.thumb-upload {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.thumb-upload .item { position: relative; }
.thumb-upload img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.thumb-upload .remove {
  position: absolute; top: -6px; right: -6px;
  background: #a33; color: #fff; border: none; border-radius: 50%;
  width: 20px; height: 20px; cursor: pointer; font-size: 12px; line-height: 1;
}

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--wood-dark); color: var(--white);
  padding: 14px 22px; border-radius: 6px; z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.error { background: #a33; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .75rem;
}
.badge.published { background: #dff0d8; color: #3c763d; }
.badge.draft { background: #eee; color: #777; }
