/* ═══════════════════════════════════════════════════════════
   Novedades / anuncios — editorial de portada + artículo modal
   Identidad STMP MARKET: crema, negro, azul, tipografía condensada.
   ═══════════════════════════════════════════════════════════ */

/* ── Ruleta horizontal: las más nuevas primero, se desliza a la derecha ── */
.an-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 340px;
  justify-content: start;
  gap: 1.4rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
  /* pequeño respiro lateral para que la última card no quede pegada */
  scroll-padding-left: 2px;
  overscroll-behavior-x: contain;
}
.an-grid::-webkit-scrollbar { height: 6px; }
.an-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.an-grid > * { scroll-snap-align: start; }

.an-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform .28s var(--curva-suave, cubic-bezier(.16,1,.3,1)),
              box-shadow .28s, border-color .28s;
}
.an-card:hover, .an-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(20, 22, 30, .13);
  border-color: var(--accent);
  outline: none;
}
.an-card:focus-visible { box-shadow: 0 0 0 3px rgba(45,107,228,.35), 0 18px 44px rgba(20,22,30,.13); }

.an-card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ece7df;
  position: relative;
}
.an-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--curva-suave, ease); }
.an-card:hover .an-card-img img { transform: scale(1.045); }
.an-card-noimg { background: var(--accent-gradient, linear-gradient(135deg,#2d6be4,#1a3f8f)); }

.an-card-txt { padding: 1.15rem 1.25rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.an-card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Badges de tipo + bazar */
.an-tag {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 40px; line-height: 1.4; white-space: nowrap;
}
.an-tag--bazar { color: var(--accent); background: rgba(45, 107, 228, .1); }
.an-tag--novedad  { color: #1d4fbe; background: rgba(45,107,228,.12); }
.an-tag--rebaja   { color: #b42318; background: rgba(220,60,40,.12); }
.an-tag--aviso    { color: #8a5a00; background: rgba(200,140,0,.14); }
.an-tag--apertura { color: #0f7a4d; background: rgba(20,160,90,.14); }
.an-tag--dest     { color: #fff; background: var(--black); }

.an-card-tit {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; line-height: 1.02; letter-spacing: .01em;
  color: var(--black); margin: 0;
}
.an-card-res {
  font-size: 13.5px; color: var(--text2); line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.an-card-pie {
  margin-top: auto; padding-top: .55rem;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid rgba(20,22,30,.07);
}
.an-card-fecha { font-size: 11.5px; color: var(--text2); opacity: .8; letter-spacing: .02em; }
.an-card-cta {
  font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.an-card-cta .an-arrow { transition: transform .25s var(--curva-suave, ease); }
.an-card:hover .an-card-cta .an-arrow { transform: translateX(4px); }

/* Entrada sutil (sin sistema de motion nuevo; respeta reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  html.js-mov .an-card { opacity: 0; transform: translateY(14px); animation: anCardIn .5s var(--curva-suave, cubic-bezier(.16,1,.3,1)) forwards; animation-delay: calc(var(--i, 0) * 60ms); }
  @keyframes anCardIn { to { opacity: 1; transform: none; } }
}

/* ── Artículo modal ─────────────────────────────────────── */
.an-modal-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(15, 15, 20, .58);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center; justify-content: center;
  padding: 4vh 1rem;
}
.an-modal-overlay.abierto { display: flex; }

.an-modal {
  position: relative;
  width: 100%; max-width: 760px;
  max-height: min(92vh, 940px);
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
  animation: anSube .32s var(--curva-salida, cubic-bezier(.16,1,.3,1));
}
@keyframes anSube { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .an-modal { animation: none; } }

.an-modal-x {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: #111;
  font-size: 16px; line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .24);
  transition: transform .15s, background .15s;
}
.an-modal-x:hover { transform: scale(1.08); background: #fff; }

/* body: media fija arriba, contenido con scroll interno */
.an-modal-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.an-modal-img { width: 100%; flex: 0 0 auto; max-height: 44vh; overflow: hidden; background: #ece7df; }
.an-modal-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.an-modal-cont {
  padding: 1.9rem 2.4rem 2.4rem;
  overflow-y: auto; min-height: 0; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.an-modal-meta {
  font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .8rem;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.an-modal-meta .an-tag { margin: 0; }
.an-modal-tit {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.1rem, 5.5vw, 3.1rem); line-height: 1; letter-spacing: .01em;
  color: var(--black); margin: 0 0 .7rem;
}
.an-modal-res {
  font-size: 16.5px; line-height: 1.55; color: var(--text2); font-weight: 600;
  margin: 0 0 1.4rem; padding-bottom: 1.3rem;
  border-bottom: 1px solid rgba(20,22,30,.09);
}
.an-modal-cuerpo { font-size: 15.5px; line-height: 1.78; color: #2c2c2c; }
.an-modal-cuerpo h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem; line-height: 1.1; color: var(--black); margin: 1.7rem 0 .6rem; letter-spacing: .01em;
}
.an-modal-cuerpo h3 { font-size: 1.15rem; font-weight: 800; color: var(--black); margin: 1.3rem 0 .5rem; }
.an-modal-cuerpo p { margin: 0 0 1rem; }
.an-modal-cuerpo p:last-child { margin-bottom: 0; }

.an-modal-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 1.6rem;
  padding: 12px 22px; border-radius: 40px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  text-decoration: none; transition: transform .2s, background .2s;
}
.an-modal-cta:hover { transform: translateY(-2px); background: var(--accent-hover, #1d4fbe); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 620px) {
  /* La card asoma la siguiente: se entiende que hay más a la derecha. */
  .an-grid { grid-auto-columns: 82vw; gap: 1rem; }
  .an-modal-cont { padding: 1.5rem 1.35rem 1.9rem; }
  .an-modal-overlay { padding: 2.2vh .6rem; }
  .an-modal { max-height: 94vh; border-radius: 20px; }
  .an-modal-img { max-height: 38vh; }
}
