:root {
  /* Deep Forest — Pantone 5605 C (AURA / Café Ganoderma) */
  --primary: #22372b;
  --primary-soft: #2f4a3a;
  --accent: #3d5c4a;
  --bg: #f7f5f2;
  --cream: #f7f5f2;
  --cream-light: #fbfaf8;
  --cream-card: #ffffff;
  --forest: #22372b;
  --forest-deep: #1a2b22;
  --gold: #3d5c4a;
  --gold-soft: #5a7a68;
  --coffee: #2f4a3a;
  --moss: #3d5c4a;
  --text: #1a1a1a;
  --text-muted: #6b736e;
  --white: #ffffff;
  --line: rgba(34, 55, 43, 0.12);
  --shadow-soft: 0 10px 28px rgba(34, 55, 43, 0.1);
  --shadow-node: 0 6px 18px rgba(34, 55, 43, 0.12);
  --radius: 4px;
  --radius-pill: 999px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-body: var(--font-ui);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

ul {
  list-style: none;
}

.app-shell {
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.cg-cart-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 1200;
  background: var(--primary, #22372b);
  color: #fff;
  padding: 0.7rem 1.15rem;
  font-size: 0.9rem;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: min(90vw, 360px);
  text-align: center;
}

.cg-cart-toast.is-err {
  background: #8b2e24;
}

/* Botones (tienda, checkout, carrito — no solo landing) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 2px;
  padding: 0.85rem 1.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}

.cg-cart-toast[hidden] {
  display: none !important;
}

button.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

/* Carrito lateral derecho */
body.cart-drawer-open {
  overflow: hidden;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}

.cart-drawer.is-open {
  pointer-events: auto;
}

.cart-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 55, 43, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cart-drawer.is-open .cart-drawer__backdrop {
  opacity: 1;
}

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--bg, #f7f5f2);
  color: var(--text, #1a1a1a);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-drawer.is-open .cart-drawer__panel {
  transform: translateX(0);
}

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid var(--line, rgba(34, 55, 43, 0.12));
}

.cart-drawer__head h2 {
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary, #22372b);
}

.cart-drawer__close {
  border: 0;
  background: none;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted, #6b736e);
}

.cart-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.15rem;
}

.cart-drawer__empty {
  text-align: center;
  color: var(--text-muted, #6b736e);
  padding: 2rem 0.5rem;
  line-height: 1.6;
}

.cart-drawer__empty a {
  color: var(--primary, #22372b);
  font-weight: 600;
  text-decoration: underline;
}

.cart-drawer__line {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line, rgba(34, 55, 43, 0.12));
}

.cart-drawer__info {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cart-drawer__info strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.cart-drawer__info span {
  font-size: 0.78rem;
  color: var(--text-muted, #6b736e);
}

.cart-drawer__qty {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-drawer__qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line, rgba(34, 55, 43, 0.2));
  background: #fff;
  color: var(--primary, #22372b);
  cursor: pointer;
}

.cart-drawer__qty em {
  font-style: normal;
  min-width: 1.2rem;
  text-align: center;
  font-size: 0.9rem;
}

.cart-drawer__line-total {
  font-size: 0.9rem;
  color: var(--primary, #22372b);
}

.cart-drawer__remove {
  border: 0;
  background: none;
  font-size: 1.25rem;
  color: var(--text-muted, #6b736e);
  cursor: pointer;
  line-height: 1;
}

.cart-drawer__foot {
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid var(--line, rgba(34, 55, 43, 0.12));
  display: grid;
  gap: 0.65rem;
}

.cart-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.05rem;
}

.cart-drawer__checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: var(--primary, #22372b);
  color: #fff !important;
  border: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.cart-drawer__clear {
  border: 0;
  background: none;
  color: var(--text-muted, #6b736e);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem;
}

/* WhatsApp flotante (landing + sitio público) */
.wa-float {
  position: fixed;
  right: max(1.15rem, env(safe-area-inset-right));
  bottom: max(1.25rem, calc(1rem + env(safe-area-inset-bottom)));
  z-index: 9500;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.55rem;
  min-width: 58px;
  height: auto;
  min-height: 58px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: none;
  transition: transform 0.2s ease;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto;
}

.wa-float:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.wa-float__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.wa-float__icon svg {
  width: 28px;
  height: 28px;
}

.wa-float__chip {
  position: static;
  display: inline-block;
  max-width: min(220px, 58vw);
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.55rem 0.85rem;
  overflow: visible;
  clip: auto;
  border: 0;
  border-radius: 999px;
  background: #123d32;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: normal;
  text-align: center;
  box-shadow: 0 8px 20px rgba(18, 61, 50, 0.28);
}

.wa-float:hover .wa-float__chip,
.wa-float:focus-visible .wa-float__chip {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: normal;
  padding: 0.55rem 0.85rem;
}

@media (min-width: 768px) {
  .wa-float__chip {
    max-width: 260px;
    font-size: 0.82rem;
  }
}

.wa-float--pulse .wa-float__icon {
  animation: waPulse 2.8s ease-in-out infinite;
}

.wa-float--pulse:hover .wa-float__icon {
  animation: none;
}

.wa-float:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55);
}

.wa-float__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}

.wa-float__icon svg {
  width: 28px;
  height: 28px;
}

.wa-float__chip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 768px) {
  .wa-float:hover .wa-float__chip,
  .wa-float:focus-visible .wa-float__chip {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-right: 0.35rem;
  }
}

.wa-float--pulse .wa-float__icon {
  animation: waPulse 2.8s ease-in-out infinite;
}

.wa-float--pulse:hover .wa-float__icon {
  animation: none;
}

@keyframes waPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.62);
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float,
  .wa-float--pulse {
    animation: none !important;
  }
}

/* Carrito flotante (móvil): espejo de WhatsApp, abajo a la izquierda */
.cart-float {
  display: none;
}

@media (max-width: 900px) {
  .cart-float {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left));
    bottom: max(0.85rem, calc(0.65rem + env(safe-area-inset-bottom)));
    z-index: 9490;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none !important;
    color: #fff !important;
    pointer-events: auto;
  }

  .cart-float__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #22372b;
    box-shadow: 0 8px 24px rgba(34, 55, 43, 0.4);
    color: #fff;
  }

  .cart-float__svg {
    width: 24px;
    height: 24px;
  }

  .cart-float__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #c9a15d;
    color: #1a1a1a;
    font-size: 0.68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 2px #f7f5f2;
  }

  .cart-float--empty .cart-float__badge {
    opacity: 0.55;
  }

  .cart-float__chip {
    display: inline-block;
    max-width: min(120px, 38vw);
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: #123d32;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 8px 20px rgba(18, 61, 50, 0.28);
  }
}
