:root {
  --bg: #f3efe6;
  --bg-deep: #e6ddcc;
  --card: #fff8ee;
  --ink: #1f2a2e;
  --muted: #5c6b6d;
  --accent: #d9774a;
  --accent-2: #2f5d55;
  --accent-3: #f1c47a;
  --line: #d9cdbc;
  --shadow: 0 24px 60px rgba(31, 42, 46, 0.18);
  --radius: 22px;
  --font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(241, 196, 122, 0.25), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(47, 93, 85, 0.2), transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

img {
  width: 100%;
  display: block;
  border-radius: 16px;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 88px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 16px;
}

.header-spacer {
  flex: 1;
}

.header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: conic-gradient(from 140deg, var(--accent), var(--accent-3), var(--accent-2));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.search {
  flex: 1;
  display: flex;
  gap: 8px;
}

.search input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf8;
  font-size: 15px;
}

.search button {
  border: none;
  background: var(--accent-2);
  color: #fff;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.utility-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(47, 93, 85, 0.2);
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.78);
  color: var(--accent-2);
  font-size: 13px;
}

.nav-logout {
  margin: 0;
}

.nav-button {
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nav-button:hover {
  color: var(--accent-2);
}

.category-nav {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 24px rgba(31, 42, 46, 0.08);
}

.category-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--accent-2);
}

.category-nav a.is-active {
  color: var(--accent);
}

.breadcrumb {
  margin: 16px 0 28px;
  font-size: 14px;
  color: var(--muted);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 8px;
  color: var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 0.6s ease both;
}

.hero::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(217, 119, 74, 0.2), transparent 70%);
  right: -120px;
  top: -120px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 42px;
  margin: 0 0 12px;
}

.hero p {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 20px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
}

.hero-card {
  background: linear-gradient(135deg, rgba(47, 93, 85, 0.18), rgba(241, 196, 122, 0.35));
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(47, 93, 85, 0.3);
}

.hero-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 36px 0 18px;
}

.section-head h2 {
  font-family: var(--font-serif);
  margin: 0;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(31, 42, 46, 0.08);
  animation: fadeUp 0.6s ease both;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

.product-card h3 {
  margin: 0;
  font-size: 18px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-weight: 700;
  font-size: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(47, 93, 85, 0.12);
  color: var(--accent-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.muted-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.cart {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1200;
}

.cart-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(47, 93, 85, 0.25);
}

.cart-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: min(340px, calc(100vw - 40px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.cart:hover .cart-panel,
.cart-toggle:checked ~ .cart-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cart-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.cart-items {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

.cart-item input {
  width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.checkout {
  width: 100%;
  border: none;
  padding: 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.product-info h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  margin: 0 0 8px;
}

.product-info p {
  color: var(--muted);
  line-height: 1.6;
}

.product-info .price {
  font-size: 24px;
}

.product-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.product-specs {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.product-specs ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.related {
  margin-top: 40px;
}

.empty-state {
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.flash-banner {
  margin-top: 12px;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31, 42, 46, 0.08);
}

.flash-banner-success {
  background: rgba(47, 93, 85, 0.1);
  border-color: rgba(47, 93, 85, 0.32);
}

.flash-banner-error {
  background: rgba(217, 119, 74, 0.12);
  border-color: rgba(217, 119, 74, 0.36);
}

.flash-banner p {
  margin: 0;
}

.admin-message {
  margin-top: 24px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.admin-message-success {
  background: rgba(47, 93, 85, 0.1);
  border-color: rgba(47, 93, 85, 0.3);
}

.admin-message-error {
  background: rgba(217, 119, 74, 0.1);
  border-color: rgba(217, 119, 74, 0.35);
}

.admin-message p {
  margin: 0;
}

.admin-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.admin-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 24px;
}

.admin-card form {
  display: grid;
  gap: 10px;
}

.admin-card label {
  font-size: 14px;
  font-weight: 600;
}

.admin-card input,
.admin-card select,
.admin-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fffdf8;
}

.admin-card textarea {
  resize: vertical;
}

.auth-shell,
.message-shell {
  margin-top: 28px;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-card,
.message-card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h2,
.message-card h1 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
}

.auth-card form {
  display: grid;
  gap: 12px;
}

.auth-card label {
  font-size: 14px;
  font-weight: 600;
}

.auth-card input,
.auth-card textarea,
.auth-card select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffdf8;
  font: inherit;
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
}

.auth-note,
.message-card p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.message-shell {
  display: grid;
  place-items: center;
  min-height: 48vh;
}

.message-card .btn {
  margin-top: 20px;
}

.admin-table-wrap {
  margin-top: 30px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-table th {
  background: rgba(47, 93, 85, 0.08);
}

.admin-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}

.footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-tools {
    align-items: stretch;
  }

  .utility-nav {
    justify-content: center;
  }

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

  .product-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .category-nav {
    border-radius: 18px;
  }

  .category-nav ul {
    justify-content: center;
  }

  .cart {
    top: auto;
    bottom: 20px;
  }

  .cart-panel {
    top: auto;
    bottom: 80px;
  }

  .auth-card,
  .message-card {
    padding: 22px;
  }
}
