:root {
  --ecopillo-blue: #1557c0;
  --ecopillo-blue-dark: #0f3e91;
  --ecopillo-text: #172033;
  --ecopillo-muted: #6f7b8f;
  --ecopillo-border: #e4e9f1;
  --ecopillo-bg: #ffffff;
  --ecopillo-soft: #f5f8fc;
  --ecopillo-shadow: 0 18px 55px rgba(25, 45, 85, .20);
}

/* Isolate Ecopillo from theme button/hover effects. */
#ecopillo-root,
#ecopillo-root * { box-sizing: border-box; }
#ecopillo-root button,
#ecopillo-root input,
#ecopillo-root a { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#ecopillo-root button {
  -webkit-appearance: none !important;
  appearance: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  filter: none !important;
  transform: none !important;
}
#ecopillo-root button::before,
#ecopillo-root button::after,
#ecopillo-root a::before,
#ecopillo-root a::after {
  content: none !important;
  display: none !important;
}

.ecopillo-root {
  position: fixed;
  right: var(--ecopillo-launcher-right, 18px);
  bottom: var(--ecopillo-launcher-bottom, 24px);
  z-index: 999999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Compact welcome bubble. It deliberately stays on two lines on desktop and mobile. */
.ecopillo-teaser {
  position: absolute !important;
  right: 70px !important;
  bottom: 25px !important;
  width: 176px !important;
  min-height: 54px !important;
  padding: 10px 13px !important;
  border: 1px solid #d9e3f1 !important;
  border-radius: 15px 15px 5px 15px !important;
  background: #fff !important;
  color: #20304d !important;
  box-shadow: 0 10px 28px rgba(25,45,85,.14) !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer;
  outline: none !important;
  white-space: normal !important;
}
.ecopillo-teaser:hover,
.ecopillo-teaser:focus,
.ecopillo-teaser:active {
  background: #fff !important;
  border-color: #cbd8eb !important;
  color: #152743 !important;
  box-shadow: 0 11px 30px rgba(25,45,85,.16) !important;
  transform: none !important;
}
.ecopillo-teaser:focus-visible { outline: 2px solid rgba(21,87,192,.25) !important; outline-offset: 3px !important; }

/* Transparent Ecopillo launcher. The independent native cart is left unchanged. */
.ecopillo-launcher {
  position: relative !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  width: 68px !important;
  height: 76px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  overflow: visible !important;
  outline: none !important;
}
.ecopillo-launcher img {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: contain;
  background: transparent !important;
  /* The source mascot has a near-white opaque canvas. Multiply visually merges
     that canvas with EcoFarma's light-gray page background, removing the square. */
  filter: drop-shadow(0 7px 11px rgba(22,42,84,.22));
  transform-origin: 50% 85%;
  transition: transform .16s ease, filter .16s ease;
}
.ecopillo-launcher:hover,
.ecopillo-launcher:focus,
.ecopillo-launcher:active {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}
.ecopillo-launcher:hover img,
.ecopillo-launcher:focus img {
  transform: translateY(-2px) scale(1.025);
  filter: drop-shadow(0 9px 13px rgba(22,42,84,.25));
}
.ecopillo-launcher:focus-visible { outline: 2px solid rgba(21,87,192,.25) !important; outline-offset: 3px !important; border-radius: 16px !important; }
.ecopillo-root.is-open .ecopillo-launcher,
.ecopillo-root.is-open .ecopillo-teaser { opacity: 0; pointer-events: none; visibility:hidden; }

/* The existing fixed basket is owned by WooCommerce, never styled or hidden here.
   Ecopillo positions itself above that basket using CSS variables on its own root. */


.ecopillo-panel {
  position: absolute;
  right: 0;
  bottom: 80px;
  width: min(404px, calc(100vw - 28px));
  height: min(600px, calc(100vh - 150px));
  min-height: 480px;
  background: var(--ecopillo-bg);
  border: 1px solid var(--ecopillo-border);
  border-radius: 20px;
  box-shadow: var(--ecopillo-shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
}
.ecopillo-panel[hidden] { display: none !important; }

.ecopillo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 66px;
  border-bottom: 1px solid var(--ecopillo-border);
  background: #fff;
}
.ecopillo-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 42px;
  background: #f7faff;
}
.ecopillo-avatar-wrap img { width: 100%; height: 100%; object-fit: contain; }
.ecopillo-header-copy { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.15; }
.ecopillo-header-copy strong { font-size: 15px; color: var(--ecopillo-text); font-weight: 750; }
.ecopillo-header-copy span { margin-top: 4px; font-size: 11px; color: var(--ecopillo-muted); }
.ecopillo-header-cart {
  position: relative !important;
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border: 1px solid #dce5f2 !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: #184fa8 !important;
  box-shadow: none !important;
  cursor: pointer;
  flex: 0 0 38px;
}
.ecopillo-header-cart svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ecopillo-header-cart .ecopillo-cart-count { top:-7px; right:-7px; }
.ecopillo-header-cart:hover,
.ecopillo-header-cart:focus,
.ecopillo-header-cart:active {
  background: #f7faff !important;
  border-color: #c7d8f1 !important;
  color: #123f8c !important;
  box-shadow: none !important;
  transform: none !important;
}
.ecopillo-header-cart:focus-visible { outline: 2px solid rgba(21,87,192,.25) !important; outline-offset: 2px !important; }

.ecopillo-close {
  margin-left: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #536079 !important;
  box-shadow: none !important;
  font-size: 22px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  cursor: pointer;
}
.ecopillo-close:hover,
.ecopillo-close:focus,
.ecopillo-close:active { background: #f1f4f8 !important; color: #25324a !important; box-shadow: none !important; }
.ecopillo-close:focus-visible { outline: 2px solid rgba(21,87,192,.25) !important; outline-offset: 2px !important; }

.ecopillo-messages {
  overflow-y: auto;
  padding: 14px 12px 10px;
  background: linear-gradient(180deg,#fbfdff 0%,#fff 22%);
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.ecopillo-row { display: flex; margin: 0 0 10px; }
.ecopillo-row.is-user { justify-content: flex-end; }
.ecopillo-bubble {
  max-width: 86%;
  border-radius: 15px;
  padding: 9px 11px;
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.ecopillo-row.is-assistant .ecopillo-bubble { background: #f1f5fb; color: var(--ecopillo-text); border-bottom-left-radius: 5px; }
.ecopillo-row.is-user .ecopillo-bubble { background: var(--ecopillo-blue); color: #fff; border-bottom-right-radius: 5px; }
.ecopillo-action-selection { display:flex; justify-content:flex-end; margin:0 0 10px; }
.ecopillo-action-selection span { display:inline-flex; max-width:86%; padding:7px 10px; border:1px solid #cfe0fb; border-radius:12px; background:#f7faff; color:#174b9b; font-size:11px; line-height:1.25; font-weight:750; }
.ecopillo-typing { display: flex; gap: 4px; align-items: center; height: 18px; }
.ecopillo-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8190a8; animation: ecopillo-dot 1.2s infinite ease-in-out; }
.ecopillo-typing span:nth-child(2){animation-delay:.15s}.ecopillo-typing span:nth-child(3){animation-delay:.3s}

.ecopillo-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.ecopillo-orders { display: grid; gap: 9px; margin: 0 0 12px; }
.ecopillo-product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--ecopillo-border);
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 14px rgba(18,41,82,.05);
}
.ecopillo-product-image { width: 100%; height: 82px; object-fit: contain; border-radius: 9px; background: #fff; }
.ecopillo-product-body { min-width: 0; display: flex; flex: 1 1 auto; flex-direction: column; }
.ecopillo-product-name {
  margin-top: 6px;
  min-height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 11.5px;
  line-height: 1.22;
  font-weight: 750;
  color: var(--ecopillo-text);
}
.ecopillo-product-facts,.ecopillo-product-meta {
  margin-top: 3px;
  min-height: 25px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 9.5px;
  color: var(--ecopillo-muted);
  line-height: 1.25;
}
.ecopillo-product-price { margin-top: 6px; font-size: 13px; font-weight: 800; color: #143d86; }
.ecopillo-product-stock { margin-top: 2px; font-size: 9.5px; font-weight: 700; }
.ecopillo-product-stock.is-in { color: #15834b; }.ecopillo-product-stock.is-out { color: #b33737; }
.ecopillo-product-actions { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: auto; padding-top: 7px; }
.ecopillo-btn { display: flex !important; align-items: center !important; justify-content: center !important; width: 100%; text-align: center; text-decoration: none !important; font-size: 9.5px; line-height: 1.15; font-weight: 750; border-radius: 8px; padding: 7px 6px; }
.ecopillo-btn-primary { background: var(--ecopillo-blue); color: #fff !important; }
.ecopillo-btn-secondary { background: #eef4ff; color: #174b9b !important; }
.ecopillo-more { display: inline-flex !important; align-items: center !important; justify-content: flex-start !important; width: auto !important; margin: -2px 0 12px !important; padding: 5px 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 11px !important; font-weight: 750 !important; color: var(--ecopillo-blue) !important; text-decoration: none !important; cursor: pointer; }
.ecopillo-more:hover,.ecopillo-more:focus,.ecopillo-more:active { background: transparent !important; color: var(--ecopillo-blue-dark) !important; box-shadow: none !important; transform: none !important; }
.ecopillo-results-note { margin: -2px 0 12px; padding: 8px 10px; border-radius: 10px; background: #f6f8fb; color: var(--ecopillo-muted); font-size: 10.5px; line-height: 1.35; }
.ecopillo-order-card { display: flex; flex-direction: column; gap: 3px; color: var(--ecopillo-text) !important; text-decoration: none !important; border: 1px solid var(--ecopillo-border); border-radius: 12px; padding: 10px 11px; background: #fff; }
.ecopillo-order-card strong { font-size: 12px; }.ecopillo-order-card span { font-size: 11px; color: var(--ecopillo-muted); }.ecopillo-order-total { font-weight: 700; color: #143d86 !important; }

.ecopillo-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.ecopillo-action-chip,
.ecopillo-quick-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #cfe0fb !important;
  background: #fff !important;
  color: #174b9b !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  padding: 8px 10px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  font-weight: 750 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer;
}
.ecopillo-action-chip:hover,
.ecopillo-action-chip:focus,
.ecopillo-quick-btn:hover,
.ecopillo-quick-btn:focus { background: #f3f7fd !important; border-color: #b9cff3 !important; color: #123f86 !important; box-shadow: none !important; }

.ecopillo-action-chip.is-whatsapp {
  background: #25D366 !important;
  border-color: #25D366 !important;
  color: #fff !important;
  font-weight: 800 !important;
}
.ecopillo-action-chip.is-whatsapp:hover,
.ecopillo-action-chip.is-whatsapp:focus,
.ecopillo-action-chip.is-whatsapp:active {
  background: #1fb85a !important;
  border-color: #1fb85a !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Four actions are always visible: no horizontal hidden carousel. */
.ecopillo-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #f0f2f6;
  background: #fff;
}
.ecopillo-quick-btn { width: 100% !important; min-height: 42px !important; white-space: normal !important; }

.ecopillo-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) 44px;
  gap: 7px;
  padding: 8px 10px 9px;
  border-top: 1px solid var(--ecopillo-border);
  background: #fff;
}
.ecopillo-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid #d8e0eb !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--ecopillo-text) !important;
  box-shadow: none !important;
  padding: 10px 11px !important;
  font-size: 13px !important;
  outline: none !important;
}
.ecopillo-form input:focus { border-color: #87ace8 !important; box-shadow: 0 0 0 3px rgba(21,87,192,.07) !important; }
.ecopillo-send {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--ecopillo-blue) !important;
  color: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
}
.ecopillo-send:hover,
.ecopillo-send:focus,
.ecopillo-send:active { background: var(--ecopillo-blue-dark) !important; color: #fff !important; box-shadow: none !important; }
.ecopillo-send svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ecopillo-send:disabled { opacity: .55; cursor: wait; }
.ecopillo-legal { padding: 0 12px 9px; font-size: 9.5px; line-height: 1.3; color: #8490a3; background: #fff; }

@keyframes ecopillo-wave { 0%,86%,100%{transform:rotate(0)} 90%{transform:rotate(-5deg)} 94%{transform:rotate(5deg)} 97%{transform:rotate(-2deg)} }
@keyframes ecopillo-dot { 0%,80%,100%{transform:translateY(0);opacity:.45} 40%{transform:translateY(-4px);opacity:1} }

/* The EcoFarma mobile dock is active up to 991px. Keep the CLOSED Ecopillo
   launcher above that dock across the same breakpoint. For 561-991px the
   panel stays at the same viewport position by compensating its relative
   bottom offset; at <=560px the panel already uses fixed positioning below. */
@media (min-width: 561px) and (max-width: 991px) {
  .ecopillo-root { right: var(--ecopillo-launcher-right, 12px); bottom: var(--ecopillo-launcher-bottom, calc(96px + env(safe-area-inset-bottom))); }
  .ecopillo-panel { bottom: 80px; }
}

@media (max-width: 560px) {
  .ecopillo-root { right: var(--ecopillo-launcher-right, 12px); bottom: var(--ecopillo-launcher-bottom, calc(96px + env(safe-area-inset-bottom))); }
  .ecopillo-launcher { width: 62px !important; height: 70px !important; }
  .ecopillo-launcher img { width: 62px; height: 62px; }
  .ecopillo-teaser { right: 63px !important; bottom: 25px !important; width: 164px !important; min-height: 52px !important; max-width: calc(100vw - 104px) !important; font-size: 11.5px !important; padding: 9px 11px !important; }
  .ecopillo-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: var(--ecopillo-panel-bottom-mobile, 76px);
    width: auto;
    height: min(72dvh, 590px, calc(100dvh - var(--ecopillo-panel-bottom-mobile, 76px) - 8px));
    min-height: min(455px, calc(100dvh - var(--ecopillo-panel-bottom-mobile, 76px) - 8px));
    border-radius: 18px;
  }
  .ecopillo-root.is-open .ecopillo-launcher, .ecopillo-root.is-open .ecopillo-teaser { visibility: hidden; }
  .ecopillo-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .ecopillo-product-card { padding: 7px; }
  .ecopillo-product-image { width: 100%; height: 72px; }
  .ecopillo-product-name { font-size: 10.8px; min-height: 40px; }
  .ecopillo-product-price { font-size: 12.5px; }
}

@media (max-width: 360px) {
  .ecopillo-quick { grid-template-columns: 1fr; }
  .ecopillo-panel { bottom: var(--ecopillo-panel-bottom-mobile, 70px); height: min(76dvh, 590px, calc(100dvh - var(--ecopillo-panel-bottom-mobile, 70px) - 8px)); }
}

@media (max-width: 330px) {
  .ecopillo-products { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ecopillo-typing span { animation: none !important; }
}

/* V1 cart action: same visual design, only disabled/loading behavior. */
#ecopillo-root .ecopillo-add-cart:disabled,
#ecopillo-root .ecopillo-add-cart.is-loading {
  opacity: .68 !important;
  cursor: wait !important;
  pointer-events: none !important;
}

/* 1.0.22: compact native-cart strip below input; no rules target the native cart/dock. */
#ecopillo-root .ecopillo-panel {
  display:flex; flex-direction:column; bottom:0; min-height:0;
  height:var(--ecopillo-panel-height, min(620px, calc(100dvh - 150px)));
  max-height:calc(100dvh - 16px);
}
#ecopillo-root .ecopillo-header, #ecopillo-root .ecopillo-quick,
#ecopillo-root .ecopillo-form, #ecopillo-root .ecopillo-legal { flex:0 0 auto; }
#ecopillo-root .ecopillo-messages { flex:1 1 auto; min-height:50px; overflow-y:auto; }
#ecopillo-root .ecopillo-mini-cart { display:flex; flex:0 0 auto; align-items:center; flex-wrap:wrap; gap:6px; padding:7px 10px; border-top:1px solid #dce6f4; background:#f2f7ff; color:#143b8b; }
#ecopillo-mini-summary { font-size:11px; font-weight:600; line-height:1.4; flex:1 1 140px; min-width:0; overflow-wrap:anywhere; }
#ecopillo-root .ecopillo-mini-actions { display:flex; gap:5px; align-items:center; }
#ecopillo-root .ecopillo-mini-actions button, #ecopillo-root .ecopillo-mini-actions a { display:inline-flex; align-items:center; justify-content:center; height:34px; min-width:34px!important; padding:0 9px!important; border-radius:9px; border:1px solid #c8d8f1!important; background:#fff!important; color:#153f94!important; font-size:11px; line-height:1; font-weight:700; text-decoration:none; cursor:pointer; box-shadow:none!important; }
#ecopillo-root #ecopillo-mini-pay { background:#1557c0!important; border-color:#1557c0!important; color:#fff!important; }
#ecopillo-root #ecopillo-mini-empty { color:#c33333!important; }
#ecopillo-mini-empty svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
#ecopillo-root .ecopillo-mini-actions [disabled], #ecopillo-root .ecopillo-mini-actions [aria-disabled="true"] { opacity:.45; cursor:not-allowed; }
#ecopillo-mini-status { flex-basis:100%; font-size:9px; color:#58647c; line-height:1.3; }
#ecopillo-root .ecopillo-review-note { font-size:10px; line-height:1.3; color:#815900; margin:5px 0; }
#ecopillo-root .ecopillo-quick { grid-template-columns:repeat(2,minmax(0,1fr)); }
#ecopillo-root .ecopillo-mini-actions :focus-visible { outline:2px solid #1557c0!important; outline-offset:2px; }
@media(max-width:991px) {
  #ecopillo-root .ecopillo-panel { position:fixed; left:auto; right:8px; bottom:var(--ecopillo-panel-bottom-mobile,162px); width:min(404px,calc(100vw - 16px)); border-radius:18px; min-height:0; }
  #ecopillo-root.has-keyboard .ecopillo-panel { top:var(--ecopillo-panel-top,8px); bottom:auto; }
  #ecopillo-root .ecopillo-form input { font-size:16px!important; }
}
@media(max-width:560px) { #ecopillo-root .ecopillo-panel { left:8px; right:8px; width:auto; } }
@media(max-height:560px) {
  #ecopillo-root .ecopillo-header { min-height:44px; padding:5px 10px; }
  #ecopillo-root .ecopillo-avatar-wrap { width:30px; height:30px; flex-basis:30px; }
  #ecopillo-root .ecopillo-quick { padding:4px 8px; gap:4px; }
  #ecopillo-root .ecopillo-quick-btn { min-height:28px!important; padding:4px!important; font-size:10px!important; }
  #ecopillo-root .ecopillo-form { padding:4px 8px; }
  #ecopillo-root .ecopillo-legal { padding-bottom:4px; font-size:8px; }
}
