:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #0c4a6e;
  --accent-light: #0369a1;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --whatsapp: #25d366;
  --header-h: 56px;
  --cat-h: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding-bottom: 5rem;
}

a {
  color: var(--accent-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border-radius: 10px;
  font-size: 1.25rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.logo-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-ghost {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-ghost:hover {
  background: rgba(12, 74, 110, 0.06);
  text-decoration: none;
}

.category-bar {
  border-top: 1px solid var(--border);
  background: #fafbfd;
}

.categories {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1rem 0.75rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-height: var(--cat-h);
  align-items: center;
}

.categories::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-pill:hover {
  border-color: #cbd5e1;
  color: var(--text);
}

.cat-pill.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #e0f2fe 0%, var(--bg) 55%);
  padding: 2.5rem 1.25rem 2rem;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--accent);
}

.hero-lead {
  margin: 0 auto 2rem;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  text-align: left;
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.feature-card h2 {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Loading */
.loading-banner {
  max-width: 1120px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Sections */
.sections-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.product-section {
  margin-bottom: 2.5rem;
}

.product-section.muted .section-head h2 {
  color: var(--text-muted);
}

.section-head {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.section-head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

.placeholder-grid {
  min-height: 80px;
  align-items: center;
}

.empty-hint {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: default;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 12px 32px rgba(15, 23, 42, 0.08);
}

.product-card.is-dragging {
  opacity: 0.85;
  cursor: grabbing;
}

.reorder-mode .product-card {
  cursor: grab;
}

.product-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #e2e8f0, #f1f5f9);
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.product-body {
  padding: 0.85rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.product-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-price {
  margin-top: auto;
  padding-top: 0.65rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}

/* Empty + CTA */
.empty-state {
  max-width: 1120px;
  margin: 0 auto 2rem;
  padding: 1.25rem 1.25rem 2rem;
  text-align: center;
}

.empty-state .btn-primary {
  margin-top: 0.25rem;
}

.btn-primary {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(12, 74, 110, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.btn-secondary {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
}

.btn-small {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.icon-close {
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.icon-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Footer */
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 6rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.footer-nav a:hover {
  color: var(--accent);
}

.copyright {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* FAB */
.fab-whatsapp {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: var(--whatsapp);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  text-decoration: none;
}

.fab-whatsapp:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

/* Install toast */
.install-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(420px, calc(100% - 2rem));
}

.install-toast[hidden] {
  display: none;
}

.install-toast-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

.install-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.install-text strong {
  font-size: 0.8125rem;
  color: var(--text);
}

/* Reorder bar */
.reorder-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 48;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.reorder-bar[hidden] {
  display: none;
}

.reorder-bar p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.reorder-actions {
  display: flex;
  gap: 0.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.modal-sheet {
  max-width: 480px;
}

.modal h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  padding-right: 2rem;
}

.modal-sub {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.modal-close:hover {
  background: var(--bg);
}

.qr-box {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.25rem;
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #e2e8f0 0% 50%) 50% / 16px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  resize: vertical;
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

body.reorder-mode {
  padding-bottom: 8rem;
}
