/* ============================================================
   Amazon Productos ES — Lista Horizontal CSS v2.1
   FIXES: Button visibility with .ape-list-wrap prefix
   ============================================================ */

/* ── Lista ────────────────────────────────────────────────── */
.ape-list-wrap .ape-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Fila ─────────────────────────────────────────────────── */
.ape-list-wrap .ape-list-row {
  display: grid;
  grid-template-columns: 42px 160px 1fr;
  gap: 0 16px;
  align-items: stretch;
  background: var(--ape-card-bg, #fff);
  border: 1px solid var(--ape-border, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  animation: ape-rise .4s ease both;
}
.ape-list-wrap .ape-list-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  border-color: #FF9900;
}

/* Acento lateral */
.ape-list-wrap .ape-list-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: #e5e7eb;
  transition: background .25s;
}
.ape-list-wrap .ape-list-row:hover::before { background: #FF9900; }
.ape-list-wrap .ape-list-row-1::before { background: #FFD700; }
.ape-list-wrap .ape-list-row-2::before { background: #C0C0C0; }
.ape-list-wrap .ape-list-row-3::before { background: #CD7F32; }

/* Delays */
.ape-list-wrap .ape-list-row:nth-child(1)  { animation-delay: .04s; }
.ape-list-wrap .ape-list-row:nth-child(2)  { animation-delay: .08s; }
.ape-list-wrap .ape-list-row:nth-child(3)  { animation-delay: .12s; }
.ape-list-wrap .ape-list-row:nth-child(4)  { animation-delay: .16s; }
.ape-list-wrap .ape-list-row:nth-child(5)  { animation-delay: .20s; }
.ape-list-wrap .ape-list-row:nth-child(6)  { animation-delay: .24s; }
.ape-list-wrap .ape-list-row:nth-child(7)  { animation-delay: .28s; }
.ape-list-wrap .ape-list-row:nth-child(8)  { animation-delay: .32s; }
.ape-list-wrap .ape-list-row:nth-child(9)  { animation-delay: .36s; }
.ape-list-wrap .ape-list-row:nth-child(10) { animation-delay: .40s; }

/* ── Número ───────────────────────────────────────────────── */
.ape-list-wrap .ape-list-num {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  padding: 16px 0 16px 14px;
  flex-shrink: 0;
  line-height: 1;
}
.ape-list-wrap .ape-list-num span {
  font-size: .85rem; font-weight: 700;
  color: #6b7280; background: #f3f4f6;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Imagen ───────────────────────────────────────────────── */
.ape-list-wrap .ape-list-img-wrap {
  position: relative;
  background: var(--ape-img-bg, #f3f6f9);
  height: 100%; min-height: 140px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; overflow: hidden;
}
.ape-list-wrap .ape-list-img {
  max-width: 100%; max-height: 150px;
  width: auto; height: auto; object-fit: contain;
  transition: transform .3s ease;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.1));
}
.ape-list-wrap .ape-list-row:hover .ape-list-img { transform: scale(1.05); }

/* ── Info ─────────────────────────────────────────────────── */
.ape-list-wrap .ape-list-info {
  padding: 16px 16px 16px 0;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.ape-list-wrap .ape-list-top {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ape-list-wrap .ape-list-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FF9900, #e07b00);
  color: #ffffff !important;
  font-size: .65rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; line-height: 1.4;
  box-shadow: 0 2px 6px rgba(255,153,0,.4);
  text-decoration: none !important;
}
.ape-list-wrap .ape-list-title {
  margin: 0 !important; padding: 0 !important;
  font-size: .95rem !important; font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--ape-text, #111827) !important;
  border: none !important;
}
.ape-list-wrap .ape-list-title a {
  color: #111827 !important;
  text-decoration: none !important;
  transition: color .2s;
}
.ape-list-wrap .ape-list-title a:hover { color: #146eb4 !important; }
.ape-list-wrap .ape-list-desc {
  margin: 0 !important;
  font-size: .82rem !important;
  color: #6b7280 !important;
  line-height: 1.55 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ape-list-wrap .ape-list-footer {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-top: auto; padding-top: 4px;
}
.ape-list-wrap .ape-list-footer .ape-price-amt {
  font-size: 1.1rem; font-weight: 800;
  color: #b91c1c; letter-spacing: -.3px;
}

/* ── Botón lista — versión compacta ───────────────────────── */
.ape-list-wrap .ape-list-btn {
  margin-left: auto !important;
  padding: 9px 16px !important;
  width: auto !important;
}

/* ── Dark theme ───────────────────────────────────────────── */
.ape-list-wrap.ape-theme-dark .ape-list-row { background: #1f2937; border-color: #374151; }
.ape-list-wrap.ape-theme-dark .ape-list-row:hover { border-color: #FF9900; }
.ape-list-wrap.ape-theme-dark .ape-list-title { color: #f0f4f8 !important; }
.ape-list-wrap.ape-theme-dark .ape-list-title a { color: #f0f4f8 !important; }
.ape-list-wrap.ape-theme-dark .ape-list-title a:hover { color: #FF9900 !important; }
.ape-list-wrap.ape-theme-dark .ape-list-desc { color: #94a3b8 !important; }
.ape-list-wrap.ape-theme-dark .ape-list-img-wrap { background: #111827; }
.ape-list-wrap.ape-theme-dark .ape-list-num span { background: #374151; color: #94a3b8; }
.ape-list-wrap.ape-theme-dark .ape-foot { background: #111827; border-color: #374151; }

/* ── Minimal theme ────────────────────────────────────────── */
.ape-list-wrap.ape-theme-minimal .ape-list-row { border-radius: 4px; box-shadow: none; }
.ape-list-wrap.ape-theme-minimal .ape-list-row:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.ape-list-wrap.ape-theme-minimal .ape-list-btn { border-radius: 4px !important; }
.ape-list-wrap.ape-theme-minimal .ape-head-icon { display: none; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .ape-list-wrap .ape-list-row { grid-template-columns: 32px 110px 1fr; gap: 0 10px; }
  .ape-list-wrap .ape-list-img-wrap { min-height: 110px; padding: 8px; }
  .ape-list-wrap .ape-list-img { max-height: 110px; }
  .ape-list-wrap .ape-list-info { padding: 12px 12px 12px 0; gap: 6px; }
  .ape-list-wrap .ape-list-title { font-size: .85rem !important; }
  .ape-list-wrap .ape-list-desc { -webkit-line-clamp: 2; }
  .ape-list-wrap .ape-list-btn { margin-left: 0 !important; width: 100% !important; }
}
@media (max-width: 420px) {
  .ape-list-wrap .ape-list-row { grid-template-columns: 28px 90px 1fr; gap: 0 8px; }
  .ape-list-wrap .ape-list-num { padding: 12px 0 12px 10px; font-size: 1.1rem; }
  .ape-list-wrap .ape-list-img-wrap { min-height: 90px; padding: 6px; }
  .ape-list-wrap .ape-list-img { max-height: 90px; }
}
