:root {
  --cream: #fff8ec;
  --cream-deep: #fdeecb;
  --green-dark: #2e6b3e;
  --green: #3fa76a;
  --orange: #f5a425;
  --orange-deep: #ef7d1f;
  --fuchsia: #e14b90;
  --red: #c0392b;
  --ink: #35301f;
  --muted: #8a7f5f;
  --card-shadow: 0 6px 18px rgba(46, 70, 30, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  justify-content: center;
  padding: 28px 20px 8px;
}

.logo {
  width: 100%;
  max-width: 260px;
  height: auto;
}

main {
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 40px;
  width: 100%;
}

.intro {
  text-align: center;
  margin-bottom: 28px;
}

.intro h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--green-dark);
  margin: 0 0 8px;
}

.intro p {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
}

.loading {
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--cream-deep);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(46, 70, 30, 0.14);
}

.card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.dot-purple  { background: #7b4fa0; }
.dot-yellow  { background: #f6cf3c; }
.dot-green   { background: var(--green); }
.dot-red     { background: #d94b3a; }
.dot-brown   { background: #8a5a2e; }
.dot-orange  { background: var(--orange-deep); }
.dot-white   { background: #f1e7cf; border: 1px solid #ddceac; }
.dot-pink    { background: var(--fuchsia); }

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

.card .tag {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
}

.price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--orange-deep);
  margin: 0;
}

.unit {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 2px 0 0;
}

.site-footer {
  text-align: center;
  padding: 18px 20px 28px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Admin ---------- */

.admin-main {
  max-width: 760px;
}

.login-card {
  max-width: 340px;
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--cream-deep);
  text-align: center;
}

.login-card h1 {
  font-size: 1.3rem;
  color: var(--green-dark);
  margin: 0 0 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"] {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--cream-deep);
  background: var(--cream);
  color: var(--ink);
}

input:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--green);
  color: #fff;
  transition: filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn-danger {
  background: var(--red);
}

.btn-secondary {
  background: var(--orange-deep);
}

.error-msg {
  color: var(--red);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 6px;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-bar h1 {
  font-size: 1.4rem;
  color: var(--green-dark);
  margin: 0;
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.product-row {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--cream-deep);
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr 1.2fr auto auto;
  gap: 10px;
  align-items: end;
}

.product-row .field {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .product-row {
    grid-template-columns: 1fr 1fr;
  }
}

.add-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px dashed var(--green);
}

.add-card h2 {
  font-size: 1.1rem;
  color: var(--green-dark);
  margin: 0 0 14px;
}

.add-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr 1.2fr;
  gap: 10px;
  align-items: end;
}

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

.row-status {
  font-size: 0.8rem;
  color: var(--green);
  min-height: 1.1em;
}

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

.img-preview {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--cream-deep);
}

.btn-link {
  background: none;
  border: none;
  color: var(--orange-deep);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}
