@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --color-bg: #F5F7F6;
  --color-surface: #FFFFFF;
  --color-text: #17262B;
  --color-text-muted: #55686C;
  --color-primary: #0F6B5C;
  --color-primary-dark: #0B4F44;
  --color-accent: #E8871E;
  --color-danger: #C0392B;
  --color-success: #1E8449;
  --color-border: #E2E8E6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 38, 43, 0.06), 0 4px 12px rgba(23, 38, 43, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  margin: 0 0 0.5em;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 18px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-header h1 {
  color: #fff;
  font-size: 1.5rem;
}
.site-header nav a {
  color: #EAF3F0;
  text-decoration: none;
  margin-left: 18px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover,
.site-header nav a:focus-visible {
  border-bottom-color: var(--color-accent);
}

main.container {
  padding-top: 36px;
  padding-bottom: 60px;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-border);
}
.product-card h3,
.product-card .description,
.product-card .price,
.product-card .stock {
  padding-left: 16px;
  padding-right: 16px;
}
.product-card h3 { margin-top: 14px; font-size: 1.1rem; }
.product-card .description {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  flex-grow: 1;
}
.product-card .price {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-accent);
  margin: 6px 0 0;
}
.product-card .stock {
  font-size: 0.85rem;
  margin: 4px 0 16px;
  font-weight: 500;
}
.stock.in-stock { color: var(--color-success); }
.stock.out-of-stock { color: var(--color-danger); }

.empty-state {
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

/* Admin */
.alert {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.alert-error {
  background: #FBEAE8;
  color: var(--color-danger);
  border: 1px solid #F1C7C1;
}
.alert-error ul { margin: 0; padding-left: 18px; }

.admin-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 32px;
  max-width: 480px;
}
.admin-form label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.admin-form input,
.admin-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font: inherit;
  color: var(--color-text);
}
.admin-form input:focus,
.admin-form textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.admin-form button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.admin-form button:hover { background: var(--color-primary-dark); }
.cancel-link {
  margin-left: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.94rem;
}
th {
  background: #EEF3F1;
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }
td a {
  margin-right: 12px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
td a:hover { text-decoration: underline; }

.site-footer {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: 20px 0 40px;
}
