/* Artifact platform tokens — auto-resolved */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ HEADER ============ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--neutral);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  place-items: center;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin: 0;
  letter-spacing: 0.1em;
  color: var(--text);
}

.brand-tag {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background: var(--primary-tint);
  color: var(--text);
}

.nav-tab.active {
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============ MAIN ============ */
.main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

h3 {
  margin: 0;
}

/* ============ SHOP ============ */
.hero {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}

.hero h2 {
  font-size: 2.4rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--neutral);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

.filter-chip.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-image {
  background: var(--primary-tint);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.product-emoji {
  font-size: 4rem;
}

.product-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.product-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
}

.product-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
}

.product-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.product-artisan {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-serif);
}

/* ============ BUTTONS ============ */
.btn {
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--neutral);
}

.btn-ghost:hover {
  background: var(--primary-tint);
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0.25rem 0;
  font-family: var(--font-sans);
}

.btn-link:hover {
  color: var(--danger);
}

/* ============ CART ============ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 760px) {
  .cart-layout { grid-template-columns: 1fr; }
}

.cart-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  align-items: center;
}

.cart-item-image {
  background: var(--primary-tint);
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.cart-item-info h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.cart-item-price {
  margin: 0.25rem 0 0;
  font-weight: 600;
}

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

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}

.qty-btn:hover {
  background: var(--primary-tint);
}

.qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.summary {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.summary h3 {
  font-family: var(--font-serif);
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  color: var(--text-muted);
}

.summary-row.total {
  border-top: 1px solid var(--neutral);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}

/* ============ EMPTY ============ */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty .btn {
  margin-top: 1rem;
}

/* ============ DIALOG ============ */
.dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 2rem;
  background: var(--surface);
  color: var(--text);
  max-width: 480px;
  width: 92%;
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: var(--scrim);
}

.dialog h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.dialog label {
  display: block;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dialog input,
.dialog textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-top: 0.25rem;
  border: 1px solid var(--neutral);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.dialog input:focus,
.dialog textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.dialog-total {
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--primary-tint);
  border-radius: var(--radius-md);
  text-align: center;
}

.dialog menu {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 0;
  margin: 1.5rem 0 0;
}

/* ============ ORDERS ============ */
.order-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.order-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.order-head h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-top: 0.25rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success);
  color: var(--bg);
}

.order-items {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--neutral);
}

.order-items li {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--neutral);
}

.order-items li:last-child {
  border-bottom: none;
}

.order-emoji {
  font-size: 1.5rem;
}

.order-sub {
  font-weight: 600;
}

.order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--neutral);
}

.order-total {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-serif);
}

/* ============ ABOUT ============ */
.about-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 0 2rem;
}

.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.value-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.value-card h3 {
  font-family: var(--font-serif);
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

.value-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.artisan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.artisan-card {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.artisan-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-serif);
  flex-shrink: 0;
}

.artisan-card h4 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
}

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--neutral);
  background: var(--surface);
}

.footer p { margin: 0; }
