:root {
  --bg: #fffaf4;
  --panel: #ffffff;
  --text: #222222;
  --muted: #6d6258;
  --border: #dfd5ca;
  --accent: #d94b7f;
  --accent-dark: #a92f5e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

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

html {
  scroll-behavior: smooth;
}

.site-header,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.mobile-cart-bar {
  display: none;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--border);
}

.logo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.intro,
.section-heading p,
.empty-cart,
.product-description,
.cart-item-meta {
  color: var(--muted);
}

.section-heading {
  padding: 28px 0 10px;
}

.section-heading h2,
.cart-panel h2,
.confirmation-panel h2 {
  margin-bottom: 4px;
  font-size: 1.65rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product-card,
.cart-panel,
.confirmation-panel {
  background: var(--panel);
  border: 1px solid var(--border);
}

.product-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 220px;
}

.product-image {
  width: 100%;
  height: 100%;
  min-height: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-right: 1px solid var(--border);
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.product-body h3 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.product-description {
  margin-bottom: auto;
  font-size: 0.95rem;
}

.price {
  font-weight: 700;
}

.product-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.product-actions label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.product-actions select {
  min-width: 72px;
  padding: 9px;
  border: 1px solid var(--border);
  background: #fff;
}

.add-button,
.primary-action,
.secondary-action {
  min-height: 44px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.add-button,
.primary-action {
  background: var(--accent);
  color: #fff;
}

.add-button {
  padding: 9px 12px;
}

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

.cart-panel,
.confirmation-panel {
  margin: 24px 0;
  padding: 18px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.cart-total {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item strong {
  display: block;
}

.cart-item button {
  min-height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.checkout-form {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--border);
  min-height: 44px;
  padding: 10px;
  background: #fff;
}

.form-grid textarea,
.primary-action {
  grid-column: 1 / -1;
}

.primary-action {
  width: 100%;
  margin-top: 16px;
}

.confirmation-recap {
  margin: 16px 0;
  padding: 14px;
  background: #fff7fb;
  border: 1px solid #efbfd1;
}

.confirmation-recap ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.secondary-action {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  padding: 9px 14px;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .site-header,
  main {
    width: min(100% - 24px, 680px);
  }

  .mobile-cart-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px;
    background: var(--text);
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  }

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

  .product-card {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .product-body {
    padding: 14px;
  }

  .cart-panel,
  .confirmation-panel {
    scroll-margin-top: 16px;
  }
}

@media (max-width: 560px) {
  .site-header,
  main {
    width: calc(100% - 20px);
  }

  .site-header {
    align-items: center;
    gap: 12px;
    padding: 16px 0 12px;
  }

  .logo {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
  }

  h1 {
    margin-bottom: 2px;
    font-size: 1.55rem;
  }

  .intro {
    margin-bottom: 0;
    font-size: 0.92rem;
  }

  .section-heading {
    padding: 18px 0 8px;
  }

  .section-heading h2,
  .cart-panel h2,
  .confirmation-panel h2 {
    font-size: 1.35rem;
  }

  .product-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .product-image {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 11;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .product-body {
    gap: 8px;
    padding: 12px;
  }

  .product-body h3 {
    font-size: 1.08rem;
  }

  .product-description {
    font-size: 0.92rem;
  }

  .price {
    margin-bottom: 0;
  }

  .product-actions {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: end;
    gap: 8px;
  }

  .product-actions select,
  .add-button {
    width: 100%;
  }

  .add-button {
    padding-inline: 10px;
  }

  .cart-panel,
  .confirmation-panel {
    margin: 18px 0;
    padding: 14px;
  }

  .cart-header {
    align-items: start;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .cart-total {
    font-size: 1.15rem;
  }

  .cart-item {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .cart-item button {
    width: 100%;
  }

  .checkout-form {
    padding-top: 14px;
  }

  .form-grid {
    gap: 12px;
  }

  .primary-action {
    min-height: 48px;
  }
}
