:root {
  --ink: #161616;
  --muted: #6d7178;
  --line: #e8e3da;
  --paper: #fffaf1;
  --surface: #ffffff;
  --accent: #0f8f6d;
  --accent-dark: #086047;
  --warm: #f39b3d;
  --rose: #f05f5c;
  --shadow: 0 20px 60px rgba(22, 22, 22, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(243, 155, 61, 0.18), transparent 28rem),
    linear-gradient(135deg, #fffaf1 0%, #f8fbf7 52%, #fff 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  background: rgba(255, 250, 241, 0.84);
  border-bottom: 1px solid rgba(232, 227, 218, 0.8);
  backdrop-filter: blur(18px);
}

.brand,
.nav-actions,
.hero-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 0.75rem;
  font-weight: 800;
}

.brand small,
.cart-dock span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-actions a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.icon-button {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

main {
  padding: 0 clamp(1rem, 4vw, 3.5rem) 7rem;
}

.hero {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 4vw, 2.75rem);
}

.hero-copy {
  max-width: 58rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.75rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1.2rem;
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 40rem;
  color: #42464d;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1.05rem;
  border: 0;
  border-radius: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(15, 143, 109, 0.22);
}

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

.secondary-action {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.compact {
  min-height: 2.5rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
}

.catalog-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--line);
}

.catalog-toolbar h2,
.admin-header h2,
.empty-state h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}

.toolbar-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(9rem, 13rem);
  gap: 0.75rem;
}

label span {
  display: block;
  margin-bottom: 0.35rem;
  color: #343840;
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

input,
select {
  height: 2.75rem;
  padding: 0 0.85rem;
}

textarea {
  min-height: 5rem;
  padding: 0.8rem 0.85rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 143, 109, 0.8);
  box-shadow: 0 0 0 4px rgba(15, 143, 109, 0.12);
}

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

.product-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: 0 12px 30px rgba(22, 22, 22, 0.06);
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #ece7dd;
}

.product-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.product-category {
  width: max-content;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  color: var(--accent-dark);
  background: rgba(15, 143, 109, 0.1);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.product-body h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.product-body p {
  min-height: 2.8rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.price-grid span {
  padding: 0.7rem;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.price-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.price-grid strong {
  display: block;
  margin-top: 0.2rem;
}

.quantity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.quantity-row label {
  min-width: 0;
}

.quantity-row input {
  height: 2.55rem;
}

.empty-state {
  margin: 2rem auto;
  max-width: 32rem;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.cart-dock {
  position: fixed;
  right: clamp(1rem, 4vw, 3.5rem);
  bottom: 1rem;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 22, 0.48);
}

.admin-shell {
  position: absolute;
  inset: min(3vw, 1.5rem);
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--paper);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.modal.locked {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal.locked .modal-backdrop {
  background: rgba(22, 22, 22, 0.08);
}

.modal.locked .admin-shell {
  position: relative;
  inset: auto;
  width: min(28rem, 100%);
  overflow: visible;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

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

.admin-header[hidden] {
  display: none;
}

.login-card,
.settings-grid,
.product-form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.login-card {
  max-width: 28rem;
  margin: 0 auto;
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.login-heading .section-kicker {
  margin-bottom: 0.2rem;
}

.login-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  font-size: 1.3rem;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-help {
  line-height: 1.45;
}

.admin-content {
  display: grid;
  grid-template-columns: minmax(17rem, 0.85fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide,
.form-actions {
  grid-column: 1 / -1;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.toggle-line input {
  width: 1rem;
  height: 1rem;
}

.toggle-line span {
  margin: 0;
}

.admin-list {
  display: grid;
  gap: 0.75rem;
}

.admin-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.admin-item img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.65rem;
  background: #ece7dd;
}

.admin-item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}

.admin-item p {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mini-button {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.mini-button.danger {
  color: #9e2926;
}

@media (max-width: 780px) {
  .topbar {
    align-items: start;
  }

  .brand small {
    display: none;
  }

  .hero,
  .catalog-toolbar,
  .admin-content,
  .settings-grid,
  .product-form {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(3rem, 16vw, 5.6rem);
  }

  .catalog-toolbar {
    display: grid;
  }

  .toolbar-controls,
  .price-grid,
  .quantity-row {
    grid-template-columns: 1fr;
  }

  .cart-dock {
    left: 1rem;
    right: 1rem;
    justify-content: space-between;
  }
}
