/* ═══════════════════════════════════════════════════════════════
   COCOFA – Sección "Novedades" de la home (carrusel + ficha)
   Usa los colores y radios del <style> de index.php (--primary, etc.).
   ═══════════════════════════════════════════════════════════════ */

.novedades-section { padding: 4rem 0 3.5rem; }
.novedades-swiper { padding: .5rem .25rem 3.25rem; }

/* ── Tarjeta ── */
.novedad-card {
  height: 100%;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-light, #eef2f7);
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(16, 42, 67, .06));
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.novedad-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg, 0 12px 28px rgba(16, 42, 67, .12)); }

.novedad-foto {
  aspect-ratio: 1 / 1;
  background: #f7fafc;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.novedad-foto img { width: 100%; height: 100%; object-fit: contain; }
.novedad-foto-fallback { opacity: .45; padding: 12%; }

.novedad-cuerpo { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.novedad-marca {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--primary-dark, #1565c0); margin: 0 0 .35rem;
}
.novedad-titulo {
  font-size: 1.02rem; font-weight: 700; line-height: 1.35; margin: 0 0 .5rem;
  color: var(--text-dark, #1a2b3c);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.novedad-corta {
  font-size: .9rem; line-height: 1.55; color: var(--text-muted, #52606d); margin: 0 0 1rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.novedad-btn {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.25rem;
  border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--secondary, #26c6da), var(--primary, #1e88e5));
  color: #fff; font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}
.novedad-btn:hover { filter: brightness(1.05); box-shadow: 0 6px 16px rgba(30, 136, 229, .3); }
.novedad-btn:active { transform: scale(.97); }
.novedad-btn i { transition: transform 200ms ease; }
.novedad-btn:hover i { transform: translateX(3px); }
.novedad-btn:focus-visible { outline: 3px solid #0b5cad; outline-offset: 3px; }

/* ── Flechas y puntos ── */
.novedades-swiper .novedades-flecha {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: var(--primary, #1e88e5);
  box-shadow: 0 4px 14px rgba(16, 42, 67, .16);
}
.novedades-swiper .novedades-flecha::after { font-size: 1rem; font-weight: 700; }
.novedades-swiper .novedades-flecha:focus-visible { outline: 3px solid #0b5cad; outline-offset: 2px; }
.novedades-swiper .swiper-button-disabled { opacity: .35; }
.novedades-swiper .novedades-puntos { bottom: .75rem; }
.novedades-swiper .swiper-pagination-bullet-active { background: var(--primary, #1e88e5); }

/* ── Ficha (ventana) ── */
.novedad-modal { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.novedad-modal[hidden] { display: none; }
.novedad-modal-fondo { position: absolute; inset: 0; background: rgba(10, 25, 41, .6); backdrop-filter: blur(2px); }
.novedad-modal-caja {
  position: relative; z-index: 1;
  width: min(880px, 100%); max-height: min(90vh, 760px); overflow-y: auto;
  background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(8, 24, 44, .35);
  animation: novedad-entra 200ms ease;
}
@keyframes novedad-entra { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.novedad-modal-cerrar {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .9); color: var(--text-dark, #1a2b3c);
  font-size: 1.1rem; cursor: pointer; box-shadow: 0 2px 8px rgba(16, 42, 67, .18);
}
.novedad-modal-cerrar:hover { background: #fff; }
.novedad-modal-cerrar:focus-visible { outline: 3px solid #0b5cad; outline-offset: 2px; }

.novedad-modal-cuerpo { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 1.75rem; padding: 1.75rem; }
.novedad-modal-foto { background: #f7fafc; border-radius: 16px; padding: 1.25rem; display: flex; align-items: center; justify-content: center; }
.novedad-modal-foto img { width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.novedad-modal-marca { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--primary-dark, #1565c0); margin: 0 0 .35rem; }
.novedad-modal-datos h3 { font-size: 1.45rem; font-weight: 800; line-height: 1.3; margin: 0 0 .85rem; color: var(--text-dark, #1a2b3c); }
.novedad-modal-texto { font-size: .95rem; line-height: 1.7; color: var(--text-muted, #52606d); }
.novedad-modal-texto p { margin: 0 0 .75rem; }
.novedad-modal-texto ul, .novedad-modal-texto ol { margin: 0 0 .75rem 1.25rem; }

.novedad-modal-codigo { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light, #eef2f7); }
.novedad-modal-codigo svg { max-width: 100%; height: auto; }
.novedad-modal-ean { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .95rem; letter-spacing: .08em; color: var(--text-dark, #1a2b3c); margin: .35rem 0 0; }

body.novedad-abierta { overflow: hidden; }

@media (max-width: 767.98px) {
  .novedades-section { padding: 3rem 0 2.5rem; }
  .novedad-modal { padding: .5rem; }
  .novedad-modal-cuerpo { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem; }
  .novedad-modal-foto img { max-height: 220px; }
  .novedad-modal-datos h3 { font-size: 1.2rem; }
  .novedades-swiper .novedades-flecha { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .novedad-card:hover { transform: none; }
  .novedad-modal-caja { animation: none; }
}
