/* Bloque 1: Variables de Entorno, Reset y Estilos Globales */

:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #617182;
  --line: #d9e0e6;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --tag: #eef4f1;
  --shadow: 0 16px 42px rgba(31, 41, 51, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: clamp(1.4rem, 2.5vw, 2.55rem);
  line-height: 1.1;
  font-weight: 800;
}

/* Bloque 2: Toolbar Principal y Buscador Global */



.searchContainer {
  position: sticky;
  top: 0;
  z-index:var(--z-header);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.searchBox {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  min-height: 54px;
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 28px;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.searchBox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.searchIcon {
  display: grid;
  place-items: center;
}

.searchIcon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #4b5563;
  stroke-width: 2;
  stroke-linecap: round;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 0 16px 0 0;
}

input::placeholder {
  color: #9ca3af;
}

#searchInput {
  position: relative;
}

.filterToggleBtn {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  background-color: #ffffff;
  color: #40474f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms ease;
}

.filterToggleBtn svg {
  width: 24px;
  height: 24px;
  fill: none;
}

.clearSearchBtn {
  position: absolute;
  right: 43px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.clearSearchBtn svg {
  width: 100%;
  height: 100%;
}

.clearSearchBtn circle {
  fill: #e5e5e5;
}

.clearSearchBtn path {
  stroke: rgb(161, 159, 159);
  stroke-width: 1;
  stroke-linecap: round;
  fill: none;
}

.hidden {
  display: none !important;
}

/* Bloque 3: Resúmenes de Filtros y Estados Vacíos (emptyState) */

.summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 14px;
  color: var(--muted);
}

.summary strong {
  color: var(--text);
}

.emptyState {
  padding: 40px 24px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.emptyState h2 { 
  font-size: 1.25rem; 
}

.emptyState p { 
  margin-top: 8px; 
  color: var(--muted); 
}

/* Bloque 4: Cuadrícula y Tarjetas de Productos (Estándar y is-featured) */

.productGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  padding-bottom:100px; /* espacio para el pie "Ver pedido" + aviso de compra mínima */
}

.productCard {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.07);
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1), 
              transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.productCard.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.productImage {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.productInfo {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.name {
  font-size: 1.08rem;
  line-height: 1.25;
  font-weight: 600;
}

.price {
  margin-top: 2px;
  color: var(--accent-strong);
  font-size: 1.32rem;
  font-weight: 700;
}

/* DISEÑO DESTACADO PREMIUM (Rige por el booleano 'destacado') */
.productCard.is-featured {
  grid-column: span 2;
  border: 2px solid #e11d48;
  box-shadow: 0 12px 28px rgba(225, 29, 72, 0.12);
}

.productCard.is-featured .productInfo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 24px 18px;
}

.productCard.is-featured .name {
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text);
}

.productCard.is-featured .price {
  color: var(--accent-strong);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Bloque 5: Cintas de Oferta (ribbon) y Botones del Carrito */

.ribbonContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 130px;
  height: 130px;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
}

.ribbonText {
  position: absolute;
  top: 25px;
  left: -35px;
  width: 170px;
  padding: 6px 0;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.ribbonText::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100% );
  transform: skewX(-30deg);
  animation: shine 3s infinite ease-in-out;
}

@keyframes shine {
  0% { left: -150%; }
  30% { left: 150%; }
  100% { left: 150%; }
}

.purchaseActions {
  width: 100%;
  margin-top: auto;
  padding-top: 6px;
  position: relative;
  height: 42px;
}

.addBtn, .counterControls {
  width: 180px;
  height: 42px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
  opacity: 1;
}

.addBtn.fade-out, .counterControls.fade-out {
  opacity: 0;
  transform: translateX(-50%) scale(0.92);
}

.addBtn.is-hidden, .counterControls.is-hidden {
  display: none !important;
  opacity: 0;
}

.addBtn {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.addBtn:hover:not(:disabled) { 
  background-color: var(--accent-strong); 
}

.addBtn:disabled { 
  background-color: var(--line); 
  color: var(--muted); 
  cursor: not-allowed; 
}

.counterControls {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  background-color: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}

.minusBtn, .plusBtn {
  background: none;
  border: none;
  color: var(--accent-strong);
  font-size: 1.4rem;
  font-weight: 700;
  height: 100%;
  width: 100%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.minusBtn:hover, .plusBtn:hover { 
  background-color: var(--line); 
}

.quantityValue { 
  text-align: center; 
  font-size: 1.1rem; 
  font-weight: 800; 
  color: var(--text); 
  user-select: none; 
}

/* Bloque 6: Estructura del Modal Lateral y Dropdowns Acoplados */

.modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
}

.modalOverlay[hidden] {
  display: none !important;
}

.modalSidebar {
  width: 100%;
  max-width: 360px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideIn 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
}

.modalHeader h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1f2937;
}

.closeModalBtn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #4b5563;
  cursor: pointer;
}

.modalContent {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filterGroup {
  position: relative;
  width: 100%;
}

.customSelectTrigger {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  background-color: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: all 160ms ease;
}

.customSelectTrigger:hover:not(:disabled) {
  background-color: #e5e7eb;
}

.customSelectTrigger:disabled {
  background-color: #e5e7eb;
  color: #9ca3af;
  opacity: 0.7;
  cursor: not-allowed;
}

.customSelectTrigger::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #4b5563;
  border-bottom: 2px solid #4b5563;
  transform: rotate(45deg);
  margin-left: 12px;
  display: inline-block;
  transition: transform 160ms ease;
}

.customSelectTrigger.is-active::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.customSelectTrigger.is-active {
  background-color: #ffffff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 0px !important;
  border-bottom-right-radius: 0px !important;
}

.optionsDropdown {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.optionsDropdown[hidden] {
  display: none !important;
}

/* Poner en gris formato disabled los articulos del listado de candidatos */

.searchSuggestionProductInfo {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.searchSuggestionProductStatus {
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 700;
}

.searchSuggestionProductDisabled {
  background: #eeeeee;
  color: #5f6368;
  cursor: default;
}

.searchSuggestionProductDisabled:hover {
  background: #eeeeee;
  transform: none;
}

.searchSuggestionProductDisabled .searchSuggestionProductName {
  color: #5f6368;
}

.searchSuggestionProductDisabled .searchSuggestionProductPrice {
  color: #6b7280;
}

/* ---------------------------- */

.optionsItem {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #4b5563;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 120ms ease;
}

.optionsItem:hover {
  background-color: #f3f4f6;
  color: var(--accent);
}

.optionsItem.is-selected {
  background-color: var(--tag);
  color: var(--accent-strong);
  font-weight: 700;
}

.optionsItem.clear-option {
  color: #ef4444;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 600;
}

.clearFiltersBtn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background-color: #ef4444;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.clearFiltersBtn:hover {
  background-color: #dc2626;
}

.clearFiltersBtn svg { 
  width: 18px; 
  height: 18px; 
}
/* ESTILO PARTICULAR PARA FILTRO ACTIVO */
.customSelectTrigger.has-filter {
  background-color: var(--tag) !important;
  border-color: var(--accent) !important;
  color: var(--accent-strong) !important;
  font-weight: 800;
  position: relative;
}

/* Indicador visual de burbuja (bade) arriba a la derecha */
.customSelectTrigger.has-filter::before {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background-color: #e11d48; /* Color rojo ribbon para que resalte */
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* Bloque 7: Botón Flotante de WhatsApp y Adaptación Móvil (@media) */

/* ===========================
   Botón flotante WhatsApp
=========================== */

.floatingWhatsApp {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,.20);
  z-index: 1000;
  text-decoration: none;
  transition: transform .15s ease,
              box-shadow .20s ease,
              opacity .25s ease;
}

.floatingWhatsApp:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}

.floatingWhatsApp:active {
  transform: scale(.96);
}

.whatsappIcon {
  width: 34px;
  height: 34px;
  fill: #ffffff;
}

.floatingWhatsApp.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.8);
}

@media (max-width: 720px) {
  .app { 
    width: min(100% - 20px, 1180px); 
    padding-top: 0px; 
  }
  .toolbar { 
    grid-template-columns: 1fr !important; 
    gap: 14px; 
    padding: 18px; 
  }
  .searchBox, .filterToggleBtn { 
    min-height: 48px; 
    height: 48px; 
  }
  .filterToggleBtn { 
    flex: 0 0 48px; 
    width: 48px; 
  }
  .summary { 
    align-items: flex-start; 
    flex-direction: column; 
  }
  .productGrid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 12px; 
    align-items: start; 
  }
  .productCard { 
    grid-template-rows: auto 1fr; 
  }
  .productCard.is-featured { 
    grid-column: span 2; 
  }
  .productImage { 
    height: auto; 
    aspect-ratio: 1 / 1; 
    object-fit: contain; 
    background: #ffffff; 
  }
  .productInfo { 
    gap: 8px; 
    padding: 10px; 
  }
  .name { 
    font-size: 0.9rem; 
  }
  .price { 
    font-size: 1.05rem; 
  }
  .productCard.is-featured .productInfo { 
    gap: 10px; 
    padding: 16px 12px; 
  }
  .productCard.is-featured .name { 
    font-size: 1.2rem; 
  }
  .productCard.is-featured .price { 
    font-size: 1.6rem; 
  }
  .purchaseActions { 
    padding-top: 4px; 
    height: 38px; 
  }
  .addBtn, .counterControls { 
    width: 130px; 
    height: 38px; 
    transform: translateX(-50%); 
  }
  .addBtn.fade-out, .counterControls.fade-out { 
    transform: translateX(-50%) scale(0.92); 
  }
  .addBtn { 
    font-size: 0.88rem; 
  }
  .counterControls { 
    grid-template-columns: 38px 1fr 38px; 
  }
  .minusBtn, .plusBtn { 
    font-size: 1.2rem; 
  }
  .quantityValue { 
    font-size: 1rem; 
  }
  .whatsappBtn { 
    bottom: 8px !important; 
    right: 8px !important; 
    width: 44px !important; 
    height: 44px !important; 
  }
  .whatsappBtn svg { 
    width: 24px !important; 
    height: 24px !important; 
  }
}

.outOfStock{
  background:#bdbdbd;
  color:#fff;
  cursor:default;
  opacity:.85;
}

.outOfStock:hover{
  transform:none;
  box-shadow:none;
}

/* ===========================
   Checkout Bar
=========================== */

.orderFooter {
  position: fixed;
  bottom: 0;
  background: #ffffff;
  padding: 5px 0px 0px 0px;
  left: 0;
  right: 0;
  width: 100%;
  transform: none;
  border-radius: 7px 7px 0 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,.12);
  z-index: 1000;
  transition: transform .25s ease, opacity .25s ease;
}

.orderSummaryBtn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #3d3d3d;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  transition:
    background .18s ease,
    transform .10s ease,
    box-shadow .18s ease;
  will-change: transform;
}

.orderSummaryBtn:hover {
  background: #4a4a4a;
}

.orderSummaryBtn:active {
  transform: scale(0.98);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
}

.orderText {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.orderTotal {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  white-space: nowrap;
  transition: transform .15s ease;
}

.orderTotal.pop {
  animation: totalPop .18s ease;
}

@keyframes totalPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.orderFooter.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 120%);
}

.searchBox {
  position: relative;
  display: flex;
  align-items: center;
}

#searchInput {
  width: 100%;
  padding-right: 55px;
}

/* BOTÓN DEL MICRÓFONO */
.voiceSearchBtn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 38px;
  height: 38px;

  padding: 0;
  margin: 0;

  border: 0;
  outline: none;
  background: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  color: #142338;

  z-index: 5;
}

/* ÍCONO DEL MICRÓFONO */
.voiceSearchBtn svg {
  width: 21px;
  height: 21px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;

  display: block;
}

/* AL PASAR EL MOUSE */
.voiceSearchBtn:hover {
  color: #007bff;
}

/* CUANDO ESTÁ ESCUCHANDO */
.voiceSearchBtn.listening {
  color: #e53935;
}

.voiceSearchBtn.listening svg {
  animation: micPulse 1s infinite;
}

@keyframes micPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

/* ELIMINAR LA X NATIVA DEL SEARCHINPUT */

#searchInput::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* ===========================
   Sugerencias del buscador
=========================== */

#searchSuggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1500;

  display: flex;
  flex-direction: column;

  width: 100%;
  max-height: 420px;
  overflow-y: auto;

  padding: 6px;

  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;

  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.14);
}

#searchSuggestions[hidden] {
  display: none !important;
}

.searchSuggestionItem {
  width: 100%;
  min-height: 42px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;

  gap: 12px;

  padding: 8px 12px;

  border: 0;
  border-radius: 9px;

  background: transparent;
  color: var(--text);

  text-align: left;

  cursor: pointer;

  transition:
    background-color 120ms ease,
    transform 100ms ease;
}

.searchSuggestionItem:hover {
  background: #f3f6f5;
}

.searchSuggestionItem:active {
  transform: scale(0.99);
}

.searchSuggestionName {
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 0.96rem;
  font-weight: 600;
}

.searchSuggestionCount {
  min-width: 34px;

  text-align: right;
  white-space: nowrap;

  color: var(--muted);

  font-size: 0.88rem;
  font-weight: 700;
}

/* ===========================
   Sugerencia individual
=========================== */

.searchSuggestionProduct {
  width: 100%;
  min-height: 52px;

  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;

  gap: 9px;

  padding: 5px 8px;

  border: 0;
  border-radius: 9px;

  background: transparent;

  color: var(--text);

  text-align: left;

  cursor: pointer;

  transition:
    background-color 120ms ease,
    transform 100ms ease;
}

.searchSuggestionProduct:hover {
  background: #f3f6f5;
}

.searchSuggestionProduct:active {
  transform: scale(0.99);
}

.searchSuggestionProductImage {
  width: 38px;
  height: 38px;

  object-fit: contain;

  border-radius: 6px;

  background: #ffffff;
}

.searchSuggestionProductName {
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;

  font-size: 0.91rem;
  line-height: 1.2;
  font-weight: 600;
}

.searchSuggestionProductPrice {
  white-space: nowrap;

  color: var(--accent-strong);

  font-size: 0.91rem;
  font-weight: 800;

  text-align: right;
}

/* ===========================
   Móvil
=========================== */

@media (max-width: 720px) {

  #searchSuggestions {
    max-height: 380px;
    padding: 5px;
  }

  .searchSuggestionItem {
    min-height: 40px;
    padding: 7px 10px;
  }

  .searchSuggestionName {
    font-size: 0.92rem;
  }

  .searchSuggestionCount {
    font-size: 0.84rem;
  }

  .searchSuggestionProduct {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 48px;
    gap: 8px;
    padding: 4px 7px;
  }

  .searchSuggestionProductImage {
    width: 34px;
    height: 34px;
  }

  .searchSuggestionProductName {
    font-size: 0.86rem;
  }

  .searchSuggestionProductPrice {
    font-size: 0.86rem;
  }

}

/* =====================================================
   AVISO DE CAMBIOS EN EL CARRITO
   (sin stock, cambio de precio, etc.)
   ===================================================== */

.avisoCarrito {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 2500;
  padding: 14px 16px;
  border-radius: 14px;
  background: #222222;
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: avisoCarritoEntrar 0.25s ease-out;
  cursor: pointer;
}

.avisoCarrito ul {
  margin: 8px 0 6px;
  padding-left: 18px;
}

.avisoCarrito li + li {
  margin-top: 4px;
}

.avisoCarritoCerrar {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: right;
}

@keyframes avisoCarritoEntrar {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* =====================================================
   FORMAS DE COMPRA (unidad / caja / bulto / pallet)
   Solo aparecen en productos con medida o con 2 precios.
   ===================================================== */

.formaSelector {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 280px;
  justify-self: center;
  padding: 3px;
  background: #eef1f0;
  border-radius: 999px;
}

.formaPastilla {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--accent);
  border-radius: 999px;
  transition: transform 280ms cubic-bezier(0.3, 0.7, 0.2, 1);
}

.formaSelector[data-forma="2"] .formaPastilla {
  transform: translateX(100%);
}

.formaSelector button {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 200ms;
}

.formaSelector button[aria-pressed="true"] {
  color: #ffffff;
}

.formaSelector button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.formaBotonTexto {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badgeBoton {
  flex: none;
  padding: 0 4px;
  font-size: 0.68rem;
  line-height: 1.4;
}

.formaSelector button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.precioSufijo {
  margin-left: 3px;
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 600;
}

.price.cambiando {
  animation: precioCambia 300ms ease;
}

@keyframes precioCambia {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.precioDetalle {
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.formaPista {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.badgeAhorro {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: #e11d48;
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.quantityValue.conMedida {
  font-size: 0.9rem;
}

/* Columnas: un precio debajo de cada botón del interruptor */
.formaColumnas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  max-width: 280px;
  justify-self: center;
  margin-top: -4px;
}

.formaColumna {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 4px 2px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background-color 200ms, border-color 200ms;
}

.formaColumna.activa {
  background: #eef7f5;
  border-color: #cfe7e2;
}

.formaColumna.cambiando .formaPrecio {
  animation: precioCambia 300ms ease;
}

.formaPrecio {
  color: var(--accent-strong);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.formaColumna.tentador .formaPrecio {
  color: #e11d48;
}

.formaTexto {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

/* Lo que vale una caja/bulto/pallet: mismo formato que "por caja 12u" */
.formaSubtotal {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Mismo precio por unidad y por caja: un solo precio centrado */
.mismoPrecio .price,
.mismoPrecio .precioDetalle {
  justify-self: center;
  text-align: center;
}

.mismoPrecio .precioDetalle {
  margin-top: -6px;
}

/* Pregunta "¿Querés comprar menos de 1 caja?" */
.formaPregunta {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #f5c26b;
  border-radius: 10px;
  background: #fff7e6;
  animation: precioCambia 220ms ease;
}

.formaPreguntaTexto {
  margin: 0;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.formaPreguntaBotones {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.formaPreguntaSi,
.formaPreguntaNo {
  padding: 7px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.formaPreguntaSi {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.formaPreguntaNo {
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

@media (max-width: 720px) {
  .formaSelector button {
    padding: 6px 2px;
    font-size: 0.72rem;
  }

  .precioDetalle,
  .formaPista {
    font-size: 0.72rem;
  }

  .formaPrecio {
    font-size: 0.95rem;
  }

  .formaTexto,
  .formaSubtotal,
  .formaPreguntaSi,
  .formaPreguntaNo {
    font-size: 0.7rem;
  }

  .formaPreguntaTexto {
    font-size: 0.74rem;
  }

  .quantityValue.conMedida {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .formaPastilla,
  .price.cambiando {
    transition: none;
    animation: none;
  }
}

/* Lo oculto se oculta siempre, aunque tenga display propio */
.conFormas .formaPregunta[hidden],
.conFormas .formaSubtotal[hidden],
.conFormas .badgeBoton[hidden],
.conFormas .formaPista[hidden],
.conFormas .precioDetalle[hidden],
.conFormas .price[hidden] {
  display: none !important;
}


/* =====================================================
   SEPARADORES Y POSTERS (campo TipoMuestra)
   ===================================================== */

.catalogoSeparador {
  --color-barra: var(--color-principal, #FFA500);
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 46px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--color-barra);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.catalogoSeparador:first-child {
  margin-top: 0;
}

.catalogoSeparador h2 {
  margin: 0;
  color: #ffffff;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mensaje institucional: llena el hueco antes de una categoría nueva.
   La foto (o el texto) entra desde la derecha dentro de su marco. */
.institucional {
  align-self: stretch;
  min-height: 160px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--color-principal, #FFA500);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.institucionalContenido {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(105%);
}

.institucionalEntrando .institucionalContenido {
  animation: institucionalEntrar 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.institucionalVisto .institucionalContenido {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .institucionalContenido {
    opacity: 1;
    transform: none;
  }
}

@keyframes institucionalEntrar {
  from { opacity: 0; transform: translateX(105%); }
  to   { opacity: 1; transform: none; }
}

.institucionalImagen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sin foto: tarjeta naranja con ícono, título y texto */
.institucionalTexto {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  color: #ffffff;
  text-align: center;
  font-family: "Fredoka", system-ui, sans-serif;
}

.institucionalIcono {
  font-size: 3rem;
  line-height: 1;
}

.institucionalLogo {
  width: 70%;
  max-width: 160px;
  height: auto;
}

.institucionalTitulo {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  overflow-wrap: break-word;
  hyphens: auto;
}

.institucionalDetalle {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Manito: señala al producto destacado de la fila de abajo */
.manitoDestacado {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  padding: 14px 10px;
  border: 2px dashed #e11d48;
  border-radius: 18px;
  background: linear-gradient(160deg, #fff7c2 0%, #ffe066 100%);
  color: #b4123a;
  font-family: "Fredoka", system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.12);
}

.manitoTexto {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.manitoMano {
  font-size: 3rem;
  line-height: 1;
  animation: manitoSaltar 2.4s ease-in-out infinite;
}

.manitoPista {
  font-size: 0.85rem;
  font-weight: 500;
  color: #7a2a00;
}

/* Salta un par de veces y descansa */
@keyframes manitoSaltar {
  0%, 40%, 100% { transform: translateY(0); }
  10%, 30%      { transform: translateY(12px); }
  20%           { transform: translateY(2px); }
}

/* El destacado brilla un momento al tocar la manito */
.destacadoSenalado {
  animation: destacadoBrillar 1.3s ease-out;
}

@keyframes destacadoBrillar {
  0%   { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6); }
  40%  { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0.25); }
  100% { box-shadow: 0 12px 28px rgba(225, 29, 72, 0.12); }
}

/* Al buscar o filtrar: los destacados van de ancho normal (conservan borde y cinta) */
.productGrid.modoBusqueda .productCard.is-featured {
  grid-column: span 1;
}

/* Poster destacado que no entra en la fila: se muestra de ancho normal */
.productCard.posterCard.is-featured.posterAchicado {
  grid-column: span 1;
}

.posterCard {
  display: block;
  padding: 0;
}

.posterMarco {
  position: relative;
}

.posterImagen {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #ffffff;
}

/* Precio de las variedades: abajo a la izquierda, rojo y amarillo.
   Va arriba del botón "Ver variedades" para no taparse. */
.posterPrecio {
  position: absolute;
  left: 10px;
  bottom: 62px;
  z-index: 1;

  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 12px 5px;

  border-radius: 12px;
  background: #e11d48;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.35);
  transform: rotate(-4deg);

  color: #FFE14D;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 0 rgba(120, 0, 20, 0.35);
  pointer-events: none;
}

.posterPrecio small {
  font-size: 0.45em;
  font-weight: 700;
  opacity: 0.95;
}

/* Botón "Ver variedades": píldora encima del poster, abajo y centrada */
.posterVariedades {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);

  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 8px 10px 8px 16px;

  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), 0 1px 0 rgba(255, 255, 255, 0.9) inset;

  color: var(--accent-strong);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.posterVariedades:active {
  transform: translateX(-50%) scale(0.96);
}

.posterVariedades:focus-visible {
  outline: 3px solid var(--color-principal, #FFA500);
  outline-offset: 2px;
}

.posterVariedadesTexto {
  overflow: hidden;
  text-overflow: ellipsis;
}

.posterVariedadesCantidad {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.posterVariedadesFlecha {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 999px;
  background: #eef7f5;
  transition: transform 0.25s ease;
}

.posterCard.abierto .posterVariedades {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.posterCard.abierto .posterVariedadesCantidad {
  background: #ffffff;
  color: var(--accent-strong);
}

.posterCard.abierto .posterVariedadesFlecha {
  transform: rotate(180deg);
  background: rgba(255, 255, 255, 0.2);
}

/* Variedades desplegadas: aparecen y desaparecen suave */
.productCard.variedad {
  border-color: #cfe7e2;
}

.variedadEntrando {
  animation: variedadEntrar 0.28s ease both;
}

.variedadSaliendo {
  animation: variedadSalir 0.22s ease both;
  pointer-events: none;
}

@keyframes variedadEntrar {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes variedadSalir {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
  .variedadEntrando,
  .variedadSaliendo,
  .institucionalContenido,
  .manitoMano,
  .destacadoSenalado,
  .posterVariedadesFlecha {
    animation: none;
    transition: none;
  }
}

@media (max-width: 720px) {
  .catalogoSeparador {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
  }

  .catalogoSeparador h2 {
    font-size: 1.1rem;
  }

  .institucionalTitulo {
    font-size: 1.2rem;
  }

  .manitoTexto {
    font-size: 1.1rem;
  }

  .manitoMano {
    font-size: 2.6rem;
  }

  .posterCard.posterAchicado .posterPrecio {
    font-size: 1.15rem;
    padding: 3px 8px 4px;
  }

  /* Posters de ancho normal: botón más compacto para que entre el texto */
  .posterCard:not(.is-featured) .posterVariedades,
  .posterCard.posterAchicado .posterVariedades {
    gap: 5px;
    padding: 6px 6px 6px 11px;
    font-size: 0.78rem;
  }

  .posterCard:not(.is-featured) .posterVariedadesFlecha,
  .posterCard.posterAchicado .posterVariedadesFlecha,
  .posterCard:not(.is-featured) .posterTextoExtra,
  .posterCard.posterAchicado .posterTextoExtra {
    display: none;
  }

  .posterPrecio {
    bottom: 54px;
    font-size: 1.55rem;
  }

  .posterCard:not(.is-featured) .posterPrecio {
    font-size: 1.15rem;
    padding: 3px 8px 4px;
  }

  .posterVariedades {
    bottom: 10px;
    padding: 7px 8px 7px 14px;
    font-size: 0.82rem;
  }
}
