:root {
  color-scheme: light;
  --page-bg: #fff7ef;
  --page-bg-soft: #f4e8da;
  --panel: rgba(255, 250, 244, 0.92);
  --panel-strong: rgba(255, 245, 233, 0.98);
  --ink: #2e221f;
  --muted: #79635b;
  --berry: #ae465b;
  --berry-deep: #873145;
  --gold: #edbd63;
  --gold-deep: #d79a34;
  --leaf: #dbe7c1;
  --line: rgba(110, 67, 54, 0.14);
  --shadow: 0 18px 42px rgba(95, 50, 36, 0.12);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --page-width: 40rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at top right, rgba(237, 189, 99, 0.38), transparent 26%),
    radial-gradient(circle at left 18%, rgba(174, 70, 91, 0.16), transparent 24%),
    linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-soft) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

body::before {
  top: -4rem;
  right: -3rem;
  width: 13rem;
  height: 13rem;
  background: rgba(237, 189, 99, 0.18);
  filter: blur(6px);
}

body::after {
  bottom: -6rem;
  left: -4rem;
  width: 16rem;
  height: 16rem;
  background: rgba(219, 231, 193, 0.5);
  filter: blur(10px);
}

.page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: min(100% - 1rem, var(--page-width));
  margin: 0 auto;
  padding: 0.85rem 0 0.75rem;
}

.hero-bar,
.sales-panel,
.checkout-dock {
  backdrop-filter: blur(12px);
}

.hero-bar {
  flex: 0 0 auto;
  padding: 0.9rem 0.25rem 0.75rem;
}

.hero-bar h1 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #000;
}

.hero-accent {
  color: #4a4a4a;
  font-weight: 600;
  font-style: normal;
}

.hero-rest {
  color: #000;
  font-weight: 400;
  font-style: normal;
}

.app-layout {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  gap: 1rem;
}

.sales-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.item-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0.8rem;
}

.item-row {
  display: grid;
  flex: 1 1 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.95rem;
  align-items: center;
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 244, 231, 0.94));
  box-shadow: 0 14px 30px rgba(95, 50, 36, 0.08);
}

.item-row.has-count {
  background:
    linear-gradient(180deg, rgba(255, 251, 247, 0.98), rgba(255, 236, 214, 0.98));
}

.item-copy {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(219, 231, 193, 0.85), rgba(237, 189, 99, 0.82));
  font-size: 2.2rem;
}

.item-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.item-price {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.item-controls {
  display: grid;
  grid-template-columns: 3.25rem minmax(4rem, auto) 3.25rem;
  gap: 0.65rem;
  align-items: center;
  justify-content: end;
}

.step-button {
  width: 3.25rem;
  height: 3.25rem;
  border: 0;
  border-radius: 999px;
  color: white;
  font-size: 1.65rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(95, 50, 36, 0.14);
}

.step-button[data-action="decrement"] {
  background: linear-gradient(180deg, var(--berry), var(--berry-deep));
}

.step-button[data-action="increment"] {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #342116;
}

.step-button:disabled {
  opacity: 0.42;
  box-shadow: none;
  cursor: not-allowed;
}

.item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(46, 34, 31, 0.06);
  font-size: 1.15rem;
  font-weight: 800;
}

.checkout-dock {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 1rem), var(--page-width));
  margin: 0 auto 0.75rem;
  gap: 1rem;
  padding: 0.95rem;
  border-radius: var(--radius-xl);
  background: rgba(43, 28, 25, 0.92);
  color: #fff7ef;
  box-shadow: 0 26px 48px rgba(34, 18, 14, 0.3);
}

.dock-copy {
  display: grid;
  gap: 0.15rem;
}

.dock-label {
  margin: 0;
  color: rgba(255, 247, 239, 0.72);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.dock-total {
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1;
}

.reset-button {
  flex-shrink: 0;
  min-height: 3.4rem;
  padding: 0.9rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 232, 218, 0.96));
  color: var(--ink);
  font-weight: 800;
  font-size: 0.96rem;
}

.reset-button:disabled {
  opacity: 0.48;
}

.catalog-empty {
  margin: 0;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

button:focus-visible {
  outline: 3px solid rgba(237, 189, 99, 0.8);
  outline-offset: 3px;
}

button:active {
  transform: none;
}

.step-button[data-action="decrement"]:active {
  background: linear-gradient(180deg, #963c4f, #742738);
}

.step-button[data-action="increment"]:active {
  background: linear-gradient(180deg, #e0ad4c, #c98627);
  color: #2d1b11;
}

.reset-button:active {
  background: linear-gradient(180deg, rgba(247, 236, 223, 0.98), rgba(234, 219, 201, 0.98));
  color: #241917;
}

@media (prefers-reduced-motion: no-preference) {
  .item-row {
    animation: row-in 380ms ease backwards;
    animation-delay: var(--delay, 0ms);
    transition:
      box-shadow 180ms ease,
      background 180ms ease;
  }

  .item-row:hover {
    background:
      linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 240, 220, 0.96));
    box-shadow: 0 18px 34px rgba(95, 50, 36, 0.12);
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 32rem) {
  .item-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 31.99rem) {
  .page-shell {
    width: min(calc(100% - 0.75rem), var(--page-width));
    padding: 0.5rem 0 0.4rem;
  }

  .hero-bar {
    padding: 0.55rem 0.2rem 0.6rem;
  }

  .hero-bar h1 {
    font-size: clamp(1.55rem, 6vw, 2rem);
  }

  .sales-panel {
    padding: 0.7rem;
    border-radius: var(--radius-lg);
  }

  .item-list {
    gap: clamp(0.45rem, 0.75vh, 0.75rem);
  }

  .item-row {
    --mobile-icon-size: clamp(2.6rem, 5.2vh, 3.3rem);
    --mobile-control-size: clamp(2.45rem, 4.8vh, 3rem);
    flex: 1 1 0;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    padding: clamp(0.55rem, 1vh, 0.9rem) clamp(0.65rem, 2vw, 0.95rem);
    border-radius: var(--radius-md);
  }

  .item-copy {
    gap: 0.7rem;
  }

  .item-icon {
    width: var(--mobile-icon-size);
    height: var(--mobile-icon-size);
    border-radius: 16px;
    font-size: clamp(1.5rem, 2.8vh, 1.95rem);
  }

  .item-title {
    font-size: clamp(0.96rem, 1.85vh, 1.08rem);
    line-height: 1.15;
  }

  .item-price {
    margin: 0.22rem 0 0;
    font-size: clamp(0.82rem, 1.45vh, 0.94rem);
  }

  .item-controls {
    grid-template-columns:
      var(--mobile-control-size)
      minmax(var(--mobile-control-size), auto)
      var(--mobile-control-size);
    gap: 0.45rem;
  }

  .step-button {
    width: var(--mobile-control-size);
    height: var(--mobile-control-size);
    font-size: clamp(1.15rem, 2.2vh, 1.45rem);
    box-shadow: 0 10px 20px rgba(95, 50, 36, 0.12);
  }

  .item-count {
    min-height: var(--mobile-control-size);
    padding: 0 0.7rem;
    font-size: clamp(0.95rem, 1.9vh, 1.12rem);
  }

  .checkout-dock {
    width: min(calc(100% - 0.75rem), var(--page-width));
    margin: 0 auto 0.5rem;
    gap: 0.85rem;
    padding: 0.8rem 0.95rem;
    border-radius: var(--radius-lg);
  }

  .dock-label {
    font-size: 0.68rem;
  }

  .dock-total {
    font-size: clamp(1.35rem, 3.3vh, 1.8rem);
  }

  .reset-button {
    min-height: 3rem;
    padding: 0.8rem 1rem;
    font-size: 0.94rem;
  }
}

@media (min-width: 44rem) {
  .page-shell {
    width: min(100% - 2rem, var(--page-width));
    padding-top: 1.25rem;
  }

  .checkout-dock {
    width: min(calc(100% - 2rem), var(--page-width));
  }
}

@media (max-width: 24rem) {
  .page-shell,
  .checkout-dock {
    width: min(calc(100% - 0.5rem), var(--page-width));
  }

  .item-row {
    --mobile-icon-size: clamp(2.35rem, 4.7vh, 2.85rem);
    --mobile-control-size: clamp(2.2rem, 4.3vh, 2.6rem);
    gap: 0.55rem;
    padding: clamp(0.45rem, 0.9vh, 0.7rem) 0.55rem;
  }

  .item-copy {
    gap: 0.55rem;
  }

  .item-title {
    font-size: clamp(0.9rem, 1.6vh, 0.98rem);
  }

  .item-price {
    font-size: clamp(0.76rem, 1.2vh, 0.84rem);
  }

  .step-button,
  .item-count {
    min-height: var(--mobile-control-size);
    height: var(--mobile-control-size);
  }

  .reset-button {
    min-height: 2.75rem;
    padding-inline: 0.8rem;
  }
}
