/* =========================================================
   NUEVAMANO · PAGINACIÓN + DESTACADAS V1
   ========================================================= */

/* ---------- Catálogo · 16 por página ---------- */

.nm-page-hidden {
  display: none !important;
}

.nm-catalog-pagination {
  margin: 42px 0 10px;
  padding: 24px 0 8px;
  border-top: 1px solid rgba(20, 17, 15, .12);
}

.nm-page-summary {
  margin-bottom: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
  color: rgba(20, 17, 15, .68);
}

.nm-page-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.nm-page-btn {
  min-width: 50px;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid rgba(20, 17, 15, .28);
  border-radius: 12px;
  background: #fffaf3;
  color: #14110f;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(20, 17, 15, .07);
  transition:
    transform .16s ease,
    background .16s ease,
    color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.nm-page-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #14110f;
  box-shadow: 0 8px 18px rgba(20, 17, 15, .12);
}

.nm-page-btn.is-current {
  background: #14110f;
  color: #fffaf3;
  border-color: #14110f;
  box-shadow: 0 7px 18px rgba(20, 17, 15, .22);
}

.nm-page-btn.is-wide {
  min-width: 128px;
}

.nm-page-btn:disabled {
  opacity: .35;
  cursor: default;
  box-shadow: none;
}

/* ---------- Home · Destacadas ---------- */

.nm-home-featured-v1 {
  overflow: hidden;
}

.nm-featured-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

.nm-featured-head h2 {
  margin-bottom: 5px;
}

.nm-featured-sub {
  margin: 0;
  max-width: 660px;
  color: rgba(20, 17, 15, .66);
}

.nm-featured-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.nm-featured-arrow {
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(20, 17, 15, .24);
  border-radius: 999px;
  background: #fffaf3;
  color: #14110f;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(20, 17, 15, .08);
  transition:
    transform .16s ease,
    background .16s ease,
    color .16s ease;
}

.nm-featured-arrow:hover {
  transform: translateY(-2px);
  background: #14110f;
  color: #fffaf3;
}

.nm-featured-track {
  display: flex !important;
  gap: 22px !important;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 2px 18px;
  overscroll-behavior-inline: contain;
}

.nm-featured-track::-webkit-scrollbar {
  display: none;
}

.nm-featured-track > .nm-product {
  flex: 0 0 calc((100% - 66px) / 4) !important;
  min-width: 0;
  scroll-snap-align: start;
}

.nm-featured-foot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(20, 17, 15, .10);
  font-size: 13px;
  color: rgba(20, 17, 15, .62);
}

.nm-featured-foot a {
  color: #14110f;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 900px) {
  .nm-featured-track > .nm-product {
    flex-basis: calc((100% - 22px) / 2) !important;
  }
}

@media (max-width: 640px) {
  .nm-catalog-pagination {
    margin-top: 30px;
  }

  .nm-page-controls {
    gap: 8px;
  }

  .nm-page-btn {
    min-width: 46px;
    height: 46px;
    padding: 0 13px;
    border-radius: 11px;
  }

  .nm-page-btn.is-wide {
    min-width: 112px;
    font-size: 14px;
  }

  .nm-featured-head {
    align-items: center;
  }

  .nm-featured-head .eyebrow {
    font-size: 11px;
  }

  .nm-featured-sub {
    font-size: 14px;
  }

  .nm-featured-track {
    gap: 16px !important;
  }

  .nm-featured-track > .nm-product {
    flex: 0 0 min(78vw, 285px) !important;
  }

  .nm-featured-arrow {
    width: 44px;
    height: 44px;
  }

  .nm-featured-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

/* =========================================================
   NUEVAMANO · DESTACADAS PREMIUM V2
   ========================================================= */

.nm-home-featured-v1 {
  overflow: visible !important;
}

.nm-featured-premium-head {
  margin-bottom: 28px;
}

.nm-featured-premium-head h2 {
  margin: 4px 0 7px;
}

.nm-featured-premium-head p {
  margin: 0;
  max-width: 660px;
  color: rgba(20, 17, 15, .66);
}

.nm-featured-premium-grid {
  display: grid !important;
  grid-template-columns:
    repeat(3, minmax(0, 1fr)) !important;
  gap: 30px 26px !important;
  width: 100%;
}

.nm-featured-premium-card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  position: relative;
}

.nm-featured-premium-frame {
  position: relative;
  height: 100%;
  padding: 9px;
  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      #f7f0df,
      #e7dcc1
    );

  border: 2px solid #315f52;

  box-shadow:
    0 0 0 4px rgba(196, 161, 90, .26),
    0 12px 25px rgba(20, 17, 15, .10),
    0 3px 8px rgba(20, 17, 15, .07);

  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;
}

.nm-featured-premium-frame::before {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;

  border:
    1px solid rgba(196, 161, 90, .55);

  border-radius: 15px;
}

.nm-featured-premium-card:hover
.nm-featured-premium-frame {
  transform: translateY(-5px);

  border-color: #244d43;

  box-shadow:
    0 0 0 4px rgba(196, 161, 90, .38),
    0 18px 32px rgba(20, 17, 15, .16),
    0 5px 12px rgba(20, 17, 15, .09);
}

.nm-featured-premium-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 13px;

  background:
    linear-gradient(
      180deg,
      #eee5d3,
      #e8ddc6
    );
}

.nm-featured-premium-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;

  transition:
    transform .28s ease;
}

.nm-featured-premium-card:hover
.nm-featured-premium-image img {
  transform: scale(1.025);
}

.nm-featured-premium-name {
  position: relative;
  z-index: 1;

  min-height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 14px 10px 11px;

  text-align: center;

  font-size: 17px;
  line-height: 1.28;
  font-weight: 700;

  color: #274f45;
}

.nm-featured-premium-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;

  margin-top: 27px;
  padding-top: 18px;

  border-top:
    1px solid rgba(49, 95, 82, .18);

  font-size: 13px;
  color: rgba(20, 17, 15, .60);
}

.nm-featured-premium-footer a {
  color: #315f52;
  font-weight: 800;
  text-decoration: none;
}

.nm-featured-premium-footer a:hover {
  text-decoration: underline;
}

/* Anular layout viejo del carrusel anterior */

.nm-featured-track,
.nm-featured-actions,
.nm-featured-arrow,
.nm-featured-head,
.nm-featured-foot {
  display: none !important;
}

@media (max-width: 900px) {
  .nm-featured-premium-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;

    gap: 22px 18px !important;
  }
}

@media (max-width: 520px) {
  .nm-featured-premium-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;

    gap: 16px 12px !important;
  }

  .nm-featured-premium-frame {
    padding: 6px;
    border-radius: 15px;

    box-shadow:
      0 0 0 3px rgba(196, 161, 90, .24),
      0 8px 18px rgba(20, 17, 15, .10);
  }

  .nm-featured-premium-frame::before {
    inset: 4px;
    border-radius: 11px;
  }

  .nm-featured-premium-image {
    border-radius: 10px;
  }

  .nm-featured-premium-name {
    min-height: 52px;
    padding: 10px 5px 8px;

    font-size: 14px;
    line-height: 1.22;
  }

  .nm-featured-premium-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }
}

/* =========================================================
   NUEVAMANO · DESTACADAS PLATEADO + SELLO
   Sobrescribe el estilo premium anterior
   ========================================================= */

.nm-featured-premium-frame {
  background:
    linear-gradient(
      145deg,
      #f8f8f8 0%,
      #dbdde0 16%,
      #fefefe 30%,
      #bfc4c9 48%,
      #f5f6f7 62%,
      #c1c6cb 78%,
      #f9f9f9 100%
    ) !important;

  border: 2px solid #8d949b !important;

  box-shadow:
    0 0 0 4px rgba(185, 192, 199, .34),
    0 14px 28px rgba(20, 17, 15, .12),
    0 4px 10px rgba(20, 17, 15, .08) !important;
}

.nm-featured-premium-frame::before {
  border:
    1px solid rgba(255, 255, 255, .72) !important;
}

.nm-featured-premium-card:hover
.nm-featured-premium-frame {
  border-color: #6f777f !important;

  box-shadow:
    0 0 0 4px rgba(199, 205, 211, .45),
    0 18px 34px rgba(20, 17, 15, .16),
    0 6px 12px rgba(20, 17, 15, .10) !important;
}

.nm-featured-premium-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;

  padding: 8px 13px 7px;

  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      #4d5560,
      #2d333a
    );

  color: #f3f5f7;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;

  border: 1px solid rgba(255, 255, 255, .18);

  box-shadow:
    0 6px 12px rgba(20, 17, 15, .18),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.nm-featured-premium-name {
  color: #37424b !important;
}

@media (max-width: 520px) {
  .nm-featured-premium-badge {
    top: 11px;
    left: 11px;
    padding: 7px 10px 6px;
    font-size: 10px;
  }
}

/* =========================================================
   NUEVAMANO · DESTACADAS · REFLEJO METALICO ANIMADO
   ========================================================= */

.nm-featured-premium-frame {
  overflow: hidden;
}

.nm-featured-premium-frame::after {
  content: '';
  position: absolute;
  z-index: 2;

  top: -35%;
  left: -65%;

  width: 42%;
  height: 175%;

  pointer-events: none;

  background:
    linear-gradient(
      105deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.10) 25%,
      rgba(255,255,255,.72) 48%,
      rgba(255,255,255,.20) 62%,
      rgba(255,255,255,0) 100%
    );

  transform:
    skewX(-18deg)
    translateX(-180%);

  filter: blur(1px);

  animation:
    nm-metal-shine 5.8s ease-in-out infinite;
}

@keyframes nm-metal-shine {
  0%,
  14% {
    transform:
      skewX(-18deg)
      translateX(-180%);
    opacity: 0;
  }

  20% {
    opacity: .9;
  }

  42% {
    transform:
      skewX(-18deg)
      translateX(520%);
    opacity: .75;
  }

  48%,
  100% {
    transform:
      skewX(-18deg)
      translateX(520%);
    opacity: 0;
  }
}

/* Un pequeño pulso del borde para reforzar el efecto metálico */
.nm-featured-premium-card:hover
.nm-featured-premium-frame {
  animation:
    nm-metal-border-pulse 1.8s ease-in-out infinite;
}

@keyframes nm-metal-border-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(199,205,211,.40),
      0 18px 34px rgba(20,17,15,.16),
      0 6px 12px rgba(20,17,15,.10);
  }

  50% {
    box-shadow:
      0 0 0 5px rgba(230,234,238,.72),
      0 20px 38px rgba(20,17,15,.18),
      0 7px 14px rgba(20,17,15,.11);
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .nm-featured-premium-frame::after,
  .nm-featured-premium-card:hover
  .nm-featured-premium-frame {
    animation: none !important;
  }
}

/* =========================================================
   NUEVAMANO · DESTACADAS · AJUSTE ANIMACION + MOBILE
   ========================================================= */

/* Reflejo más rápido y visible */
.nm-featured-premium-frame::after {
  animation:
    nm-metal-shine 3s ease-in-out infinite !important;
}

/* En celular el sello no se superpone a la foto */
@media (max-width: 640px) {

  .nm-featured-premium-frame {
    padding-top: 9px !important;
  }

  .nm-featured-premium-badge {
    position: relative !important;

    top: auto !important;
    left: auto !important;
    right: auto !important;

    z-index: 4;

    display: flex !important;
    width: fit-content;

    margin:
      2px auto
      9px auto !important;

    padding:
      7px 11px
      6px !important;

    font-size: 10px !important;
    line-height: 1 !important;
  }

  .nm-featured-premium-image {
    position: relative;
    z-index: 1;
  }
}

/* Teléfonos angostos */
@media (max-width: 390px) {

  .nm-featured-premium-badge {
    font-size: 9px !important;

    padding:
      6px 9px
      5px !important;

    margin-bottom:
      7px !important;
  }
}

/* =========================================================
   NUEVAMANO · DESTACADAS
   ANIMACION EXCLUSIVAMENTE EN EL MARCO PLATEADO
   ========================================================= */

/*
 * Anular el haz anterior:
 * no debe cruzar foto, sello ni contenido.
 */
.nm-featured-premium-frame::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

/*
 * El movimiento ahora ocurre en el propio fondo plateado
 * del marco.
 */
.nm-featured-premium-frame {
  background:
    linear-gradient(
      125deg,
      #aeb4ba 0%,
      #eef0f2 10%,
      #babfc4 20%,
      #ffffff 30%,
      #aeb4ba 40%,
      #e5e8ea 52%,
      #9da4aa 62%,
      #f8f9fa 74%,
      #b6bcc2 86%,
      #e5e7e9 100%
    ) !important;

  background-size:
    260% 260% !important;

  animation:
    nm-silver-frame-flow 2.8s linear infinite !important;
}

@keyframes nm-silver-frame-flow {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

/*
 * La foto queda completamente independiente
 * del efecto metálico.
 */
.nm-featured-premium-image {
  position: relative;
  z-index: 3;

  background: #e8e4dc !important;
}

.nm-featured-premium-image img {
  position: relative;
  z-index: 4;

  animation: none !important;
  filter: none;
}

/*
 * El sello tampoco recibe el reflejo.
 */
.nm-featured-premium-badge {
  z-index: 6 !important;
}

/*
 * El nombre queda por encima del fondo animado
 * pero sin animación propia.
 */
.nm-featured-premium-name {
  position: relative;
  z-index: 5;

  animation: none !important;
}

.nm-featured-premium-prices{position:relative;z-index:5;display:flex;justify-content:center;gap:8px;padding:0 8px 12px;font-size:14px}
.nm-featured-premium-prices del{color:#626e63}
.nm-featured-premium-prices strong{color:#a1442f;font-weight:900}
.nm-featured-premium-badge{background:#a1442f !important;color:#fffaf2 !important}

/* El sello queda en el borde inferior derecho, lejos de las caras. */
.nm-featured-premium-image .nm-featured-premium-badge {
  position: absolute !important;
  top: auto !important;
  bottom: 12px !important;
  left: auto !important;
  right: 12px !important;
  width: max-content !important;
  max-width: 90%;
  margin: 0 !important;
  padding: 10px 18px !important;
  transform: rotate(-8deg);
  border: 2px solid #fffaf2;
  border-radius: 5px;
  box-shadow: 0 7px 22px rgba(49, 22, 16, .36);
  font-size: clamp(14px, 2vw, 20px) !important;
  letter-spacing: .08em;
  line-height: 1.1 !important;
  pointer-events: none;
}

@media (max-width: 640px) {
  .nm-featured-premium-image .nm-featured-premium-badge {
    bottom: 8px !important;
    right: 8px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
}

/*
 * El hover anterior tenía otra animación.
 * Mantener solamente el movimiento del plateado.
 */
.nm-featured-premium-card:hover
.nm-featured-premium-frame {
  animation:
    nm-silver-frame-flow 2.8s linear infinite !important;
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .nm-featured-premium-frame,
  .nm-featured-premium-card:hover
  .nm-featured-premium-frame {
    animation: none !important;
    background-position: 50% 50% !important;
  }
}

/* =========================================================
   NUEVAMANO · DESTACADAS · ESCRITORIO A ANCHO COMPLETO
   Las tarjetas dejan de tener tamaño fijo (232px) y pasan a
   repartirse todo el ancho disponible del contenedor.
   El nº de columnas lo calcula el JS según la cantidad de
   destacadas y lo publica en --nm-feat-cols.
   ========================================================= */

@media (min-width: 901px) {

  body.page-index .nm-featured-premium-grid {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;

    grid-template-columns:
      repeat(var(--nm-feat-cols, 3), minmax(0, 1fr)) !important;

    gap:
      clamp(22px, 1.9vw, 32px)
      clamp(18px, 1.6vw, 28px) !important;

    align-items: stretch;
  }

  body.page-index .nm-featured-premium-card {
    width: auto;
  }

  /* Marco a la misma altura para que cada fila quede pareja. */
  body.page-index .nm-featured-premium-frame {
    height: 100%;
  }

  /* El nombre respira mejor con tarjetas grandes. */
  body.page-index .nm-featured-premium-name {
    min-height: 64px;
    padding: 16px 14px 13px;
    font-size: 18px;
  }

  /* Una sola destacada: protagonista, sin estirarse a todo el ancho. */
  body.page-index .nm-featured-premium-grid[data-nm-count="1"] {
    max-width: 460px;
  }
}
