/* Culture Warehouse - shared styles */
:root {
  --navy: #143a52;
  --navy-dark: #0e2a3c;
  --accent: #c8842a;
  --accent-dark: #a96c1d;
  --bg: #f7f6f3;
  --card: #ffffff;
  --text: #21262b;
  --muted: #6b757c;
  --line: #e3e1db;
  --green: #2f8f5b;
  --red: #b23b3b;
  --shadow: 0 2px 10px rgba(20,58,82,.07);
  --shadow-lg: 0 8px 28px rgba(20,58,82,.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--navy); }

img { max-width: 100%; display: block; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.nav {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.brand-logo {
  height: 44px;
  width: 44px;
  border-radius: 8px;
  display: block;
  flex: none;
}
.brand .logo {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: .5px;
}
.brand .tag {
  font-size: .72rem;
  color: #b9cdd9;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-links a {
  color: #dfeaf0;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: .95rem;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-links a.active { background: var(--accent); color: #fff; }

/* ---------- Layout ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px;
}
.section-title {
  font-size: 1.8rem;
  margin: 0 0 6px;
  color: var(--navy);
}
.section-sub {
  color: var(--muted);
  margin: 0 0 28px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 70px 24px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 16px;
  line-height: 1.15;
}
.hero p {
  font-size: 1.1rem;
  color: #cfdde6;
  margin: 0 0 28px;
}
.hero-art {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 30px;
  text-align: center;
}
.hero-art .big { font-size: 4rem; }
.hero-art .hero-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.hero-art .label { color: #cfdde6; margin-top: 12px; letter-spacing: 1px; }

/* ---------- Full-width banner ---------- */
.banner { width: 100%; line-height: 0; }
.banner img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
@media (max-width: 860px) {
  .banner img { height: 240px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled], .btn.disabled {
  background: #b9bcc0; cursor: not-allowed; pointer-events: none;
}

/* ---------- Feature row ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.feature h3 { margin: 0 0 6px; color: var(--navy); }
.feature p { margin: 0; color: var(--muted); }

/* ---------- Product grid ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}
.toolbar input, .toolbar select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .95rem;
  background: #fff;
}
.toolbar input { flex: 1; min-width: 200px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-img {
  height: 180px;
  background: linear-gradient(135deg, #e9eef1, #d8e1e7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  position: relative;
  overflow: hidden;
}
/* Product photo fills the frame; sits above the emoji placeholder.
   If the image file is missing, onerror removes it and the emoji shows. */
.card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  background: var(--green);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}
.badge.sold { background: var(--red); }
.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card .cat {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
}
.card h3 { margin: 6px 0 4px; font-size: 1.1rem; color: var(--navy); }
.card .cond { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.card .price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 14px;
}
.card .price.sold-price { color: var(--muted); text-decoration: line-through; }
.card .spacer { flex: 1; }
.card .actions { display: flex; gap: 8px; }
.card .actions .btn { flex: 1; padding: 10px; font-size: .92rem; }

/* ---------- Forms ---------- */
.form-wrap {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 32px;
}
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .92rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .98rem;
  font-family: inherit;
  background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-card {
  background: var(--navy);
  color: #dfeaf0;
  border-radius: 12px;
  padding: 28px;
  height: fit-content;
}
.info-card h3 { color: #fff; margin-top: 0; }
.info-card a { color: #ffd9a0; }
.info-card ul { padding-left: 18px; margin: 12px 0; }
.info-card li { margin-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-dark);
  color: #b9cdd9;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-inner a { color: #dfeaf0; text-decoration: none; }
.footer-inner a:hover { color: #fff; }
.footer-col h4 { color: #fff; margin: 0 0 10px; font-size: 1rem; }
.footer-col p, .footer-col a { display: block; font-size: .9rem; margin-bottom: 6px; }
.copyright {
  text-align: center;
  padding: 16px;
  font-size: .82rem;
  color: #7f97a6;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .form-wrap { grid-template-columns: 1fr; }
  .features, .grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
}
@media (max-width: 560px) {
  .features, .grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .nav { justify-content: center; }
}

/* ---------- Category browse ---------- */
.browse-section { margin-bottom: 38px; }
.family-title {
  font-size: 1.25rem;
  color: var(--navy);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.cat-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.cat-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.cat-thumb {
  height: 180px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  position: relative;
  overflow: hidden;
}
.cat-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  box-sizing: border-box;
}
.cat-meta { padding: 12px 14px; }
.cat-name { font-weight: 700; color: var(--navy); font-size: 1.3rem; line-height: 1.2; }
.cat-count { font-size: .95rem; font-weight: 700; color: var(--accent); margin-top: 4px; }
.cat-count.empty { color: var(--muted); font-weight: 600; }
.back-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--navy);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
}
.back-btn:hover { background: #eef2f4; }
.view-cat-title { font-size: 1.6rem; color: var(--navy); margin: 0 0 18px; }
.empty-state {
  text-align: center;
  padding: 50px 24px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.empty-state a { color: var(--accent); font-weight: 600; }
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
