/* Cuadralo tienda publica: bundle generado por web/build.sh, no editar a mano. */
/* [CL] Vanilla CSS, sin frameworks. Variables --accent/--on-accent las fija main.js desde settings. */
:root {
  --canvas: #FAF9F7;
  --card: #FFFFFF;
  --border: #E7E3DC;
  --text: #242424;
  --text-secondary: #8A857D;
  --accent: #3BE0D0;
  --on-accent: #242424;
  --accent-soft: rgba(59, 224, 208, 0.12);
  --green: #4ADE80;
  --red: #F87171;
  --radius-card: 1rem;
  --radius-input: 0.75rem;
  --radius-btn: 0.875rem;
  --page-x: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: Inter, "Noto Sans", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

h1, h2, .headline {
  font-family: Archivo, Inter, sans-serif;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 0.75rem;
}
h1 { font-size: 1.5rem; }
@media (min-width: 768px) { h1 { font-size: 1.75rem; } }

a { color: inherit; text-decoration: none; }

#app { display: flex; flex-direction: column; min-height: 100dvh; }

/* ---------- header ---------- */
.store-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem var(--page-x);
}
.header-row { display: flex; align-items: center; gap: 0.75rem; max-width: 1280px; margin: 0 auto; }
.store-logo { width: 2.25rem; height: 2.25rem; border-radius: 50%; object-fit: cover; flex: none; }
.store-name { font-family: Archivo, sans-serif; font-weight: 800; font-size: 1.125rem; flex: 1; }
.cart-button {
  display: flex; align-items: center; gap: 0.375rem;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-btn);
  min-height: 44px; padding: 0 0.875rem; font: inherit; color: var(--text); cursor: pointer;
}
.cart-count {
  background: var(--accent); color: var(--on-accent); border-radius: 999px;
  font-weight: 700; font-size: 0.75rem; min-width: 1.25rem; text-align: center; padding: 0.05rem 0.35rem;
}

/* ---------- layout general ---------- */
.store-main { flex: 1; max-width: 1280px; margin: 0 auto; padding: 1rem var(--page-x) 2rem; width: 100%; }
.store-footer { border-top: 1px solid var(--border); padding: 1.5rem var(--page-x); }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; font-size: 0.8125rem; color: var(--text-secondary); }
.made-with { color: var(--text-secondary); font-size: 0.8125rem; margin: 0; }

/* ---------- catalogo ---------- */
.search-input {
  width: 100%; padding: 0.75rem 1rem; margin-bottom: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-input);
  background: var(--card); font: inherit;
}
.search-input:focus { outline: none; border-color: var(--accent); border-width: 1.5px; }
.catalog-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
@media (min-width: 1024px) {
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  overflow: hidden; display: block; transition: transform 120ms ease, opacity 120ms ease;
}
.product-card:hover { transform: translateY(-1px); }
.product-image { position: relative; aspect-ratio: 1 / 1; background: var(--border); }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 0.625rem 0.75rem 0.875rem; }
.product-name { margin: 0 0 0.25rem; font-size: 0.875rem; color: var(--text); }
.product-price { margin: 0; font-family: Archivo, sans-serif; font-weight: 800; font-size: 1.125rem; }
.price-ves { display: block; font-family: Inter, sans-serif; font-weight: 400; font-size: 0.8125rem; color: var(--text-secondary); }

.badge {
  display: inline-block; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.3px;
  padding: 0.2rem 0.5rem; border-radius: 999px; background: var(--border); color: var(--text);
}
.badge-warning { position: absolute; top: 0.5rem; left: 0.5rem; background: var(--red); color: #FAF9F7; }
.badge-accent { background: var(--accent-soft); color: var(--text); margin-left: 0.375rem; }

/* ---------- botones y formularios ---------- */
.btn {
  min-height: 48px; padding: 0 1.25rem; border-radius: var(--radius-btn); font: inherit; font-weight: 700;
  cursor: pointer; border: 1px solid transparent; transition: transform 100ms ease, filter 100ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); width: 100%; }
.btn-primary:hover { filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text); width: 100%; margin: 1rem 0; }
.btn-fixed { position: sticky; bottom: 0; margin-top: 1rem; box-shadow: 0 -4px 16px rgba(0,0,0,0.05); }

.field-label { display: block; font-size: 0.8125rem; font-weight: 600; margin: 0 0 1rem; }
.text-input, .qty-input {
  display: block; width: 100%; margin-top: 0.375rem; padding: 0.75rem 0.875rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--card); color: var(--text);
}
.text-input:focus, .qty-input:focus { outline: none; border-color: var(--accent); border-width: 1.5px; }
.qty-input { width: 4.5rem; text-align: center; }
.field-error { color: var(--red); font-size: 0.8125rem; margin: 0.25rem 0 0; }

.icon-button { background: none; border: none; color: var(--text-secondary); font-size: 1.25rem; cursor: pointer; padding: 0.25rem; }

/* ---------- notice banner (checkout/producto) ---------- */
.notice-banner {
  background: var(--accent-soft); border-radius: var(--radius-input); padding: 0.75rem 1rem;
  font-size: 0.8125rem; color: var(--text); margin: 1rem 0;
}

/* ---------- estados ---------- */
.state-block { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.state-block h1, .state-block h2 { color: var(--text); }
.store-missing { max-width: 32rem; margin: 4rem auto; }

.skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1rem; }
.skeleton-card { aspect-ratio: 3/4; background: linear-gradient(90deg, var(--border), var(--card), var(--border)); border-radius: var(--radius-card); }

.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--canvas); padding: 0.625rem 1rem; border-radius: var(--radius-btn);
  font-size: 0.875rem; z-index: 50;
}

.spinner {
  display: inline-block; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.2); border-top-color: var(--on-accent);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- producto ---------- */
.product-page { max-width: 640px; margin: 0 auto; }
.product-gallery { aspect-ratio: 1/1; background: var(--border); border-radius: var(--radius-card); overflow: hidden; margin-bottom: 1rem; }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; }
.product-title { margin: 0 0 0.25rem; }
.price-lg { font-size: 1.5rem; }
.product-description { color: var(--text); font-size: 0.9375rem; margin: 0.75rem 0; max-width: 65ch; }
.variation-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.chip {
  border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 0.4rem 0.875rem; font: inherit; font-size: 0.8125rem; cursor: pointer;
}
.chip-selected { border-color: var(--accent); border-width: 1.5px; font-weight: 700; }
.tiers-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; font-size: 0.875rem; }
.tier-row td { padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--border); }
.tier-applies { background: var(--accent-soft); }

@media (min-width: 1024px) {
  .product-page { display: grid; grid-template-columns: 55% 1fr; gap: 2rem; max-width: 1024px; align-items: start; }
  .product-gallery { margin-bottom: 0; }
  .product-page > :not(.product-gallery) { grid-column: 2; }
  .product-gallery { grid-column: 1; grid-row: 1 / -1; }
  .btn-fixed { position: sticky; top: 5rem; }
}

/* ---------- carrito ---------- */
.cart-page { max-width: 640px; margin: 0 auto; }
.cart-lines { border-top: 1px solid var(--border); }
.cart-line {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 0; border-bottom: 1px solid var(--border);
}
.cart-line-img { width: 3.5rem; height: 3.5rem; border-radius: var(--radius-input); object-fit: cover; flex: none; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { margin: 0 0 0.375rem; font-size: 0.875rem; }
.cart-line-total { display: flex; flex-direction: column; align-items: flex-end; gap: 0.375rem; font-family: Archivo, sans-serif; font-weight: 800; }
.cart-total-bar {
  position: sticky; bottom: 0; margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--accent-soft); border-radius: var(--radius-card); padding: 1rem;
}
.cart-total-usd { font-family: Archivo, sans-serif; font-weight: 800; font-size: 1.5rem; margin: 0; }

/* ---------- checkout ---------- */
.checkout-page { max-width: 480px; margin: 0 auto; }
.order-summary-collapsed { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; }

/* ---------- confirmacion ---------- */
.order-page { max-width: 480px; margin: 0 auto; text-align: center; }
.success-check {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; border-radius: 50%; background: var(--green);
  color: #FAF9F7; display: flex; align-items: center; justify-content: center; font-size: 1.75rem;
}
.order-code { font-family: Archivo, sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: 2px; margin: 0.25rem 0 0.75rem; }
.order-items { list-style: none; padding: 0; text-align: left; border-top: 1px solid var(--border); margin: 1rem 0; }
.order-items li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.order-total { font-family: Archivo, sans-serif; font-weight: 800; font-size: 1.125rem; }

/* ---------- landing del host fijo (criterio 227) ---------- */
.landing { max-width: 40rem; margin: 0 auto; padding: 4rem var(--page-x) 3rem; }
.landing p { color: var(--text-secondary); }
.landing .btn-primary { display: inline-flex; width: auto; padding: 0 1.25rem; margin-top: 0.5rem; }
.landing ol { padding-left: 1.25rem; }
.landing li { margin-bottom: 0.5rem; }
