/* ---- layout general ---- */
.top5 {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(2.2rem, 4.2vw, 4rem) clamp(1rem, 2.6vw, 2rem);
  background: #fff;
  margin-top: 5rem;
}

.top5__head { text-align: center; }

.top5__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 4.2vw, 4.1rem);
  letter-spacing: 0.01em;
  color: #111;
  line-height: 1.05;
}

.top5__subtitle {
  margin: 0.7rem 0 1.55rem;
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  color: rgba(0, 0, 0, 0.65);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-weight: 400;
}

/* ---- carrusel ---- */
.top5__carousel {
  position: relative;
  width: 100%;
  margin-top: 0.6rem;
}

.top5__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (4 * 22px)) / 5);
  gap: 22px;
  overflow: hidden;
  scroll-behavior: smooth;
  padding: 0.4rem 0 0;
}

.top5__arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.65);
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
  z-index: 2;
}

.top5__arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.03);
}

.top5__arrow--prev { left: -10px; }
.top5__arrow--next { right: -10px; }

/* ---- tarjeta producto (ahora es un <a>) ---- */
.pcard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.pcard:focus-visible {
  outline: 3px solid rgba(47, 107, 76, 0.25);
  outline-offset: 4px;
}

.pcard__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #fff;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: scale(1);
  transition: transform 220ms ease;
}

/* hover premium sin botones */
.pcard:hover .pcard__media img {
  transform: scale(1.02);
}

.pcard__body {
  padding: 14px 2px 0;
  text-align: left;
}

.pcard__brand {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 6px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.pcard__code {
  font: inherit;
  color: rgba(0,0,0,0.55);
  letter-spacing: 0.02em;
  text-transform: none;
}

.pcard__name {
  display: block;
  font-size: 0.98rem;
  color: #111;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 8px;
}

.pcard__price {
  display: block;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-weight: 700;
  color: #c21919;
  font-size: 0.98rem;
}

/* placeholder */
.top5__empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(0, 0, 0, 0.55);
  border: 1px dashed rgba(0, 0, 0, 0.18);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  margin: auto;
}

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .top5__track {
    grid-auto-columns: calc((100% - (2 * 18px)) / 3);
    gap: 18px;
  }

  .top5__arrow--prev { left: -6px; }
  .top5__arrow--next { right: -6px; }
}

/* Mobile: 1 por vista + scroll con snap */
@media (max-width: 640px) {
  .top5 {
    padding: 2rem 0.9rem 2.6rem;
  }

  .top5__track {
    grid-auto-columns: 88%;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .top5__track::-webkit-scrollbar { display: none; }

  .pcard { scroll-snap-align: center; }

  .top5__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .top5__track,
  .pcard__media img {
    transition: none !important;
  }
}
