:root {
  --bg: #E8EDF2;
  --bg-elevated: #F7F9FB;
  --ink: #12151A;
  --ink-soft: #5A6570;
  --line: rgba(18, 21, 26, 0.1);
  --accent: #E85D04;
  --accent-ink: #FFFFFF;
  --ok: #1F8A4C;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(18, 21, 26, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Syne", "Outfit", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
  height: 100svh;
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(232, 93, 4, 0.12), transparent 45%),
    radial-gradient(90% 60% at 100% 0%, rgba(30, 90, 160, 0.1), transparent 40%),
    linear-gradient(180deg, #F3F6F9 0%, var(--bg) 40%, #DFE6ED 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  height: 100%;
  height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 12px;
  background: rgba(232, 237, 242, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-sm {
  font-size: 1.15rem;
}

.topbar-sub {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease;
}

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

.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}

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

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.spacer {
  width: 42px;
}

.page {
  padding: 8px 20px 24px;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-copy h1,
.catalog-meta h1,
.product-detail h1,
.checkout-block h1 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 6vw, 2rem);
}

.hero-copy p,
.catalog-meta p,
.muted,
.product-desc {
  margin: 0;
  color: var(--ink-soft);
}

.prefs-form,
.checkout-form {
  margin-top: 24px;
  display: grid;
  gap: 22px;
}

.field-block {
  border: 0;
  margin: 0;
  padding: 0;
}

.field-block legend {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.chip-grid.sizes {
  grid-template-columns: repeat(4, 1fr);
}

.chip-row {
  display: flex;
  gap: 8px;
}

.chip-row.wrap {
  flex-wrap: wrap;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

.chip.is-active,
.chip-btn.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.chip-btn {
  appearance: none;
  font: inherit;
}

.sticky-cta {
  flex: 0 0 auto;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  margin: 0;
  padding: 12px 20px max(12px, var(--safe-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 20;
}

.sticky-cta.twin {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px rgba(232, 93, 4, 0.28);
}

.btn-primary.is-added:disabled {
  background: var(--ok);
  box-shadow: 0 8px 20px rgba(31, 138, 76, 0.28);
  opacity: 1;
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border: 1px solid var(--line);
}

.catalog-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease;
}

.product-card:active {
  transform: scale(0.98);
}

.product-visual {
  position: relative;
  aspect-ratio: 1 / 0.95;
  display: grid;
  place-items: center;
  padding: 12px;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 28%, white), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--shoe) 18%, white), #fff 70%);
}

.shoe-svg {
  width: 100%;
  height: auto;
  max-width: 180px;
  transition: filter 0.2s ease;
}

.shoe-svg.is-large {
  max-width: 280px;
}

/* Visual variety without extra SVG assets */
.shoe-fx-0 .shoe-svg { filter: none; }
.shoe-fx-1 .shoe-svg { filter: hue-rotate(24deg) saturate(1.25); }
.shoe-fx-2 .shoe-svg { filter: hue-rotate(190deg) saturate(1.35) brightness(1.05); }
.shoe-fx-3 .shoe-svg { filter: hue-rotate(260deg) saturate(1.15); }
.shoe-fx-4 .shoe-svg { filter: hue-rotate(350deg) saturate(1.4) contrast(1.05); }
.shoe-fx-5 .shoe-svg { filter: hue-rotate(110deg) saturate(1.2); }
.shoe-fx-6 .shoe-svg { filter: sepia(0.35) saturate(0.7) brightness(1.08); }
.shoe-fx-7 .shoe-svg { filter: grayscale(0.15) contrast(1.15) brightness(0.92); }
.shoe-fx-8 .shoe-svg { filter: hue-rotate(320deg) saturate(0.9) brightness(1.05); }
.shoe-fx-9 .shoe-svg { filter: sepia(0.55) hue-rotate(10deg) saturate(1.1); }
.shoe-fx-10 .shoe-svg { filter: hue-rotate(200deg) saturate(0.95) contrast(1.1); }
.shoe-fx-11 .shoe-svg { filter: grayscale(0.45) brightness(1.1) contrast(0.95); }
.shoe-fx-12 .shoe-svg { filter: hue-rotate(70deg) saturate(1.3) contrast(1.05); }
.shoe-fx-13 .shoe-svg { filter: hue-rotate(45deg) saturate(1.45) brightness(0.95); }
.shoe-fx-14 .shoe-svg { filter: hue-rotate(85deg) saturate(1.1) brightness(1.05); }
.shoe-fx-15 .shoe-svg { filter: sepia(0.4) hue-rotate(330deg) contrast(1.1); }
.shoe-fx-16 .shoe-svg { filter: sepia(0.65) saturate(1.2) hue-rotate(350deg); }
.shoe-fx-17 .shoe-svg { filter: grayscale(0.7) contrast(1.2) brightness(0.9); }
.shoe-fx-18 .shoe-svg { filter: sepia(0.7) hue-rotate(340deg) saturate(1.3); }
.shoe-fx-19 .shoe-svg { filter: hue-rotate(180deg) saturate(0.8) brightness(1.1); }
.shoe-fx-20 .shoe-svg { filter: sepia(0.5) hue-rotate(5deg) brightness(1.05); }
.shoe-fx-21 .shoe-svg { filter: hue-rotate(310deg) saturate(1.35) contrast(1.05); }
.shoe-fx-22 .shoe-svg { filter: hue-rotate(150deg) saturate(1.25) brightness(1.08); }
.shoe-fx-23 .shoe-svg { filter: hue-rotate(40deg) saturate(1.5) contrast(1.1); }

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tag-lg {
  top: 16px;
  left: 16px;
  font-size: 0.75rem;
  padding: 6px 10px;
}

.product-info {
  padding: 12px;
  display: grid;
  gap: 2px;
}

.product-brand {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-name {
  font-size: 0.98rem;
  font-weight: 700;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  font-weight: 700;
}

.product-price s {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.85em;
}

.product-price.lg {
  font-size: 1.35rem;
  margin: 8px 0 12px;
}

.product-hero {
  position: relative;
  border-radius: 24px;
  padding: 28px 16px 12px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--accent) 35%, white), transparent 50%),
    linear-gradient(165deg, color-mix(in srgb, var(--shoe) 22%, white), #fff);
  box-shadow: var(--shadow);
  animation: float-in 0.45s ease both;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.product-detail {
  margin-top: 20px;
}

.product-desc {
  margin: 0 0 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.detail-row span {
  color: var(--ink-soft);
}

.empty-state {
  margin-top: 48px;
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.cart-list {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  animation: rise 0.3s ease both;
}

.cart-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--shoe) 25%, white), #fff);
}

.cart-thumb .shoe-svg {
  max-width: 64px;
}

.cart-item h3 {
  margin: 0;
  font-size: 0.98rem;
}

.cart-item p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.cart-item-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--line);
}

.qty button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.remove-btn {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.cart-summary {
  margin-top: 20px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
}

.summary-row.total {
  color: var(--ink);
  font-size: 1.1rem;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.checkout-block {
  margin-bottom: 8px;
}

.input-field {
  display: grid;
  gap: 6px;
}

.input-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-field input {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-field input:focus {
  border-color: var(--accent);
}

.pay-options {
  display: grid;
  gap: 8px;
}

.pay-option {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid transparent;
  cursor: pointer;
}

.pay-option input {
  accent-color: var(--accent);
}

.pay-option span {
  display: grid;
}

.pay-option small {
  color: var(--ink-soft);
}

.pay-option.is-active {
  border-color: var(--accent);
  background: #fff;
}

.order-preview {
  margin-top: 4px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(18, 21, 26, 0.04);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.success-panel {
  margin-top: 40px;
  text-align: center;
  display: none;
  gap: 12px;
  justify-items: center;
  animation: rise 0.4s ease both;
}

.success-panel.is-shown {
  display: grid;
}

.success-panel[hidden] {
  display: none !important;
}

.success-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%) translateY(16px) scale(0.96);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  width: min(420px, calc(100% - 32px));
  background: #143D28;
  color: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(20, 61, 40, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 40;
}

.toast-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok);
  font-size: 0.95rem;
}

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

@media (min-width: 481px) {
  body {
    padding: 0;
    display: flex;
    justify-content: center;
    background: #D5DCE4;
  }

  .app-shell {
    width: 100%;
    max-width: 480px;
    height: 100svh;
    box-shadow: 0 0 0 1px rgba(18, 21, 26, 0.06);
    background:
      radial-gradient(120% 80% at 10% -10%, rgba(232, 93, 4, 0.12), transparent 45%),
      radial-gradient(90% 60% at 100% 0%, rgba(30, 90, 160, 0.1), transparent 40%),
      linear-gradient(180deg, #F3F6F9 0%, var(--bg) 40%, #DFE6ED 100%);
  }

  .sticky-cta {
    width: 100%;
  }
}
