
:root {
  --bg: #f7f3ee;
  --bg-2: #fffdf9;
  --panel: rgba(255,255,255,0.85);
  --card: #ffffff;
  --coffee: #533c2c;
  --coffee-2: #7a5a45;
  --sand: #d7c1a7;
  --sand-2: #eadfce;
  --terracotta: #d49a8a;
  --terracotta-2: #e7b5a7;
  --line: rgba(83,60,44,0.14);
  --line-strong: rgba(83,60,44,0.28);
  --shadow: 0 14px 38px rgba(83,60,44,0.10);
  --shadow-soft: 0 8px 24px rgba(83,60,44,0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --tap: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(212,154,138,0.12), transparent 30%),
    linear-gradient(180deg, #faf6f0 0%, #f5efe7 100%);
  color: var(--coffee);
  min-height: 100vh;
}
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.app-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 12px auto 120px;
}
.card, .card-soft, .mini-card, .summary-card, .total-box, .product-card, .cart-item {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.card {
  border-radius: var(--radius-xl);
  padding: 24px;
}
.card-soft {
  border-radius: var(--radius-lg);
  padding: 20px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--coffee-2);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(247,243,238,0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: sticky;
  top: 8px;
  z-index: 12;
}
.brand-wrap {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}
.brand-logo {
  width: 150px;
  flex: 0 0 auto;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
}
.subhead {
  margin: 8px 0 0;
  max-width: 700px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--coffee-2);
}
.event-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-content: flex-start;
}
.event-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(83,60,44,0.06);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}
.event-chip.strong {
  background: rgba(212,154,138,0.18);
}
.info-strip {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.mini-card {
  border-radius: 20px;
  padding: 16px 18px;
}
.mini-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.mini-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--coffee-2);
}
.layout-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(350px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.workspace { min-width: 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.section-head.compact { margin-bottom: 14px; }
.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}
.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.segmented-btn,
.toggle-btn,
.ghost-btn,
.primary-btn,
.danger-btn,
.close-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--coffee);
  min-height: 48px;
  padding: 0 16px;
  font-weight: 700;
}
.segmented-btn.active,
.toggle-btn.active {
  background: var(--coffee);
  color: white;
  border-color: transparent;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.product-card {
  position: relative;
  border-radius: 22px;
  padding: 16px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover, .product-card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card.active { border-color: rgba(83,60,44,0.35); background: rgba(255,255,255,0.92); }
.product-card img {
  width: 100%;
  height: 124px;
  object-fit: contain;
}
.product-card h3 { margin: 0; font-size: 20px; }
.product-card .product-line { margin: 0; font-size: 14px; color: var(--coffee-2); }
.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.price-label { font-size: 12px; color: var(--coffee-2); }
.price-value { font-size: 22px; font-weight: 800; }
.stock-ref {
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(212,154,138,0.18);
  font-size: 12px;
  font-weight: 700;
}
.calculator-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}
.product-preview {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 16px;
}
.product-preview-media {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(234,223,206,0.4), rgba(255,255,255,0.45));
  border-radius: 20px;
  min-height: 320px;
  padding: 18px;
}
.product-preview-media img {
  width: min(100%, 310px);
  max-height: 320px;
  object-fit: contain;
}
.product-preview-body h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
}
.muted {
  color: var(--coffee-2);
  line-height: 1.45;
}
.product-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}
.meta-pill, .mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(83,60,44,0.08);
  font-size: 13px;
  font-weight: 700;
}
.price-anchor {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.price-anchor span { font-size: 14px; color: var(--coffee-2); }
.price-anchor strong { font-size: 34px; }
.field-group { margin-bottom: 16px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stepper {
  display: grid;
  grid-template-columns: 56px minmax(78px, 1fr) 56px;
  gap: 8px;
}
.stepper button,
.stepper input {
  min-height: var(--tap);
  border-radius: 16px;
  border: 1px solid var(--line);
  text-align: center;
  font-size: 22px;
  background: white;
  color: var(--coffee);
}
.stepper input { font-weight: 800; }
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.extra-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: rgba(255,255,255,0.9);
}
.extra-card.disabled {
  opacity: 0.45;
  filter: grayscale(0.12);
}
.extra-card input { width: 22px; height: 22px; accent-color: var(--coffee); }
.extra-card strong { display: block; font-size: 16px; }
.extra-card small { color: var(--coffee-2); font-size: 13px; line-height: 1.35; }
.helper-text {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--coffee-2);
}
.totals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.total-box {
  border-radius: 18px;
  padding: 16px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.total-box span { color: var(--coffee-2); font-size: 14px; line-height: 1.35; }
.total-box strong { font-size: 28px; line-height: 1; }
.total-box.accent { background: linear-gradient(135deg, rgba(212,154,138,0.2), rgba(255,255,255,0.94)); }
.total-box.dark { background: var(--coffee); color: white; }
.total-box.dark span { color: rgba(255,255,255,0.8); }
.breakdown-details {
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: rgba(255,255,255,0.75);
}
.breakdown-details summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 0;
  font-weight: 700;
}
.breakdown-details summary::-webkit-details-marker { display: none; }
.breakdown-list {
  border-top: 1px solid var(--line);
  padding: 12px 0 6px;
  display: grid;
  gap: 8px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.breakdown-row strong { font-size: 16px; }
.breakdown-row.highlight strong { color: var(--coffee); font-size: 20px; }
.action-row,
.account-actions,
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.primary-btn {
  background: var(--coffee);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(83,60,44,0.18);
}
.primary-btn.small { min-height: 44px; }
.ghost-btn { background: rgba(255,255,255,0.92); }
.danger-btn {
  background: rgba(212,154,138,0.16);
  color: var(--coffee);
  width: 100%;
}
.account-panel {
  position: sticky;
  top: 124px;
  max-height: calc(100vh - 142px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.sticky-head { position: sticky; top: 0; background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); z-index: 1; padding-bottom: 8px; }
.secondary-actions { padding-top: 4px; }
.cart-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(212,154,138,0.18);
  font-size: 13px;
  font-weight: 700;
}
.account-summary {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}
.summary-card {
  border-radius: 18px;
  padding: 16px;
}
.summary-card span,
.summary-card small { color: var(--coffee-2); }
.summary-card strong { display: block; margin: 8px 0 6px; font-size: 34px; line-height: 1; }
.summary-primary { background: linear-gradient(135deg, rgba(83,60,44,0.96), rgba(83,60,44,0.9)); color: white; }
.summary-primary span,
.summary-primary small { color: rgba(255,255,255,0.78); }
.cart-list {
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 12px;
}
.empty-state {
  text-align: center;
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--coffee-2);
}
.cart-item {
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
}
.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: rgba(247,243,238,0.95);
  border-radius: 14px;
  padding: 6px;
}
.cart-item h4 { margin: 0 0 4px; font-size: 18px; }
.cart-item p { margin: 0; color: var(--coffee-2); font-size: 13px; }
.cart-saving-line { margin-top: 8px !important; color: var(--coffee) !important; }
.cart-item .item-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.item-tag {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(83,60,44,0.08);
}
.item-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.inline-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inline-stepper button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}
.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.item-actions button {
  min-height: 36px;
  border-radius: 12px;
  padding: 0 12px;
}
.footer-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(212,154,138,0.14);
  color: var(--coffee-2);
}
.footer-note p { margin: 0; font-size: 13px; line-height: 1.45; }
.danger-zone { padding-top: 4px; }
.modal {
  width: min(860px, calc(100% - 20px));
  border: 0;
  padding: 0;
  border-radius: 26px;
  background: transparent;
}
.modal::backdrop { background: rgba(31,22,16,0.5); backdrop-filter: blur(4px); }
.modal-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,243,238,0.98));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 30px; }
.close-btn {
  width: 48px;
  padding: 0;
  background: white;
}
.modal-body {
  padding: 20px 24px;
  max-height: 64vh;
  overflow: auto;
}
.modal-actions {
  padding: 0 24px 24px;
}
.breakdown-table {
  display: grid;
  gap: 14px;
}
.breakdown-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line);
}
.breakdown-item h3 { margin: 0 0 8px; font-size: 22px; }
.breakdown-item .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.breakdown-item .row strong { font-size: 15px; }
.total-hero {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.total-hero .row strong { font-size: 22px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(24px);
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--coffee);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mobile-cart-bar {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mobile-cart-bar span { display: block; font-size: 12px; color: var(--coffee-2); }
.mobile-cart-bar strong { font-size: 24px; }

@media (max-width: 1200px) {
  .layout-grid { grid-template-columns: 1fr; }
  .account-panel {
    position: static;
    max-height: none;
  }
}
@media (max-width: 940px) {
  .topbar { position: static; padding: 18px; }
  .brand-wrap { flex-direction: column; align-items: flex-start; }
  .brand-logo { width: 128px; }
  .info-strip, .calculator-grid, .field-row, .totals-grid, .account-summary { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .app-shell { width: min(100% - 16px, 100%); margin-bottom: 110px; }
  .card, .card-soft, .mini-card { padding: 18px; }
  .section-head { align-items: flex-start; }
  .section-head h2, .section-head h3 { font-size: 24px; }
  .product-grid { grid-template-columns: 1fr; }
  .toggle-group { grid-template-columns: 1fr; }
  .extras-grid { grid-template-columns: 1fr; }
  .product-preview-body h3 { font-size: 28px; }
  .price-anchor strong { font-size: 28px; }
  .mobile-cart-bar { display: flex; }
}


.breakdown-hero {
  margin-bottom: 18px;
}
.hero-kicker {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coffee-2);
}
.breakdown-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}
.breakdown-stat {
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow-soft);
}
.breakdown-stat.primary {
  background: linear-gradient(135deg, rgba(83,60,44,0.96), rgba(83,60,44,0.88));
  color: #fff;
}
.breakdown-stat.primary span,
.breakdown-stat.primary small {
  color: rgba(255,255,255,0.78);
}
.breakdown-stat.secondary {
  background: linear-gradient(135deg, rgba(212,154,138,0.18), rgba(255,255,255,0.92));
}
.breakdown-stat span,
.breakdown-stat small {
  display: block;
  color: var(--coffee-2);
}
.breakdown-stat strong {
  display: block;
  margin: 8px 0 10px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1;
}
.breakdown-table.rich {
  gap: 16px;
}
.rich-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}
.breakdown-media-wrap {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(234,223,206,0.45), rgba(255,255,255,0.96));
  padding: 12px;
  min-height: 140px;
  display: grid;
  place-items: center;
}
.breakdown-media {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}
.breakdown-content {
  min-width: 0;
}
.breakdown-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.item-index {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coffee-2);
}
.breakdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.price-hero {
  min-width: 164px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(212,154,138,0.16), rgba(255,255,255,0.96));
  border: 1px solid var(--line);
  text-align: right;
}
.price-hero span,
.price-hero small {
  display: block;
  color: var(--coffee-2);
}
.price-hero strong {
  display: block;
  margin: 8px 0 6px;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1;
  color: var(--coffee);
}
.breakdown-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.metric-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(255,255,255,0.86);
}
.metric-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--coffee-2);
}
.metric-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.05;
}
.metric-card.accent {
  background: linear-gradient(135deg, rgba(212,154,138,0.2), rgba(255,255,255,0.96));
}
.metric-card.dark {
  background: var(--coffee);
  color: #fff;
}
.metric-card.dark span { color: rgba(255,255,255,0.78); }
.breakdown-rows {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.rich-total {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(247,243,238,0.98));
}
.rich-total .row strong {
  font-size: 24px;
}
@media (max-width: 860px) {
  .breakdown-hero-grid,
  .breakdown-metrics,
  .rich-card {
    grid-template-columns: 1fr;
  }
  .breakdown-header {
    flex-direction: column;
  }
  .price-hero {
    width: 100%;
    text-align: left;
  }
}
