@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Barlow+Condensed:wght@400;600&display=swap');

:root {
  --color-forest-stage: #0d542b;
  --color-lime-sprout: #b9ff78;
  --color-ember-coral: #f54320;
  --color-coral-whisper: #ffe3e3;
  --color-cream-paper: #fcf7ed;
  --color-true-black: #000000;
  --color-midnight-ink: #1c1917;
  --color-stone: #44403b;
  --color-slate: #292524;
  --color-ash: #d6d3d1;
  --color-fog: #e5e7eb;
  --color-pure-white: #ffffff;
  --color-moss: #008236;
  --color-placeholder: #6b6560;

  --font-display: 'Nunito', system-ui, sans-serif;
  --font-ui: 'Nunito', system-ui, sans-serif;
  --font-condensed: 'Barlow Condensed', 'Nunito', sans-serif;

  --text-caption: 10px;
  --text-body-sm: 14px;
  --text-body: 16px;
  --text-subheading: 20px;
  --text-heading-sm: 24px;
  --text-heading: 30px;
  --text-heading-lg: 38px;

  --spacing-8: 8px;
  --spacing-16: 16px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-40: 40px;
  --spacing-48: 48px;
  --spacing-64: 64px;

  --radius-cards: 8px;
  --radius-pills: 9999px;
  --radius-buttons: 8px;
  --radius-frames: 24px;

  --app-max: 430px;
  --nav-h: 64px;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  font-feature-settings: 'cv11';
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse at top, rgba(13, 84, 43, 0.12), transparent 55%),
    linear-gradient(180deg, #e8efe4 0%, var(--color-cream-paper) 28%, var(--color-cream-paper) 100%);
  color: var(--color-stone);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.5;
  letter-spacing: -0.007em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  width: 100%;
  max-width: var(--app-max);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  background: var(--color-cream-paper);
  position: relative;
  box-shadow: 0 0 0 1px rgba(28, 25, 23, 0.06), 0 24px 64px rgba(13, 84, 43, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) var(--spacing-16) 0;
  background: var(--color-forest-stage);
  background-image: radial-gradient(circle at 20% 20%, #008236 0%, transparent 50%),
    radial-gradient(circle at 90% 0%, rgba(185, 255, 120, 0.18), transparent 40%);
  color: var(--color-pure-white);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  color: var(--color-lime-sprout);
  letter-spacing: -0.03em;
  flex: 1;
  min-width: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-buttons);
  background: transparent;
  color: var(--color-pure-white);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn:active {
  transform: scale(0.94);
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pills);
  background: var(--color-lime-sprout);
  color: var(--color-midnight-ink);
  font-size: 10px;
  font-weight: 700;
  display: none;
  place-items: center;
  line-height: 1;
}

.badge.show {
  display: grid;
}

.search-bar {
  padding: 0 var(--spacing-16) var(--spacing-16);
}

.search-bar input {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius-buttons);
  padding: 0 var(--spacing-16);
  background: rgba(252, 247, 237, 0.95);
  color: var(--color-midnight-ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-bar input::placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

.search-bar input::-webkit-input-placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

.search-bar input::-moz-placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

/* Main */
.main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--spacing-24);
  scroll-behavior: smooth;
}

.view {
  display: none;
  animation: fadeUp 0.28s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.hero {
  margin: var(--spacing-16);
  padding: var(--spacing-24);
  border-radius: var(--radius-frames);
  background: var(--color-forest-stage);
  color: var(--color-cream-paper);
}

.eyebrow {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-lime-sprout);
  display: inline-block;
  position: relative;
  margin-bottom: var(--spacing-8);
}

.eyebrow::after {
  content: '';
  display: block;
  width: 60%;
  height: 2px;
  margin-top: 4px;
  background: var(--color-ember-coral);
  border-radius: 2px;
  clip-path: polygon(0 40%, 8% 100%, 18% 0, 28% 100%, 38% 20%, 48% 100%, 58% 0, 68% 90%, 78% 30%, 88% 100%, 100% 40%);
}

.hero h1 {
  margin: 0 0 var(--spacing-8);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-lime-sprout);
}

.hero p {
  margin: 0 0 var(--spacing-16);
  max-width: 34ch;
  color: rgba(252, 247, 237, 0.85);
  font-size: var(--text-body-sm);
  line-height: 1.45;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--spacing-8);
}

.hero-actions .btn-primary {
  flex: 1;
}

.perks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-8);
  margin: 0 var(--spacing-16);
}

.perk {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius-cards);
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
  border-left: 4px solid var(--color-ember-coral);
}

.perk strong {
  font-size: 16px;
  color: var(--color-midnight-ink);
}

.perk span {
  font-size: 13px;
  line-height: 1.3;
  color: var(--color-stone);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: var(--radius-buttons);
  border: 1.5px solid transparent;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-lime-sprout);
  color: var(--color-midnight-ink);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 4px rgba(185, 255, 120, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-midnight-ink);
  color: var(--color-midnight-ink);
}

.btn-ghost.on-dark {
  border-color: rgba(252, 247, 237, 0.7);
  color: var(--color-cream-paper);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sections */
.section {
  padding: var(--spacing-16);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--spacing-8);
  margin-bottom: var(--spacing-16);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-heading-sm);
  color: var(--color-true-black);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-head .link {
  color: var(--color-moss);
  font-size: var(--text-body-sm);
  font-weight: 600;
}

/* Categories */
.cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-8);
}

.cat-chip {
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
  border-radius: var(--radius-cards);
  padding: var(--spacing-8);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cat-chip:hover {
  border-color: var(--color-moss);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.cat-chip:active {
  transform: scale(0.97);
}

.cat-chip img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin: 0 auto 6px;
}

.cat-chip span {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  color: var(--color-slate);
  font-weight: 500;
}

.cat-chip.active {
  border-color: var(--color-midnight-ink);
  background: #f4ffe8;
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 var(--spacing-16) var(--spacing-8);
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pills);
  border: 1px solid var(--color-fog);
  background: var(--color-pure-white);
  color: var(--color-slate);
  font-size: var(--text-body-sm);
  cursor: pointer;
  white-space: nowrap;
}

.pill.active {
  background: var(--color-lime-sprout);
  border-color: var(--color-lime-sprout);
  color: var(--color-midnight-ink);
  font-weight: 600;
}

.sort-row {
  display: flex;
  gap: 8px;
  padding: 0 var(--spacing-16) var(--spacing-8);
}

.sort-row select {
  flex: 1;
  height: 40px;
  border: 1px solid var(--color-fog);
  border-radius: var(--radius-buttons);
  background: var(--color-pure-white);
  padding: 0 12px;
  color: var(--color-midnight-ink);
}

/* Product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-8);
  padding: 0 var(--spacing-16) var(--spacing-16);
}

.card {
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
  border-radius: var(--radius-cards);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card:active {
  transform: scale(0.985);
}

.card-media {
  position: relative;
  aspect-ratio: 1;
  background: #f7f3ea;
  border-bottom: 1px solid var(--color-fog);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.fav-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(252, 247, 237, 0.92);
  color: var(--color-stone);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}

.fav-toggle.active {
  color: var(--color-ember-coral);
}

.sale-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--color-lime-sprout);
  color: var(--color-midnight-ink);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: var(--radius-pills);
}

.card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 13px;
  line-height: 1.3;
  color: var(--color-midnight-ink);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.price {
  font-family: var(--font-condensed);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-true-black);
  letter-spacing: -0.025em;
}

.price-old {
  font-size: 12px;
  color: var(--color-ash);
  text-decoration: line-through;
}

.stock {
  font-size: 11px;
  color: var(--color-moss);
}

.stock.out {
  color: #a8a29e;
}

.card-actions {
  margin-top: auto;
  padding-top: 4px;
}

/* Product detail */
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--spacing-16) 0;
}

.detail-top .fav-toggle {
  position: static;
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--color-moss);
  font-weight: 600;
  cursor: pointer;
}

.detail-frame {
  margin: 10px var(--spacing-16) 14px;
  border: 2px solid var(--color-ember-coral);
  border-radius: var(--radius-frames);
  background: #f7f3ea;
  box-shadow: 0 16px 32px rgba(245, 67, 32, 0.12);
  overflow: hidden;
}

.detail-frame img {
  width: 100%;
  height: min(32dvh, 240px);
  object-fit: contain;
  padding: 12px;
}

.detail-content {
  padding: 0 var(--spacing-16) var(--spacing-16);
}

.detail-content h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(18px, 5.2vw, 22px);
  line-height: 1.2;
  color: var(--color-true-black);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.meta-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pills);
  background: var(--color-coral-whisper);
  color: var(--color-slate);
}

.meta-chip.ok {
  background: #e9fbd9;
  color: var(--color-moss);
}

.specs {
  margin: 0 0 var(--spacing-16);
  border-radius: var(--radius-cards);
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
}

.specs div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  font-size: 13px;
}

.specs div + div {
  border-top: 1px solid var(--color-fog);
}

.specs dt {
  color: var(--color-stone);
}

.specs dd {
  margin: 0;
  text-align: right;
  color: var(--color-midnight-ink);
  font-weight: 600;
}

.similar-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-true-black);
}

.similar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--spacing-16));
  padding: 0 var(--spacing-16) 4px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.similar::-webkit-scrollbar {
  display: none;
}

.similar-item {
  flex: 0 0 128px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--color-fog);
  border-radius: var(--radius-cards);
  background: var(--color-pure-white);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.similar-item img {
  width: 100%;
  height: 90px;
  object-fit: contain;
}

.similar-name {
  font-size: 12px;
  line-height: 1.3;
  color: var(--color-midnight-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.similar-price {
  font-family: var(--font-condensed);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-true-black);
}

.buy-bar {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  z-index: 45;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--spacing-16);
  background: var(--color-pure-white);
  border-top: 1px solid var(--color-fog);
  box-shadow: 0 -8px 24px rgba(28, 25, 23, 0.06);
}

.detail-open .buy-bar {
  display: flex;
}

.detail-open .main {
  padding-bottom: 96px;
}

.buy-bar .price-old {
  font-size: 13px;
}

.detail-price {
  font-family: var(--font-condensed);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-true-black);
}

.detail-actions {
  flex: 0 0 auto;
  min-width: 140px;
}

.detail-actions .stepper-wrap {
  justify-content: flex-end;
}

/* Cart / Favorites lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--spacing-16);
}

.list-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
  border-radius: var(--radius-cards);
  padding: 12px;
}

.list-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f7f3ea;
  border-radius: 6px;
}

.list-item h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--color-midnight-ink);
  line-height: 1.3;
}

.list-item .price {
  font-size: 18px;
}

.list-item .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.remove-btn {
  border: 0;
  background: transparent;
  color: var(--color-ember-coral);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.cart-summary {
  margin: 0 var(--spacing-16) var(--spacing-16);
  padding: var(--spacing-24);
  background: var(--color-pure-white);
  border: 1px solid var(--color-fog);
  border-radius: var(--radius-cards);
}

.cart-summary .total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.cart-summary .total-row span:last-child {
  font-family: var(--font-condensed);
  font-size: 30px;
  color: var(--color-true-black);
  font-weight: 600;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-stone);
}

.empty h3 {
  font-family: var(--font-display);
  color: var(--color-true-black);
  margin: 0 0 8px;
}

/* Bottom nav - always visible at screen bottom (flex child of .app) */
.bottom-nav {
  position: relative;
  flex-shrink: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(252, 247, 237, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-fog);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 50;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--color-stone);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--color-forest-stage);
  font-weight: 700;
}

.nav-item .badge {
  top: 6px;
  right: calc(50% - 18px);
}

/* Stepper */
.stepper-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 9999px;
  border: 1.5px solid var(--color-fog);
  background: var(--color-pure-white);
  padding: 3px;
}

.stepper.sm {
  width: 100%;
  justify-content: space-between;
  gap: 4px;
  padding: 2px;
}

.stepper.sm .stepper-btn {
  width: 30px;
  height: 30px;
}

.stepper.sm .stepper-digits {
  font-size: 16px;
  height: 28px;
}

.stepper.sm .stepper-digit {
  width: 10px;
}

.stepper-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9999px;
  background: var(--color-lime-sprout);
  color: var(--color-midnight-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.stepper-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.stepper-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stepper-digits {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 24px;
  height: 30px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-midnight-ink);
  perspective: 400px;
  transform-style: preserve-3d;
}

.stepper-digit {
  position: relative;
  width: 11px;
  height: 100%;
  transform-style: preserve-3d;
}

.stepper-digit span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.stepper-digit span.enter-up {
  animation: digitInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stepper-digit span.enter-down {
  animation: digitInDown 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stepper-digit span.exit-up {
  animation: digitOutUp 0.28s ease forwards;
}

.stepper-digit span.exit-down {
  animation: digitOutDown 0.28s ease forwards;
}

@keyframes digitInUp {
  from {
    transform: translateY(20px) scale(0.5);
    opacity: 0;
    filter: blur(2px);
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes digitInDown {
  from {
    transform: translateY(-20px) scale(0.5);
    opacity: 0;
    filter: blur(2px);
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes digitOutUp {
  to {
    transform: translateY(-20px) scale(0.5);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes digitOutDown {
  to {
    transform: translateY(20px) scale(0.5);
    opacity: 0;
    filter: blur(2px);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(20px);
  background: var(--color-midnight-ink);
  color: var(--color-cream-paper);
  padding: 10px 16px;
  border-radius: var(--radius-pills);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loading {
  padding: 40px;
  text-align: center;
  color: var(--color-stone);
}

.loading .spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-fog);
  border-top-color: var(--color-moss);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.load-more.btn-block {
  width: calc(100% - var(--spacing-32));
  margin: 0 var(--spacing-16) var(--spacing-24);
}

/* Media queries - desktop / tablet / Telegram desktop */
@media (min-width: 480px) {
  :root {
    --app-max: 480px;
  }

  .hero h1 {
    font-size: 34px;
  }
}

@media (min-width: 768px) {
  body {
    padding: 24px 0;
  }

  .app {
    height: calc(100dvh - 48px);
    min-height: calc(100dvh - 48px);
    max-height: calc(100dvh - 48px);
    border-radius: 16px;
  }

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

@media (min-width: 1024px) {
  :root {
    --app-max: 520px;
  }
}

@media (max-width: 360px) {
  .cats {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand {
    font-size: 18px;
  }

  .hero {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
