:root {
  --bg: #fffaf5;
  --ink: #1a1512;
  --muted: #5c534c;
  --brand: #8b4513;
  --brand-dark: #5c2e0c;
  --accent: #2d6a4f;
  --danger: #9b2226;
  --card: #ffffff;
  --line: #e8dfd4;
  --focus: #f4a261;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.125rem, 1rem + 0.5vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.15rem + 0.85vw, 1.75rem);
  --step-3: clamp(1.65rem, 1.35rem + 1.2vw, 2.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--focus);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 1000;
  font-weight: 700;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.site-header {
  background: var(--brand-dark);
  color: #fff;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}
.brand small {
  display: block;
  font-size: 0.65em;
  font-weight: 600;
  opacity: 0.9;
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.nav-main a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--step-1);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
}
.nav-main a:hover,
.nav-main a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.site-footer {
  background: #f0e8de;
  border-top: 2px solid var(--line);
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95em;
}

.flash-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
}
.flash {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  margin-bottom: 0.5rem;
  border: 2px solid transparent;
}
.flash.success {
  background: #d8f3dc;
  border-color: #40916c;
  color: #1b4332;
}
.flash.danger {
  background: #ffccd5;
  border-color: var(--danger);
  color: #590d22;
}
.flash.warning {
  background: #fff3bf;
  border-color: #fab005;
  color: #5c3b00;
}
.flash.info {
  background: #d0ebff;
  border-color: #339af0;
  color: #0b3d66;
}

.hero {
  text-align: center;
  padding: 2rem 0 1rem;
}
.hero h1 {
  font-size: var(--step-3);
  margin: 0 0 0.75rem;
  line-height: 1.2;
  color: var(--brand-dark);
}
.hero p {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 36rem;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.65rem 1.35rem;
  font-size: var(--step-1);
  font-weight: 800;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: #1b4332;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--brand);
}
.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border-color: var(--line);
}
.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.grid-2 {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 340px;
    align-items: start;
  }
}

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(44, 36, 30, 0.06);
}

.product-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  background: #eee;
  border: 2px solid var(--line);
}
.product-card h2 {
  font-size: var(--step-1);
  margin: 0;
  line-height: 1.25;
}
.price-tag {
  font-size: var(--step-2);
  font-weight: 900;
  color: var(--brand-dark);
}

.cart-box h2 {
  margin-top: 0;
  font-size: var(--step-2);
}
.cart-lines {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.cart-lines li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.cart-total {
  font-size: var(--step-2);
  font-weight: 900;
  margin: 0.75rem 0 1rem;
}
.qty-input {
  width: 4.5rem;
  font-size: var(--step-1);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 2px solid var(--line);
}

.form-stack label {
  display: block;
  font-weight: 800;
  margin: 1rem 0 0.35rem;
  font-size: var(--step-1);
}
.form-stack input,
.form-stack select,
.form-stack textarea {
  width: 100%;
  max-width: 32rem;
  font-size: var(--step-1);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 2px solid var(--line);
  font-family: inherit;
}
.form-stack .error {
  color: var(--danger);
  font-weight: 700;
  margin-top: 0.25rem;
}

.admin-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 960px) {
  .admin-layout {
    grid-template-columns: 260px 1fr;
  }
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-nav a {
  display: block;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: var(--step-1);
}
.admin-nav a:hover,
.admin-nav a[aria-current="page"] {
  border-color: var(--brand);
  background: #fff7ed;
}

.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
table.simple {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
table.simple th,
table.simple td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: var(--step-0);
}
table.simple th {
  background: #f4ede5;
  font-weight: 800;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stat {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: #fff;
}
.stat strong {
  display: block;
  font-size: var(--step-2);
  margin-top: 0.35rem;
}

.muted {
  color: var(--muted);
}

.stack-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
