:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-alt: #f2efe9;
  --text: #1c1917;
  --muted: #6b6560;
  --accent: #c84b31;
  --accent-hover: #a93b24;
  --border: #e6e0d8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 249, 247, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.search-wrap {
  flex: 1 1 260px;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--surface-alt);
}

.btn.active,
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover,
.btn.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Filter Bar */
.filter-bar {
  max-width: 1440px;
  margin: 18px auto 8px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

/* Masonry Grid */
.masonry {
  max-width: 1440px;
  margin: 16px auto 64px;
  padding: 0 24px;
  column-count: 4;
  column-gap: 18px;
}

@media (max-width: 1100px) {
  .masonry { column-count: 3; }
}

@media (max-width: 720px) {
  .masonry { column-count: 2; padding: 0 14px; column-gap: 12px; }
}

@media (max-width: 460px) {
  .masonry { column-count: 1; }
}

.pin {
  break-inside: avoid;
  margin-bottom: 18px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.pin img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.28s ease;
}

.pin:hover img {
  transform: scale(1.02);
}

.pin-overlay {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0) 42%,
    rgba(0, 0, 0, 0.62) 100%
  );
  opacity: 0;
  transition: opacity 0.18s ease;
}

.pin:hover .pin-overlay,
.pin:focus-within .pin-overlay {
  opacity: 1;
}

.pin-top {
  display: flex;
  justify-content: flex-end;
}

.save-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.save-btn.saved {
  background: var(--text);
}

.pin-meta {
  color: #ffffff;
}

.pin-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.pin-sub {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Empty State */
.empty-state {
  max-width: 520px;
  margin: 64px auto;
  text-align: center;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Modal & Lightbox */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 15, 0.68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.2rem;
  cursor: pointer;
}

.lightbox-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .lightbox-grid {
    grid-template-columns: 1fr;
  }
}

.lightbox-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-alt);
}

.spec-list {
  list-style: none;
  margin: 14px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.spec-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--surface-alt);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Admin Form */
.admin-wrap {
  max-width: 680px;
  margin: 32px auto 64px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
}

.status-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  display: none;
  font-size: 0.92rem;
}

.status-box.ok {
  display: block;
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-box.err {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
