/* ============================================================
   BIENESTAR MENTAL — Plugin Stylesheet v2.0
   Mobile-First | Fullscreen | Auto Image Cards
   ============================================================ */

/* ── TOKENS ── */
:root {
  --bm-brand:        #1a2f4e;
  --bm-brand-mid:    #2a4a7a;
  --bm-brand-dark:   #0f1e33;
  --bm-accent:       #1bb584;
  --bm-accent-dark:  #0f8f66;
  --bm-accent-light: #e1f5ee;
  --bm-amber:        #e59a00;
  --bm-text:         #1a2f4e;
  --bm-text-muted:   #5a7090;
  --bm-bg:           #f2f5f9;
  --bm-card:         #ffffff;
  --bm-border:       rgba(26, 47, 78, 0.10);
  --bm-radius:       16px;
  --bm-radius-sm:    10px;
  --bm-shadow:       0 4px 24px rgba(26, 47, 78, 0.08);
  --bm-shadow-hover: 0 12px 40px rgba(26, 47, 78, 0.14);
  --bm-font:         'DM Sans', system-ui, sans-serif;
  --bm-font-display: 'Playfair Display', Georgia, serif;
  --bm-transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --bm-whatsapp:     #25d366;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@700&display=swap');

/* ══════════════════════════════════════════════════════════
   FULL-WIDTH BREAKOUT — rompe el contenedor del tema WP
   Funciona con Elementor, Divi, Astra, OceanWP, GeneratePress,
   Twenty*, y cualquier tema con max-width en .entry-content
   ══════════════════════════════════════════════════════════ */

/* Wrapper que rompe cualquier contenedor padre */
.bm-fullwidth {
  width: 100vw !important;
  max-width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  box-sizing: border-box !important;
}

/* Eliminar restricciones comunes de temas */
.bm-fullwidth *,
.bm-hero,
.bm-banner {
  max-width: none;
}

/* Forzar el post/page content a no limitar */
.entry-content .bm-fullwidth,
.post-content .bm-fullwidth,
.page-content .bm-fullwidth,
.elementor-widget-container .bm-fullwidth,
.wp-block-group .bm-fullwidth {
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
}

/* Ocultar scrollbar horizontal que puede aparecer */
body { overflow-x: hidden !important; }

/* ── RESET ── */
.bm-hero,
.bm-banner,
.bm-section,
.bm-card,
.bm-btn,
.bm-wa-float {
  box-sizing: border-box;
  font-family: var(--bm-font);
}

/* ============================================================
   BANNER CTA
   ============================================================ */
.bm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(135deg, var(--bm-brand) 0%, var(--bm-brand-mid) 100%);
  padding: 13px 20px;
  border-radius: 0 0 var(--bm-radius) var(--bm-radius);
}

.bm-banner__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
}

.bm-banner__icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bm-banner__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bm-banner__close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--bm-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bm-banner__close:hover { background: rgba(255,255,255,0.24); }

/* ============================================================
   HERO FULLSCREEN
   ============================================================ */
.bm-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bm-brand-dark);
  padding: 60px 20px;
}

/* Animated gradient background */
.bm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(27,181,132,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(42,74,122,0.5) 0%, transparent 65%),
    linear-gradient(160deg, #0f1e33 0%, #1a2f4e 50%, #0f2f22 100%);
  animation: bm-bg-shift 12s ease-in-out infinite alternate;
}

@keyframes bm-bg-shift {
  0%   { opacity: 1; }
  100% { opacity: 0.85; }
}

.bm-hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
  width: 100%;
}

.bm-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(27,181,132,0.18);
  color: #7ef0c8;
  border: 1px solid rgba(27,181,132,0.35);
  border-radius: 40px;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 22px;
  animation: bm-fade-up 0.6s both;
}

.bm-hero__title {
  font-family: var(--bm-font-display);
  font-size: clamp(32px, 6vw, 62px);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 18px;
  animation: bm-fade-up 0.6s 0.1s both;
}

.bm-hero__title span { color: #7ef0c8; }

.bm-hero__sub {
  font-size: clamp(15px, 2vw, 18px);
  color: rgba(255,255,255,0.68);
  line-height: 1.75;
  margin: 0 0 34px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  animation: bm-fade-up 0.6s 0.2s both;
}

.bm-hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: bm-fade-up 0.6s 0.3s both;
}

/* Floating particles */
.bm-hero__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.bm-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(27,181,132,0.15);
  animation: bm-float linear infinite;
}

.bm-particle--0 { width:8px;  height:8px;  top:15%; left:10%; animation-duration:8s; animation-delay:-2s; }
.bm-particle--1 { width:14px; height:14px; top:65%; left:18%; animation-duration:11s; animation-delay:-5s; }
.bm-particle--2 { width:6px;  height:6px;  top:30%; left:82%; animation-duration:7s;  animation-delay:-1s; }
.bm-particle--3 { width:20px; height:20px; top:75%; left:75%; animation-duration:13s; animation-delay:-7s; }
.bm-particle--4 { width:5px;  height:5px;  top:50%; left:50%; animation-duration:9s;  animation-delay:-3s; }
.bm-particle--5 { width:12px; height:12px; top:20%; left:60%; animation-duration:10s; animation-delay:-4s; }
.bm-particle--6 { width:7px;  height:7px;  top:85%; left:40%; animation-duration:12s; animation-delay:-6s; }
.bm-particle--7 { width:16px; height:16px; top:40%; left:25%; animation-duration:15s; animation-delay:-8s; }

@keyframes bm-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.5; }
  50%       { transform: translateY(-28px) scale(1.1); opacity: 1; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.bm-section {
  padding: 48px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.bm-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.bm-section__title {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--bm-brand);
  margin: 0;
}

.bm-section__link {
  font-size: 13px;
  color: var(--bm-accent);
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--bm-transition);
}

.bm-section__link:hover { gap: 8px; }

/* ============================================================
   GRID RESPONSIVE
   ============================================================ */
.bm-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr; /* Mobile: 1 col */
}

@media (min-width: 640px) {
  .bm-grid[data-cols="2"],
  .bm-grid[data-cols="3"] {
    grid-template-columns: repeat(2, 1fr); /* Tablet: 2 col */
  }
}

@media (min-width: 1024px) {
  .bm-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); } /* Desktop: 3 col */
  .bm-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   CARDS — BASE
   ============================================================ */
.bm-card {
  background: var(--bm-card);
  border-radius: var(--bm-radius);
  border: 1px solid var(--bm-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--bm-shadow);
  transition: transform var(--bm-transition), box-shadow var(--bm-transition);
  animation: bm-fade-up 0.5s both;
}

.bm-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--bm-shadow-hover);
}

.bm-card:nth-child(2) { animation-delay: 0.08s; }
.bm-card:nth-child(3) { animation-delay: 0.16s; }

/* ── CARD THUMBNAIL (imagen automática) ── */
.bm-card__thumb {
  position: relative;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: var(--bm-bg);
}

.bm-card__thumb--program {
  height: 180px;
}

.bm-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.bm-card:hover .bm-card__img {
  transform: scale(1.06);
}

/* Skeleton loader mientras carga la imagen */
.bm-card__img:not([src]),
.bm-card__img[src=""] {
  background: linear-gradient(90deg, #e8ecf1 25%, #f2f5f9 50%, #e8ecf1 75%);
  background-size: 200% 100%;
  animation: bm-skeleton 1.5s infinite;
}

@keyframes bm-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Category badge sobre la imagen */
.bm-card__category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(26, 47, 78, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 40px;
}

/* Overlay para program cards */
.bm-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(15, 30, 51, 0.65) 0%, transparent 60%);
}

.bm-card__emoji {
  font-size: 36px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* ── CARD BODY ── */
.bm-card__body {
  padding: 18px 18px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bm-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--bm-brand);
  line-height: 1.45;
  margin: 0 0 8px;
}

.bm-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--bm-transition);
}

.bm-card__title a:hover { color: var(--bm-accent); }

.bm-card__excerpt {
  font-size: 13px;
  color: var(--bm-text-muted);
  line-height: 1.65;
  flex: 1;
  margin: 0;
}

/* ── CARD FOOTER ── */
.bm-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--bm-border);
  gap: 8px;
}

.bm-card__meta {
  font-size: 12px;
  color: var(--bm-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ── COLOR VARIANTS ── */
.bm-card--program .bm-card__thumb { }

.bm-card--green  .bm-card__thumb { background: linear-gradient(135deg, #1bb584, #0a5c42); }
.bm-card--blue   .bm-card__thumb { background: linear-gradient(135deg, #2a4a7a, #0f1e33); }
.bm-card--amber  .bm-card__thumb { background: linear-gradient(135deg, #e59a00, #8a5c00); }

/* ============================================================
   BUTTONS
   ============================================================ */
.bm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--bm-font);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--bm-transition);
  white-space: nowrap;
}

.bm-btn--primary {
  background: var(--bm-accent);
  color: #fff;
  border-radius: 40px;
  padding: 14px 30px;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(27,181,132,0.35);
}

.bm-btn--primary:hover {
  background: var(--bm-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27,181,132,0.45);
  color: #fff;
}

.bm-btn--ghost {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 40px;
  padding: 14px 30px;
  font-size: 15px;
}

.bm-btn--ghost:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.bm-btn--download {
  background: #fff;
  color: var(--bm-brand);
  border-radius: 40px;
  padding: 8px 18px;
  font-size: 13px;
}

.bm-btn--download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  color: var(--bm-brand);
}

/* Pill pequeño en cards */
.bm-btn--pill {
  background: var(--bm-brand);
  color: #fff;
  border-radius: 40px;
  padding: 7px 16px;
  font-size: 12px;
}

.bm-btn--pill:hover {
  background: var(--bm-brand-mid);
  transform: scale(1.04);
  color: #fff;
}

/* Outline full-width para programs */
.bm-btn--outline-full {
  width: 100%;
  justify-content: center;
  background: var(--bm-accent-light);
  color: var(--bm-accent-dark);
  border: 1.5px solid var(--bm-accent);
  border-radius: var(--bm-radius-sm);
  padding: 10px 16px;
  font-size: 13px;
}

.bm-btn--outline-full:hover {
  background: var(--bm-accent);
  color: #fff;
}

/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */
.bm-wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--bm-whatsapp);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(37,211,102,0.45);
  z-index: 9999;
  cursor: pointer;
  text-decoration: none;
  animation: bm-wa-bounce 0.6s 1s both;
}

.bm-wa-float:hover { transform: scale(1.1); }

.bm-wa-float svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Anillo de pulso */
.bm-wa-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bm-whatsapp);
  opacity: 0;
  animation: bm-wa-pulse 2.5s 1.5s infinite;
}

@keyframes bm-wa-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Tooltip */
.bm-wa-tooltip {
  position: absolute;
  right: 66px;
  background: var(--bm-brand-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--bm-radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity var(--bm-transition), transform var(--bm-transition);
  font-family: var(--bm-font);
}

.bm-wa-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--bm-brand-dark);
  border-right: none;
}

.bm-wa-float:hover .bm-wa-tooltip {
  opacity: 1;
  transform: translateX(0);
}

@keyframes bm-wa-bounce {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  70%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes bm-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 640px) {
  .bm-section       { padding: 32px 14px; }
  .bm-hero          { min-height: 100svh; padding: 48px 16px; }
  .bm-banner        { flex-direction: column; align-items: flex-start; padding: 12px 14px; border-radius: 0; }
  .bm-card__thumb   { height: 180px; }
  .bm-wa-float      { bottom: 16px; right: 16px; width: 50px; height: 50px; }
  .bm-wa-float svg  { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
