:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink: #151936;
  --muted: #687084;
  --line: #dde4ef;
  --accent: #159bd7;
  --accent-strong: #1459bc;
  --accent-alt: #e63393;
  --accent-soft: #eaf7ff;
  --rose-soft: #fff0f8;
  --warn: #e63393;
  --shadow: 0 18px 48px rgb(21 25 54 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  background:
    linear-gradient(135deg, rgb(21 155 215 / 94%), rgb(230 51 147 / 92%)),
    #159bd7;
  color: white;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 3px solid rgb(255 255 255 / 85%);
  border-radius: 50%;
  background: white;
  object-fit: cover;
  box-shadow: 0 8px 18px rgb(0 0 0 / 16%);
}

.app-header p,
.app-header h1 {
  margin: 0;
  letter-spacing: 0;
}

.app-header p {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-header h1 {
  font-size: 20px;
}

.icon-button,
.search-panel button,
.install-card button,
.primary,
.secondary,
.chip {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.icon-button {
  margin-left: auto;
  padding: 0 10px;
  background: rgb(21 25 54 / 24%);
  color: white;
  border-color: rgb(255 255 255 / 35%);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
}

.install-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 12px 0;
  padding: 12px;
  border: 1px solid #b8ddf2;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-soft), var(--rose-soft));
}

.install-card[hidden] {
  display: none;
}

.install-card strong,
.install-card p {
  margin: 0;
}

.install-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.install-card button {
  padding: 0 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: white;
  border-color: transparent;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.search-panel button,
.secondary {
  background: white;
  color: var(--accent-strong);
  border-color: #bfd9f4;
}

.content {
  overflow: auto;
  padding: 14px 12px 96px;
}

.view-title {
  margin: 2px 0 12px;
  font-size: 19px;
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 10px;
}

.band {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.list-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.list-button strong {
  display: block;
}

.list-button span {
  color: var(--muted);
  font-size: 13px;
}

.product {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.product-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.product-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 0 11px;
  background: var(--accent-soft);
  border-color: #b8ddf2;
  color: var(--accent-strong);
  font-weight: 700;
}

.primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: white;
  border-color: transparent;
  font-weight: 800;
}

.cart-line {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line strong {
  font-size: 15px;
}

.total {
  margin: 14px 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-strong);
}

.checkout {
  display: grid;
  gap: 10px;
}

.success {
  padding: 12px;
  border: 1px solid #b9dcf2;
  border-radius: 8px;
  background: #eef9ff;
  color: #1459bc;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 520px);
  transform: translateX(-50%);
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgb(255 253 248 / 96%);
  backdrop-filter: blur(14px);
}

.nav-item {
  position: relative;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--accent-soft), var(--rose-soft));
  color: var(--accent-strong);
}

#cartBadge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn);
  color: white;
  font-size: 12px;
}

@media (min-width: 760px) {
  body {
    padding: 20px;
  }

  .app-shell {
    min-height: calc(100vh - 40px);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
  }

  .bottom-nav {
    bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
  }
}
