/* Jerarquía de lectura de las tarjetas de Recién llegado. */
body.page-index #homeProducts .product-card .product-info {
  gap: 0 !important;
}

body.page-index #homeProducts .product-card .product-info .product-name {
  order: 0;
  min-height: 0 !important;
  color: #20382b !important;
  font-family: Arial, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

body.page-index #homeProducts .product-card .product-info .product-meta {
  order: 1;
  margin: 4px 0 0 !important;
  color: #626e63 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
}

body.page-index #homeProducts .product-card .product-info .product-discount-prices {
  order: 2;
  margin: 8px 0 0 !important;
}

body.page-index #homeProducts .product-card .product-info .nm-price-installments {
  order: 3;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  margin: 9px 0 0 !important;
  padding: 0 !important;
}

/* El precio contado es la referencia principal. */
body.page-index #homeProducts .product-card .nm-price-installments .product-envio {
  order: 0;
  margin: 0 !important;
  color: #20382b !important;
  line-height: 1.25 !important;
}

body.page-index #homeProducts .product-card .nm-price-installments .nm-contado {
  color: #20382b !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

/* Las cuotas quedan juntas, debajo del contado. */
body.page-index #homeProducts .product-card .nm-price-installments .nm-pago-cuotas {
  order: 1;
  margin: 6px 0 0 !important;
}

body.page-index #homeProducts .product-card .nm-price-installments .nm-cuotas-row {
  flex-wrap: wrap !important;
  gap: 2px 10px !important;
  white-space: normal !important;
}

body.page-index #homeProducts .product-card .nm-price-installments .nm-cuotas-row strong {
  color: #365a4d !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

body.page-index #homeProducts .product-card .nm-price-installments .nm-cuota-mp {
  margin: 2px 0 0 !important;
  color: #626e63 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

body.page-index #homeProducts .product-card .nm-price-installments .nm-envio-incluido {
  order: -1;
  align-self: flex-start;
  margin: 0 0 9px !important;
  padding: 4px 8px !important;
  border: 1px solid #afc5b0;
  border-radius: 5px;
  background: #e8f2e7;
  color: #244b36 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

/* Cuando no hay cuotas, el valor ya aparece en la línea de contado. */
body.page-index #homeProducts .product-card .nm-price-installments > strong {
  display: none !important;
}

body.page-index #homeProducts .product-card .product-info .product-add {
  order: 4;
  margin-top: auto !important;
}

@media (max-width: 600px) {
  body.page-index #homeProducts .product-card .product-info .product-name {
    font-size: 14px !important;
    line-height: 1.28 !important;
  }

  body.page-index #homeProducts .product-card .product-info .product-meta {
    font-size: 10px !important;
  }

  body.page-index #homeProducts .product-card .nm-price-installments .nm-contado {
    font-size: 15px !important;
  }

  body.page-index #homeProducts .product-card .nm-price-installments .nm-cuotas-row strong,
  body.page-index #homeProducts .product-card .nm-price-installments .nm-cuota-mp {
    font-size: 10px !important;
  }

  body.page-index #homeProducts .product-card .nm-price-installments .nm-envio-incluido {
    font-size: 11px !important;
  }
}

/* Recién llegado: cuatro tarjetas proporcionales por fila en escritorio. */
@media (min-width: 769px) {
  body.page-index #homeProducts {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* El movimiento pertenece a la tarjeta completa, no a la fotografía. */
body.page-index #homeProducts .product-card .product-media > img {
  transform: none !important;
}

@media (min-width: 769px) {
  body.page-index #homeProducts .product-card {
    position: relative;
    z-index: 0;
    overflow: visible;
    transform: none;
    transform-origin: center center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    border-color: #a78c65;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .99),
      inset 0 -1px 0 rgba(74, 53, 28, .22),
      0 4px 0 rgba(126, 99, 61, .82),
      0 13px 19px -5px rgba(44, 32, 18, .43),
      0 23px 34px -15px rgba(39, 31, 19, .42);
    transition: transform 260ms cubic-bezier(.22, .75, .26, 1),
                box-shadow 260ms cubic-bezier(.22, .75, .26, 1);
  }
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.page-index #homeProducts .product-card:hover,
  body.page-index #homeProducts .product-card:focus-within {
    z-index: 20;
    transform: perspective(900px) translate3d(0, -11px, 22px)
      rotateX(var(--nm-tilt-x, 3deg)) rotateY(var(--nm-tilt-y, -4deg)) scale(1.045);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 1),
      inset 0 -1px 0 rgba(74, 53, 28, .24),
      0 7px 0 rgba(126, 99, 61, .88),
      0 28px 42px -8px rgba(44, 32, 18, .56),
      0 48px 60px -20px rgba(39, 31, 19, .42);
  }

  body.page-index #homeProducts .product-card:hover .product-media,
  body.page-index #homeProducts .product-card:focus-within .product-media {
    transform: translateZ(16px);
  }

  body.page-index #homeProducts .product-card:hover .product-info,
  body.page-index #homeProducts .product-card:focus-within .product-info {
    transform: translateZ(11px);
  }

  body.page-index #homeProducts .product-media,
  body.page-index #homeProducts .product-info {
    transition: transform 260ms cubic-bezier(.22, .75, .26, 1);
  }
}

@media (min-width: 769px) and (prefers-reduced-motion: reduce) {
  body.page-index #homeProducts .product-card {
    transform: none;
    transition: none;
  }
  body.page-index #homeProducts .product-card:hover,
  body.page-index #homeProducts .product-card:focus-within {
    z-index: 20;
    transform: perspective(900px) translateY(-4px) rotateX(2deg) rotateY(-2deg);
    box-shadow: inset 0 1px 0 #fff, 0 6px 0 rgba(126, 99, 61, .8),
      0 23px 36px -8px rgba(44, 32, 18, .48);
  }
  body.page-index #homeProducts .product-media,
  body.page-index #homeProducts .product-info {
    transform: none;
    transition: none;
  }
}
