:root {
  --shop-brand: #d4278b;
  --shop-dark: #0c2957;
  --shop-bg: #f1f5f9;
  --shop-card: #ffffff;
  --shop-muted: #64748b;
  --shop-border: #e2e8f0;
  --shop-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

body.shop-app {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--shop-bg);
  color: var(--shop-dark);
  padding-bottom: calc(88px + var(--shop-safe-bottom));
}

.shop-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--shop-dark);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.shop-header p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  opacity: 0.85;
}

.shop-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.shop-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.shop-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.shop-cat-btn {
  border: 1px solid var(--shop-border);
  background: var(--shop-card);
  color: var(--shop-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}

.shop-cat-btn.is-active {
  background: var(--shop-brand);
  border-color: var(--shop-brand);
  color: #fff;
}

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

.shop-product {
  background: var(--shop-card);
  border-radius: 14px;
  border: 1px solid var(--shop-border);
  overflow: hidden;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.shop-product img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
  flex-shrink: 0;
}

.shop-product-body {
  flex: 1;
  min-width: 0;
}

.shop-product h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.shop-product .desc {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--shop-muted);
  line-height: 1.35;
}

.shop-product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shop-price {
  font-weight: 700;
  color: var(--shop-brand);
  font-size: 0.95rem;
}

.shop-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--shop-border);
  border-radius: 10px;
  overflow: hidden;
}

.shop-qty button {
  border: 0;
  background: #f8fafc;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--shop-dark);
}

.shop-qty span {
  min-width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.shop-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--shop-card);
  border-top: 1px solid var(--shop-border);
  padding: 12px 16px calc(12px + var(--shop-safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 -8px 24px rgba(12, 41, 87, 0.08);
}

.shop-cart-bar.hidden {
  display: none;
}

.shop-cart-summary {
  font-size: 0.85rem;
}

.shop-cart-summary strong {
  display: block;
  font-size: 1rem;
}

.shop-primary-btn {
  border: 0;
  background: var(--shop-brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}

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

.shop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 41, 87, 0.45);
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.shop-overlay.open {
  display: flex;
}

.shop-sheet {
  background: var(--shop-card);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(16px + var(--shop-safe-bottom));
  overflow-y: auto;
}

.shop-sheet h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.shop-field {
  margin-bottom: 12px;
}

.shop-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.shop-field input {
  width: 100%;
  border: 1px solid var(--shop-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
}

.shop-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--shop-border);
}

.shop-success {
  text-align: center;
  padding: 24px 8px;
}

.shop-success h2 {
  color: var(--shop-dark);
}

.shop-success p {
  color: var(--shop-muted);
  font-size: 0.9rem;
}

.shop-link-btn {
  display: inline-block;
  margin-top: 12px;
  margin-right: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.shop-link-btn.primary {
  background: var(--shop-brand);
  color: #fff;
}

.shop-link-btn.secondary {
  background: var(--shop-dark);
  color: #fff;
}

.shop-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--shop-muted);
  font-size: 0.9rem;
}

.shop-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.shop-error.show {
  display: block;
}
