* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f1e8;
  --paper: #fffaf2;
  --ink: #261d16;
  --muted: #766658;
  --accent: #8a4b2a;
  --accent-dark: #5d311d;
  --gold: #c79a45;
  --sold: #7b1e1e;
  --available: #22633f;
  --border: #dcc9ad;
  --shadow: 0 18px 45px rgba(47, 31, 20, 0.15);
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(199, 154, 69, 0.22), transparent 30%),
    linear-gradient(180deg, #f8f0e4 0%, #efe1cc 100%);
  color: var(--ink);
  min-height: 100vh;
}

.site-header {
  background:
    linear-gradient(rgba(38, 29, 22, 0.78), rgba(38, 29, 22, 0.72)),
    url("https://images.unsplash.com/photo-1519710164239-da123dc03ef4?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #fffaf2;
  padding-bottom: 5rem;
}

.site-header.compact {
  padding-bottom: 1.5rem;
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.25);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.brand p {
  margin: 0.2rem 0 0;
  color: #eadbc3;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-links a,
.button {
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 250, 242, 0.12);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.nav-links a.active,
.nav-links a:hover {
  background: var(--gold);
  color: #261d16;
}

.hero {
  max-width: 920px;
  margin: 4rem auto 0;
  padding: 0 1.2rem;
  text-align: center;
}

.hero h2 {
  font-size: clamp(2.3rem, 8vw, 5rem);
  line-height: 0.95;
  margin: 0 0 1rem;
}

.hero p {
  font-size: 1.25rem;
  color: #f1dfc4;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf2;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #fffaf2;
  color: var(--accent-dark);
}

.button.small {
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
}

main {
  max-width: 1180px;
  margin: -2.5rem auto 0;
  padding: 0 1.2rem 3rem;
}

.toolbar,
.panel {
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 1.5rem;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  align-items: end;
}

.section-toolbar {
  margin-top: 1.5rem;
  grid-template-columns: 1fr;
}

.toolbar h2,
.panel h2 {
  margin: 0;
  font-size: 2rem;
}

.toolbar p,
.panel p {
  color: var(--muted);
  margin: 0.3rem 0 0;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 170px 180px;
  gap: 0.75rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fffdf8;
  border-radius: 14px;
  padding: 0.85rem;
  font: inherit;
  color: var(--ink);
}

input[type="file"] {
  padding: 0.7rem;
  font-family: Arial, sans-serif;
}

.inventory-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(47, 31, 20, 0.1);
}

.photo-gallery {
  background: #eadbc3;
}

.card-image {
  height: 230px;
  background: #e1d1b8;
  display: block;
  width: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 0.35rem;
  padding: 0.45rem;
  background: rgba(255, 250, 242, 0.88);
  overflow: hidden;
}

.gallery-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #eadbc3;
}

.gallery-more {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-dark);
  color: #fffaf2;
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
}

.placeholder {
  height: 230px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(45deg, #eadbc3 25%, transparent 25%),
    linear-gradient(-45deg, #eadbc3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eadbc3 75%),
    linear-gradient(-45deg, transparent 75%, #eadbc3 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
}

.card-body {
  padding: 1rem;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.price {
  font-family: Arial, sans-serif;
  font-weight: 800;
  color: var(--accent-dark);
  white-space: nowrap;
}

.category {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  margin: 0.4rem 0;
}

.description {
  color: #4a3a2f;
  line-height: 1.45;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: white;
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
}

.badge.available {
  background: var(--available);
}

.badge.sold {
  background: var(--sold);
}

.empty {
  grid-column: 1 / -1;
  background: var(--paper);
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 3rem;
  text-align: center;
  color: var(--muted);
}

.admin-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.admin-layout main {
  margin-top: 0;
}

.panel label {
  display: block;
  margin-top: 1rem;
  font-family: Arial, sans-serif;
  font-weight: 700;
  color: var(--accent-dark);
}

.panel label input,
.panel label select,
.panel label textarea {
  margin-top: 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
}

.form-hint {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.preview-photo {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #eadbc3;
  aspect-ratio: 1 / 1;
}

.preview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.form-actions,
.backup-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.admin-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.admin-row {
  border: 1px solid var(--border);
  background: #fffdf8;
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.admin-thumb-wrap {
  position: relative;
  width: 90px;
  height: 70px;
}

.admin-thumb {
  width: 90px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  background: #eadbc3;
}

.photo-count {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-dark);
  color: #fffaf2;
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-row h3 {
  margin: 0;
}

.admin-meta {
  color: var(--muted);
  margin-top: 0.25rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger {
  border-color: #a83232;
  color: #a83232;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.login-gate {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 2rem 1.2rem;
}

.login-box {
  max-width: 420px;
  width: 100%;
}

.login-box h2 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
}

.login-error {
  color: var(--sold);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .toolbar,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-thumb-wrap,
  .admin-thumb {
    width: 100%;
    height: 160px;
  }

  .image-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}
