/* ── VARIABLES MÓVIL (usadas por el CSS unificado en base.css) ── */
body.wb-template-1 {
  --wb-m-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --wb-m-btn-bg:     #3b82f6;
  --wb-m-btn-color:  white;
  --wb-m-btn-border: none;
  --wb-m-btn-radius: 14px;
  --wb-m-accent:     #3b82f6;
  --wb-m-hero-bg:    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --wb-m-page-bg:    #f8fafc;
  --wb-m-text:       #1e293b;
}

/* ============================================================
   TEMPLATE 1: CLASSIC PROFESSIONAL
   Flujo vertical · 7 huecos
   H1 Identidad · H2 Bio · H3 Botones · H4 Portfolio
   H5 Galería · H6 Mapa+Horario (2col) · H7 Testimonios
============================================================ */

body.wb-template-1 {
  background: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
}

/* ── WRAP: flujo vertical centrado ───────────────────── */
body.wb-template-1 .wb-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}


/* ── SECCIONES: posición y espaciado ─────────────────── */
body.wb-template-1 .wb-hero-section    { position: relative; z-index: 1; }
body.wb-template-1 .wb-bio-section     { max-width: 1200px; width: 100%; margin: -80px auto 0; padding: 0 40px; position: relative; z-index: 10; }
body.wb-template-1 .wb-actions-section { max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 40px 60px; position: relative; z-index: 10; }
body.wb-template-1 .wb-modules-container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 0 40px 40px; }
body.wb-template-1 .wb-map-schedule-row {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
/* Un solo modulo visible: ocupa el ancho completo */
body.wb-template-1 .wb-map-schedule-row.wb-msr--single {
  grid-template-columns: 1fr;
}
body.wb-template-1 .wb-testimonials-row {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px 60px;
}

/* Slots vacíos: no ocupan espacio */

/* ── H1: IDENTIDAD ───────────────────────────────────── */
body.wb-template-1 .wb-hero {
  height: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.wb-template-1 .wb-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 2;
}

body.wb-template-1 .wb-profile-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
  text-align: center;
}

body.wb-template-1 .wb-avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border: 4px solid white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  color: white;
  font-weight: 700;
  font-size: 36px;
}

body.wb-template-1 .wb-name {
  font-size: 40px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

body.wb-template-1 .wb-prof {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  margin-bottom: 6px;
  text-shadow: none;
}

body.wb-template-1 .wb-location,
body.wb-template-1 .wb-address {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  text-shadow: none;
}

body.wb-template-1 .wb-logo-container {
  position: absolute;
  top: 28px;
  right: 36px;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
  z-index: 10;
  pointer-events: none;
}
body.wb-template-1 .wb-logo-container img {
  width: auto;
  height: 136px;
  max-width: 272px;
  max-height: 136px;
  object-fit: contain;
  background: transparent;
  display: block;
}

/* ── H2: BIO ─────────────────────────────────────────── */
body.wb-template-1 .wb-card {
  background: white;
  border-radius: 16px;
  padding: 60px 40px 40px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

body.wb-template-1 .wb-bio {
  font-size: 17px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 32px;
}

/* ── H3: BOTONES ─────────────────────────────────────── */
body.wb-template-1 .wb-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

body.wb-template-1 .wb-btn {
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
body.wb-template-1 .wb-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}

/* ── H4: PORTFOLIO ───────────────────────────────────── */
body.wb-template-1 .wb-section-title,
body.wb-template-1 .wb-module-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
  color: #0f172a;
}

body.wb-template-1 .wb-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

body.wb-template-1 .wb-portfolio-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
}
body.wb-template-1 .wb-portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body.wb-template-1 .wb-portfolio-media { aspect-ratio: 3/2; max-height: 200px; }
body.wb-template-1 .wb-portfolio-content { padding: 20px; }
body.wb-template-1 .wb-portfolio-title  { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: #0f172a; }
body.wb-template-1 .wb-portfolio-subtitle { font-size: 13px; color: #64748b; margin-bottom: 6px; font-style: italic; }
body.wb-template-1 .wb-portfolio-subtitle { font-size: 14px; color: #64748b; font-weight: 600; margin-bottom: 8px; }
body.wb-template-1 .wb-portfolio-desc  { font-size: 14px; color: #94a3b8; line-height: 1.5;  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* ── H6: MAPA + HORARIO (2 columnas iguales en wb-map-schedule-row) ── */
body.wb-template-1 .wb-module--map {
  display: flex;
  flex-direction: column;
}
/* Oculto por JS cuando no tiene contenido — !important no debe interferir */
body.wb-template-1 .wb-module--map[style*="display: none"],
body.wb-template-1 .wb-module--map[style*="display:none"] {
  display: none !important;
}
body.wb-template-1 .wb-module--map .wb-map-body { flex: 1; padding: 0 12px 12px; }
body.wb-template-1 .wb-module--map .wb-map-iframe {
  width: 100%;
  height: 320px;
  display: block;
  border: 0;
  border-radius: 8px;
}

/* ── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 768px) {
  body.wb-template-1 .wb-hero { height: 400px; }
  body.wb-template-1 .wb-hero-overlay { padding: 24px; }

  body.wb-template-1 .wb-bio-section,
  body.wb-template-1 .wb-actions-section,
  body.wb-template-1 .wb-modules-container,
  body.wb-template-1 .wb-map-schedule-row,
  body.wb-template-1 .wb-testimonials-row { padding: 0 20px 24px; }

  body.wb-template-1 .wb-bio-section { margin-top: 0; }

  body.wb-template-1 .wb-map-schedule-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.wb-template-1 .wb-card { padding: 24px; }
  body.wb-template-1 .wb-avatar { width: 80px; height: 80px; font-size: 28px; }
  body.wb-template-1 .wb-name { font-size: 28px; }
  body.wb-template-1 .wb-prof { font-size: 16px; }
  body.wb-template-1 .wb-bio { font-size: 16px; margin-bottom: 0; }
  body.wb-template-1 .wb-actions { grid-template-columns: 1fr; }
  body.wb-template-1 .wb-section-title,
  body.wb-template-1 .wb-module-title { font-size: 24px; }
  body.wb-template-1 .wb-portfolio-grid { grid-template-columns: 1fr; gap: 16px; }

  body.wb-template-1 .wb-logo-container img {
    height: 108px;
    max-width: 216px;
    max-height: 108px;
  }

  body.wb-template-1 .wb-module--map .wb-map-iframe { height: 260px; }
}


/* ═══════════════════════════════════════════════════════
   MÓVIL — Cabecera estilo Timeline (≤768px)
   Estructura: hero(imagen+panel) → bio → botones → módulos → extras
   ═══════════════════════════════════════════════════════ */
@media (min-width: 769px) {}

@media (max-width: 768px) {

  /* Wrap: flex columna */
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] {
    display: flex !important;
    flex-direction: column !important;
    max-width: 100% !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  /* Reset grid de desktop en todos los hijos directos */
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > * {
    grid-column: unset !important;
    grid-row: unset !important;
    grid-area: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  /* Hero: contenedor flex con imagen de fondo, panel al fondo */
  body.wb-template-1 .wb-hero-section {
    display: flex !important;
    align-items: flex-end !important;
    min-height: 260px !important;
    height: 260px !important;
    overflow: hidden !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  /* #wbHero: posición absoluta como fondo (el JS le pone la imagen) */
  body.wb-template-1 #wbHero {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
    display: block !important;
  }

  /* Overlay: panel semitransparente al fondo del hero */
  body.wb-template-1 .wb-hero-overlay {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    padding: 16px 20px 20px !important;
    background: rgba(0,0,0,0.45) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-top: 1px solid rgba(255,255,255,0.15) !important;
    display: block !important;
  }

  body.wb-template-1 .wb-profile-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    color: white !important;
  }

  body.wb-template-1 .wb-name { color: white !important; text-shadow: 0 1px 4px rgba(0,0,0,0.4) !important; font-size: 18px !important; margin: 0 0 2px !important; }
  body.wb-template-1 .wb-prof { color: rgba(255,255,255,0.85) !important; text-shadow: none !important; font-size: 13px !important; margin: 0 0 2px !important; }
  body.wb-template-1 .wb-location { color: rgba(255,255,255,0.75) !important; text-shadow: none !important; font-size: 12px !important; margin: 0 !important; }

  body.wb-template-1 .wb-avatar-container { flex-shrink: 0 !important; }
  body.wb-template-1 .wb-avatar {
    width: 60px !important;
    height: 60px !important;
    border: 2px solid rgba(255,255,255,0.5) !important;
  }

  /* Bio y botones */
  body.wb-template-1 .wb-bio-section,
  body.wb-template-1 .wb-actions-section {
    padding: 20px 16px !important;
  }

  /* Módulos: flex columna */
  body.wb-template-1 .wb-modules-container {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    padding: 0 16px 16px !important;
    gap: 16px !important;
  }

  /* map-schedule-row: columna única en móvil */
  body.wb-template-1 .wb-map-schedule-row {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    gap: 16px !important;
    padding: 0 16px 16px !important;
  }

  /* col-extra: flex columna */
  body.wb-template-1 .wb-col-extra {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 0 16px 24px !important;
    grid-column: unset !important;
    grid-row: unset !important;
  }

  /* Botones: una columna */
  body.wb-template-1 .wb-actions {
    grid-template-columns: 1fr !important;
  }

  /* Logo */
  body.wb-template-1 .wb-logo-container img {
    height: 60px !important;
    max-width: 120px !important;
    max-height: 60px !important;
    width: auto !important;
  }

  /* Orden móvil: hero → botones → bio → horario(*JS) → portfolio → mapa(*JS) → testimonios(*JS) */
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-hero-section { order: 1 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-actions-section { order: 2 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-bio-section { order: 3 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-map-schedule-row { order: 7 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-modules-container { order: 5 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-col-extra { order: 7 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-testimonials-row { order: 8 !important; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-footer-section { order: 99 !important; }
}

/* ── PUBLICACIONES T1 ───────────────────────────────────── */
body.wb-template-1 .wb-publications-section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px 48px;
  box-sizing: border-box;
  background: #f8fafc;
}
body.wb-template-1 .wb-publications-section .wb-pub-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; }
body.wb-template-1 .wb-publications-section .wb-pub-date { color: #64748b; }
body.wb-template-1 .wb-publications-section .wb-pub-ptitle { color: #1e293b; font-weight: 700; }
body.wb-template-1 .wb-publications-section .wb-pub-more { color: #3b82f6; }
@media (max-width: 768px) {
  body.wb-template-1 .wb-publications-section { padding: 0 16px 40px; }
  body.wb-template-1 .wb-wrap[data-wb-v5="1"] > .wb-publications-section { order: 10 !important; }
}

body.wb-template-1 .wb-rating { margin-left:auto; margin-right:auto; }

@media (max-width: 600px) {
  body.wb-template-1 .wb-rating { margin-left: 0; margin-right: 0; }
}
