/* AMIGUATE Catálogo — static version.
   Look copied from the Replit site (same palette, radius, cards). */
:root {
  --background: hsl(42 28% 97%);
  --foreground: hsl(158 21% 15%);
  --card: hsl(40 36% 99%);
  --card-border: hsl(43 16% 86%);
  --primary: hsl(147 54% 34%);
  --primary-fg: hsl(42 30% 98%);
  --secondary: hsl(39 24% 91%);
  --muted: hsl(43 20% 92%);
  --muted-fg: hsl(155 8% 41%);
  --accent: hsl(43 29% 88%);
  --border: hsl(43 16% 86%);
  --radius: .75rem;
  --yellow: #ffd500;
  --yellow-hover: #edc600;
  --wa: #25d366;
  --wa-dark: #1da851;
  --danger: hsl(2 67% 45%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--foreground);
  min-height: 100dvh;
}
body.amivo-page { background: #f3f4f6; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 12px;
  height: 56px; display: flex; align-items: center; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { height: 40px; width: 40px; object-fit: contain; border-radius: 8px; }
.brand-name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-spacer { flex: 1; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; font-weight: 600; font-size: 14px;
}
.cart-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: var(--yellow); color: #000;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
/* Add-to-cart feedback: flying product image + cart button bump. */
.fly-img {
  position: fixed; z-index: 9999; pointer-events: none;
  border-radius: 10px; object-fit: cover; box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.cart-btn.bump { animation: cartBump .45s ease; }
@keyframes cartBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------- layout ---------- */
.view { max-width: 1280px; margin: 0 auto; padding: 12px 10px 48px; }
.banner { border-radius: 16px; overflow: hidden; background: var(--muted); position: relative; margin-bottom: 28px; }
.banner img { width: 100%; height: auto; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-fg); pointer-events: none; }
.search-input {
  width: 100%; height: 40px; padding-left: 40px; padding-right: 12px;
  font-size: 16px; background: hsl(43 20% 92% / .5); border: 1px solid transparent;
  border-radius: 10px; outline: none; color: var(--foreground);
}
.search-input:focus { background: #fff; border-color: var(--primary); }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 1 0 auto; min-height: 44px; padding: 0 16px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  color: var(--muted-fg); font-weight: 600; font-size: clamp(11px, 2.6vw, 13px);
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { border-color: var(--yellow); background: var(--yellow); color: #000; }
.pill-amivo { border-color: var(--yellow); background: var(--yellow); color: #000; text-decoration: none; }
.pill-amivo:hover { background: var(--yellow-hover); color: #000; }
.result-count { color: var(--muted-fg); font-size: 13px; margin: 4px 2px 12px; }

/* ---------- product grid / cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.card {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); text-decoration: none; color: inherit;
}
.card-img { position: relative; aspect-ratio: 1 / 1; width: 100%; background: #fff; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px; flex: 1; }
.card-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.card-code { color: var(--muted-fg); font-size: 13px; }
.card-price { font-weight: 700; font-size: 16px; margin-top: 2px; }
.card-price .pack { font-weight: 500; color: var(--muted-fg); font-size: 13px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; text-decoration: none;
}
.btn-wa { background: var(--wa); color: #fff; flex: 1; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-add {
  background: var(--yellow); color: #000; width: 44px; padding: 0;
  font-size: 20px; font-weight: 700; flex: none;
}
.btn-add:hover { background: var(--yellow-hover); }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--foreground); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- detail page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--muted-fg); font-size: 14px; font-weight: 600; padding: 8px 0; margin-bottom: 8px; }
.detail { display: grid; gap: 20px; }
@media (min-width: 768px) { .detail { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; } }
.detail-img { width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #fff; overflow: hidden; }
.detail-img button { display: block; width: 100%; padding: 0; border: none; background: #fff; }
.detail-img img { width: 100%; height: auto; cursor: zoom-in; }
.detail-info h1 { font-size: 22px; margin: 0 0 4px; line-height: 1.3; }
.detail-code { color: var(--muted-fg); font-size: 14px; margin-bottom: 12px; }
.detail-price { font-size: 24px; font-weight: 700; margin: 8px 0; }
.detail-pack { color: var(--muted-fg); font-size: 14px; margin-bottom: 12px; }
.detail-desc { white-space: pre-line; line-height: 1.6; font-size: 15px; color: var(--foreground); margin: 12px 0 20px; }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.qty-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff; font-size: 20px; font-weight: 700; }
.qty-val { min-width: 32px; text-align: center; font-size: 18px; font-weight: 700; }
.detail-total { font-size: 18px; font-weight: 700; margin: 8px 0 16px; }
.detail-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- group page ---------- */
.group-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.group-head h1 { font-size: 22px; margin: 0; }
.group-head p { margin: 0; color: var(--muted-fg); font-size: 14px; }
.group-cover { border-radius: 16px; overflow: hidden; margin-bottom: 16px; background: var(--muted); }
.group-cover img { width: 100%; height: auto; }

/* ---------- amivo gate ---------- */
.gate { max-width: 448px; margin: 48px auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 24px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.gate h1 { font-size: 20px; margin: 12px 0 8px; }
.gate p { color: var(--muted-fg); font-size: 14px; margin: 0 0 8px; }
.gate .btn { width: 100%; margin-top: 12px; background: var(--yellow); color: #000; }
.gate .btn:hover { background: var(--yellow-hover); }
.gate-icon { width: 36px; height: 36px; margin: 0 auto; color: var(--foreground); }

/* ---------- cart drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 51;
  background: #fff; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 18px; margin: 0; }
.drawer-close { background: none; border: none; font-size: 22px; line-height: 1; padding: 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-empty { color: var(--muted-fg); text-align: center; padding: 48px 0; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-item-code { color: var(--muted-fg); font-size: 12px; }
.cart-item-price { font-size: 14px; font-weight: 600; margin-top: 4px; }
.cart-qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-qty button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 16px; font-weight: 700; }
.cart-remove { background: none; border: none; color: var(--danger); font-size: 13px; padding: 4px 0; }
.drawer-foot { border-top: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.drawer-foot .subtotal { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; }
.drawer-foot .note { color: var(--muted-fg); font-size: 13px; line-height: 1.5; margin: 0; }

/* ---------- lightbox / toast ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 12px; }
.lightbox-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 999px; border: none; background: #fff; font-size: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: #111; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); white-space: nowrap;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 24px 12px 40px; display: flex; flex-direction: column; gap: 16px; font-size: 14px; line-height: 1.6; }
.footer-inner h3 { margin: 0 0 4px; font-size: 15px; }
.footer-inner p { margin: 0; color: var(--muted-fg); }
.footer-inner a { color: var(--primary); }
.footer-cols { display: grid; gap: 16px; }
@media (min-width: 640px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
.footer-bottom { color: var(--muted-fg); font-size: 13px; }

/* ---------- misc ---------- */
.empty-state { text-align: center; color: var(--muted-fg); padding: 48px 16px; }
.error-state { text-align: center; padding: 48px 16px; color: var(--danger); }
.loading { text-align: center; color: var(--muted-fg); padding: 48px 16px; }
