/* ============================================================
   Botánika — Micro-sitio web móvil (estilos base)
   Layer sobre Tailwind CDN. Tokens heredados del Design System.
   ============================================================ */

:root {
  --shadow-soft: 0px 10px 30px rgba(45, 71, 57, 0.08);
  --shadow-soft-sm: 0px 4px 16px rgba(45, 71, 57, 0.06);
  --shadow-cta: 0px 10px 20px rgba(144, 75, 51, 0.20);
  --radius-card: 24px;
  --radius-pill: 9999px;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", sans-serif;
  background-color: #fbf9f4;
  color: #1b1c19;
  /* evita rebote horizontal en el in-app browser de WhatsApp */
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Overlay botánico sutil (puntos) */
.botanical-overlay {
  background-image: radial-gradient(circle at 2px 2px, rgba(23, 49, 36, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Glass card label */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================================
   Top Bar
   ============================================================ */
#topbar.scrolled {
  background: #fbf9f4;
  box-shadow: var(--shadow-soft-sm);
}

/* ============================================================
   Navegación inferior
   ============================================================ */
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: #424844;
  transition: transform .2s ease, background-color .2s ease;
}
.nav-item:active { transform: scale(0.9); }
.nav-icon { font-size: 24px; }
.nav-label { font-size: 12px; line-height: 16px; font-weight: 500; }

.nav-item.is-active {
  background: #fea587;
  color: #783922;
}
.nav-item.is-active .nav-icon {
  font-variation-settings: 'FILL' 1, 'wght' 500;
}

/* ============================================================
   Tarjetas de producto (lista horizontal)
   ============================================================ */
.product-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-soft-sm);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:active { transform: scale(0.98); }

.product-card__img-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 20%, #ccead6 0%, #f5f3ee 70%, #e4e2dd 100%);
}
.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .3s ease;
}
.product-card__img.img-broken { opacity: 0; }

.product-card__body { flex: 1; min-width: 0; }
.product-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #1b1c19;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card__desc {
  font-size: 12px;
  line-height: 16px;
  color: #424844;
  margin: 2px 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-card__price {
  color: #173124;
  font-weight: 700;
  font-size: 15px;
}

.btn-add-mini {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: #fea587;
  color: #783922;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn-add-mini:active { transform: scale(0.9); }
.btn-add-mini .material-symbols-outlined { font-size: 22px; }

.chip-destacado {
  position: absolute;
  top: 4px;
  left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: #173124;
  color: #ffb59c;
}
.chip-destacado .material-symbols-outlined { font-size: 14px; }

/* ============================================================
   Tarjeta destacada (bento horizontal)
   ============================================================ */
.featured-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f5f3ee;
  border-radius: var(--radius-card);
  padding: 20px;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.featured-card:active { transform: scale(0.98); }
.featured-card:hover { background: #f0eee9; }

.featured-card__img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 20%, #ccead6 0%, #f5f3ee 70%, #e4e2dd 100%);
}
.featured-card__img img { width: 100%; height: 100%; object-fit: cover; }
.featured-card__img img.img-broken { opacity: 0; }

/* ============================================================
   Categoría hero (tarjetas grandes con overlay)
   ============================================================ */
.cat-hero {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: none;
  cursor: pointer;
  transition: transform .2s ease;
}
.cat-hero:active { transform: scale(0.97); }
.cat-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: radial-gradient(circle at 30% 20%, #ccead6 0%, #f5f3ee 70%, #e4e2dd 100%);
}
.cat-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(23,49,36,0.82) 0%, rgba(23,49,36,0.1) 55%, transparent 100%);
}
.cat-hero__label {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 20px;
  text-align: left;
}
.cat-hero__label h3 { color: #fff; font-family: "Playfair Display"; font-size: 24px; line-height: 32px; font-weight: 600; }
.cat-hero__label p { color: rgba(204, 234, 214, 0.9); font-size: 12px; line-height: 16px; margin-top: 2px; }
.cat-hero__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #fea587;
  color: #783922;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

/* ============================================================
   Chips de categoría (pills horizontales con scroll)
   ============================================================ */
.chips-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips-bar::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: #ccead6;
  color: #062014;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  border: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.chip:active { transform: scale(0.95); }
.chip.is-active {
  background: #173124;
  color: #fff;
}

/* ============================================================
   Detalle de producto
   ============================================================ */
.detalle-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #ccead6 0%, #f5f3ee 70%, #e4e2dd 100%);
  box-shadow: var(--shadow-soft);
}
.detalle-hero img { width: 100%; height: 100%; object-fit: cover; }
.detalle-hero img.img-broken { opacity: 0; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid #c2c8c2;
  border-radius: 12px;
  background: #f5f3ee;
  overflow: hidden;
}
.qty-stepper button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #173124;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s ease;
}
.qty-stepper button:active { background: #e4e2dd; }
.qty-stepper .qty-val {
  width: 48px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

/* ============================================================
   Carrito / Checkout
   ============================================================ */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #c2c8c2;
  border-radius: 14px;
  padding: 12px;
}
.cart-item__img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 20%, #ccead6 0%, #f5f3ee 70%, #e4e2dd 100%);
}
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__img img.img-broken { opacity: 0; }

.field-input {
  width: 100%;
  background: #ffffff;
  border: 2px solid #e4e2dd;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 24px;
  color: #1b1c19;
  transition: border-color .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus {
  outline: none;
  border-color: #173124;
}
.field-input::placeholder { color: rgba(66, 72, 68, 0.6); }
textarea.field-input { min-height: 100px; resize: vertical; }

/* ============================================================
   Botones
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-primary {
  background: #904b33;
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: transparent;
  color: #173124;
  border: 1.5px solid #173124;
}

.btn-ghost {
  background: transparent;
  color: #424844;
  width: auto;
  padding: 8px 12px;
}

.btn-success {
  background: #173124;
  color: #fff;
}

/* ============================================================
   Tarjeta resumen (precio)
   ============================================================ */
.summary-card {
  background: #f5f3ee;
  border-radius: var(--radius-card);
  padding: 20px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #173124;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(23,49,36,0.25);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90vw;
  animation: toast-in .25s ease;
}
.toast.hidden { display: none; }
.toast .material-symbols-outlined { font-size: 20px; color: #fea587; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   Loader inicial (hoja girando)
   ============================================================ */
.loader-leaf {
  width: 48px;
  height: 48px;
  border: 3px solid #ccead6;
  border-top-color: #173124;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#global-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

/* ============================================================
   Animaciones de entrada de tarjetas
   ============================================================ */
.fade-in { animation: fade-in .4s ease both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger > * { animation: fade-in .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.10s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.30s; }

/* ============================================================
   Estado vacío
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #424844;
}
.empty-state .empty-icon {
  font-size: 64px;
  color: #b0cdbb;
  display: block;
  margin: 0 auto 12px;
}
.empty-state h3 {
  font-family: "Playfair Display";
  font-size: 20px;
  color: #173124;
  margin-bottom: 6px;
}

/* Accesibilidad: respeta reduce-motion */
/* Icono girando (estado de carga inline) */
.spin {
  animation: spin 0.9s linear infinite;
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}