:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --text: #1f2733;
  --muted: #7b8797;
  --line: #dfe7f1;
  --accent: #eb6578;
  --accent-2: #0f72d6;
  --shadow: 0 14px 32px rgba(42, 88, 140, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #eef3f9, #f8fbff);
  color: var(--text);
}

.store-shell {
  width: min(100%, 440px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  padding-bottom: 88px;
}

.store-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 231, 241, 0.9);
  padding: 14px 16px 12px;
  display: grid;
  gap: 12px;
}

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

.store-brand strong {
  font-size: 22px;
  line-height: 1.05;
}

.store-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.store-view {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.hero-banner {
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f8fd, #ddecff);
  box-shadow: var(--shadow);
}

.hero-banner-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 18px;
}

.hero-banner h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.hero-banner p {
  margin: 0;
  color: #516274;
  line-height: 1.5;
}

.hero-banner img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  min-height: 160px;
}

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

.category-card,
.product-card,
.cart-card,
.profile-card,
.related-card,
.order-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(223, 231, 241, 0.92);
  box-shadow: var(--shadow);
}

.category-card {
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.category-card img {
  width: 100%;
  height: 154px;
  object-fit: cover;
  display: block;
  background: #f0f5fb;
}

.category-card-body {
  padding: 12px;
  text-align: center;
  font-weight: 700;
  min-height: 68px;
  display: grid;
  place-items: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head .muted {
  font-size: 13px;
}

.product-list {
  display: grid;
  gap: 12px;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.order-detail {
  display: grid;
  gap: 14px;
}

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

.product-card img {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  object-fit: cover;
  background: #f0f5fb;
}

.product-card-body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.product-title {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
}

.product-desc {
  color: #5d6e81;
  font-size: 14px;
  line-height: 1.45;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.icon-btn {
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(42, 88, 140, 0.08);
  min-width: 44px;
  min-height: 44px;
}

.product-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 440px);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(223,231,241,0.95);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px 10px;
  z-index: 30;
}

.nav-tab {
  border: 0;
  background: transparent;
  display: grid;
  gap: 4px;
  justify-items: center;
  color: #5b6c80;
  font-size: 11px;
  font-weight: 700;
}

.nav-tab.active {
  color: var(--text);
}

.view-hidden { display: none !important; }

.detail-sheet,
.cart-sheet,
.profile-sheet {
  position: fixed;
  inset: 0;
  background: rgba(18, 29, 44, 0.28);
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}

.detail-sheet.open,
.cart-sheet.open,
.profile-sheet.open {
  display: flex;
}

.sheet-card {
  width: min(100%, 440px);
  max-height: calc(100vh - 20px);
  overflow: auto;
  background: #fff;
  border-radius: 26px 26px 18px 18px;
  box-shadow: 0 30px 50px rgba(22, 43, 69, 0.24);
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.sheet-content {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.detail-image {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  max-height: 360px;
  background: #f0f5fb;
}

.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 800;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.secondary-btn {
  background: #edf4fb;
  color: #275584;
}

.related-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 12px;
  overflow: auto;
  padding-bottom: 4px;
}

.related-card {
  padding: 10px;
}

.related-card img {
  width: 100%;
  height: 116px;
  border-radius: 14px;
  object-fit: cover;
  background: #f0f5fb;
}

.related-card-title {
  font-size: 14px;
  margin: 8px 0 10px;
  min-height: 36px;
}

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

.cart-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  align-items: center;
}

.cart-card img {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
  background: #f0f5fb;
}

.qty-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qty-row button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.cart-summary {
  padding: 16px;
  border-radius: 18px;
  background: #f7fbff;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.checkout-note {
  font-size: 13px;
  line-height: 1.45;
  color: #58708c;
}

.order-card {
  padding: 14px;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.order-card-head,
.order-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.order-card-meta {
  color: #67809b;
  font-size: 13px;
}

.order-card-total {
  font-size: 20px;
  font-weight: 800;
  color: #163a63;
}

.order-card-items {
  display: grid;
  gap: 6px;
  color: #44566c;
  font-size: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-new_order { background: #eef6ff; color: #1763b1; }
.status-awaiting_confirmation { background: #eefbff; color: #1480a8; }
.status-confirmed { background: #eefcf3; color: #20804d; }
.status-processing { background: #fff7eb; color: #aa6511; }
.status-invoiced { background: #fff3f3; color: #c84f5b; }
.status-paid { background: #eefcf3; color: #1d8e55; }
.status-deliveries_planned { background: #eef6ff; color: #245ea8; }
.status-in_delivery { background: #f3f1ff; color: #5a52b4; }
.status-completed { background: #eefcf3; color: #1b7f53; }
.status-cancelled { background: #fff1f1; color: #c84545; }
.status-created,
.status-draft { background: #f4f7fb; color: #607188; }

.order-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.order-detail-card {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.order-lines {
  display: grid;
  gap: 10px;
}

.order-line,
.timeline-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.timeline-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(223, 231, 241, 0.8);
  font-size: 14px;
}

.timeline-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.document-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: #16416d;
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

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

@media (max-width: 380px) {
  .hero-banner-inner {
    grid-template-columns: 1fr;
  }
  .product-card {
    grid-template-columns: 98px 1fr;
  }
  .product-card img {
    width: 98px;
    height: 98px;
  }
}
