/* =========================================================
   Variables base
   ========================================================= */
:root {
  --color-rojo: #c01c1c;
  --color-rojo-fondo: #8b0000;
  --color-gris-claro: #f8f9fa;
  --color-blanco: #ffffff;
  --color-negro: #000000;
}

/* =========================================================
   Reset y tipografía
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
  background-color: var(--color-blanco);
  padding-top: 80px;
}

img { max-width: 100%; height: auto; display: block; }
p { margin-bottom: 1rem; }

/* =========================================================
   Utilidades de color y layout
   ========================================================= */
.text-rojo { color: var(--color-rojo); }
.text-blanco { color: var(--color-blanco); }
.bg-rojo { background-color: var(--color-rojo) !important; color: var(--color-blanco); }
.bg-rojo-fondo { background-color: var(--color-rojo-fondo) !important; color: var(--color-blanco); }
.bg-gris-claro { background-color: var(--color-gris-claro) !important; }
.bg-blanco { background-color: var(--color-blanco) !important; }
.object-fit-cover { object-fit: cover; }

.eyebrow { letter-spacing: 0.1em; font-weight: 600; color: #ffdede; }

.btn-rojo {
  background: var(--color-rojo);
  color: #fff;
  border: 2px solid var(--color-rojo);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  border-radius: 0.6rem;
  box-shadow: 0 6px 18px rgba(192, 28, 28, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-rojo:hover { transform: translateY(-2px); color: #fff; }

/* =========================================================
   Loader
   ========================================================= */
#loader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--color-blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid var(--color-rojo);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }

/* =========================================================
   Navbar
   ========================================================= */
.custom-navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  padding: 0.75rem 1rem !important;
  z-index: 9999;
}

.custom-navbar .navbar-logo { height: 70px; width: auto; object-fit: contain; }
.custom-navbar .nav-link { position: relative; font-weight: 600; color: var(--color-rojo) !important; padding: 0.5rem 1rem; transition: color 0.3s ease; }
.custom-navbar .nav-link::after { content: ''; position: absolute; bottom: -4px; left: 50%; width: 0; height: 2px; background: var(--color-rojo); transition: width 0.3s ease, left 0.3s ease; }
.custom-navbar .nav-link:hover::after, .custom-navbar .nav-link.active::after { width: 100%; left: 0; }
.custom-navbar .navbar-toggler-icon { filter: invert(23%) sepia(67%) saturate(6801%) hue-rotate(351deg) brightness(98%) contrast(121%) !important; }
.custom-navbar .navbar-toggler { border: none; }

.navbar-static { position: sticky; top: 0; z-index: 1000; padding: 0.5rem 0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.navbar-static .nav-link { color: #fff !important; font-weight: 600; margin: 0 0.75rem; position: relative; padding: 0.25rem 0; }
.navbar-static .nav-link::after { content: ''; position: absolute; bottom: -3px; left: 50%; width: 0; height: 2px; background: #fff; transition: width 0.3s ease, left 0.3s ease; }
.navbar-static .nav-link:hover::after, .navbar-static .nav-link.active::after { width: 100%; left: 0; }

@media (max-width: 992px) {
  .navbar-static .navbar-nav { flex-direction: column; background-color: rgba(140,0,0,1); border-radius: 0 0 0.5rem 0.5rem; margin-top: 0.5rem; }
  .navbar-static .nav-link { margin: 0.5rem 0; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero-banner {
  position: relative;
  background: linear-gradient(180deg, rgba(0,0,0,0.65), rgba(0,0,0,0.6)), url('../img/hero-bg.jpg') center/cover no-repeat;
  min-height: 80vh;
  display: flex;
  align-items: center;
  color: #fff;
}

.hero-banner .overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); z-index: 1; }
.hero-container { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; align-items: center; }
.hero-text { max-width: 720px; }
.hero-title { font-size: 2.75rem; font-weight: 800; line-height: 1.2; animation: fadeDown 1s ease-out forwards; }
.hero-subtitle { font-size: 1.1rem; opacity: 0; animation: fadeDown 1s ease-out forwards; animation-delay: 0.25s; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-highlight { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #fff; backdrop-filter: blur(6px); border-radius: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.hero-highlight .hero-list { list-style: none; padding: 0; margin: 0; }
.hero-highlight .hero-list li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.hero-highlight .hero-list i { color: #fff; }

@media (max-width: 768px) {
  body { padding-top: 70px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .custom-navbar .navbar-logo { height: 60px; }
}

@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   Destacados / Features
   ========================================================= */
.feature-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(0,0,0,0.12); }
.feature-icon { width: 54px; height: 54px; border-radius: 12px; background: rgba(192, 28, 28, 0.1); color: var(--color-rojo); display: grid; place-items: center; font-size: 1.25rem; margin: 0 auto 1rem; }

/* =========================================================
   Sección Quiénes somos
   ========================================================= */
#about { background-color: var(--color-rojo-fondo) !important; color: var(--color-blanco) !important; overflow: hidden; }
#about h2, #about p { color: var(--color-blanco) !important; }
#about .about-highlights { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); padding: 1.25rem; border-radius: 1rem; box-shadow: 0 12px 28px rgba(0,0,0,0.18); }
#about .about-icon { width: 44px; height: 44px; background: rgba(255,255,255,0.14); color: #fff; border-radius: 12px; display: grid; place-items: center; margin-right: 0.85rem; }
#about .about-slider { border-radius: 1.25rem; overflow: hidden; }
#about .about-slide { position: relative; height: 420px; border-radius: 1rem; overflow: hidden; }
#about .about-image { width: 100%; height: 100%; object-fit: cover; }
#about .about-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.25rem 1.5rem; background: linear-gradient(0deg, rgba(0,0,0,0.65), rgba(0,0,0,0.05)); color: #fff; font-weight: 600; font-size: 1rem; }
#about .about-pagination { position: absolute; bottom: 0.75rem; left: 0; right: 0; z-index: 10; }
#about .about-pagination .swiper-pagination-bullet { background: #fff; opacity: 0.6; width: 10px; height: 10px; }
#about .about-pagination .swiper-pagination-bullet-active { opacity: 1; transform: scale(1.1); }
#about .nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 11; width: 42px; height: 42px; background: #fff; border: none; border-radius: 50%; display: grid; place-items: center; color: var(--color-rojo); box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
#about .about-prev { left: 12px; }
#about .about-next { right: 12px; }

/* =========================================================
   Stats band
   ========================================================= */
.stats-band { background: linear-gradient(90deg, rgba(192,28,28,0.12), rgba(139,0,0,0.12)); }
.stats-band h3 { font-weight: 800; color: var(--color-rojo); font-size: 2rem; }
.stats-band p { margin-bottom: 0; color: #333; }

/* =========================================================
   Diferenciales
   ========================================================= */
.checklist { list-style: none; padding: 0; margin: 1.5rem 0; }
.checklist li { margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.65rem; }
.checklist i { color: var(--color-rojo); }

/* =========================================================
   Visión / Misión
   ========================================================= */
#vision-mission .vm-card { border-radius: 1rem; padding: 2rem; background: var(--color-rojo-fondo); color: var(--color-blanco); box-shadow: 0 8px 24px rgba(0,0,0,0.15); transition: transform 0.3s; }
#vision-mission .vm-card:hover { transform: translateY(-10px); }

/* =========================================================
   Testimonios
   ========================================================= */
#testimonios h2 { color: #fff; margin-bottom: 2rem; text-align: center; }
.reviews-wrapper { background: #fff; border-radius: 1rem; padding: 2rem 4rem; display: flex; gap: 2rem; align-items: center; margin: 0 auto; max-width: 1200px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }

.static-card { flex: 0 0 260px; border-right: 1px solid rgba(0,0,0,0.1); padding-right: 1.5rem; display: flex; flex-direction: column; align-items: flex-start; }
.static-logo { height: 100px; margin-bottom: 1rem; object-fit: contain; }
.static-card h5 { font-size: 1rem; font-weight: 600; color: #333; margin-bottom: 0.5rem; }
.static-stars { font-size: 1.25rem; color: gold; margin-bottom: 0.5rem; }
.static-count { font-size: 0.875rem; color: #555; margin-bottom: 1rem; }

.btn-review, .reviews-wrapper .btn-rojo { background: var(--color-rojo) !important; color: #fff !important; border: 2px solid var(--color-rojo) !important; padding: 0.5rem 1rem; font-size: 0.9rem; border-radius: 0.5rem; text-decoration: none; transition: background 0.2s; }
.btn-review:hover, .reviews-wrapper .btn-rojo:hover { background: #a51717 !important; }

.reviews-swiper { flex: 1; position: relative; }
.reviews-swiper .swiper-wrapper { align-items: center; }
.reviews-swiper .swiper-slide { display: flex !important; justify-content: center; width: auto !important; }
.reviews-swiper .card { width: 100%; max-width: 280px; border: none; border-radius: 1rem; box-shadow: 0 10px 26px rgba(0,0,0,0.12); transition: transform 0.3s, box-shadow 0.3s; padding-top: 2.5rem; position: relative; }
.reviews-swiper .card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0,0,0,0.16); }
.reviews-swiper .card-body { display: flex; flex-direction: column; }
.reviews-swiper .card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; color: #333; }
.reviews-swiper .card-text { font-size: 0.9rem; color: #555; margin-bottom: 0.75rem; }
.reviews-swiper .text-warning { font-size: 1rem; color: gold; line-height: 1; margin-bottom: 0.5rem; }
.reviews-swiper small { font-size: 0.75rem; color: #888; }
.reviews-swiper .google-icon { position: absolute; top: 0.75rem; right: 0.75rem; width: 20px; height: 20px; object-fit: contain; }
.reviews-swiper .verified-icon, .reviews-swiper .fa-check-circle, .reviews-swiper .verified-badge { display: none !important; }
.review-card { width: 260px; display: flex; flex-direction: column; height: 100%; }
.review-card .card-body { flex: 1; display: flex; flex-direction: column; }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.review-avatar.placeholder { background: var(--color-rojo); color: #fff; display: grid; place-items: center; font-weight: 700; }

.reviews-prev, .reviews-next { position: absolute; top: 50%; transform: translateY(-50%); width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; background: var(--color-rojo); border-radius: 50%; box-shadow: 0 8px 16px rgba(0,0,0,0.15); cursor: pointer; z-index: 30; }
.reviews-prev { left: -3.25rem; }
.reviews-next { right: -3.25rem; }
.reviews-prev i, .reviews-next i { color: #fff; font-size: 1.5rem; }

.reviews-pagination .swiper-pagination-bullet { background: var(--color-rojo); opacity: 0.4; }
.reviews-pagination .swiper-pagination-bullet-active { opacity: 1; }

/* =========================================================
   Sección contacto index
   ========================================================= */
#index-contacto { background-color: var(--color-gris-claro); }
#index-contacto .contacto-card-info { background-color: var(--color-rojo-fondo); color: var(--color-blanco); border: none; border-radius: 1rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; }
#index-contacto .contacto-card-info:hover { transform: translateY(-4px); }
#index-contacto .contacto-card-info h3 { color: var(--color-blanco); }
#index-contacto .contacto-card-info p { margin-bottom: 1rem; font-size: 0.95rem; }
#index-contacto .social-links a { color: var(--color-blanco); font-size: 1.25rem; margin-right: 1rem; transition: color 0.3s ease, transform 0.3s ease; }
#index-contacto .social-links a:hover { color: #ffdede; transform: translateY(-2px); }
#index-contacto .contacto-card-map { border: none; border-radius: 1rem; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; }
#index-contacto .contacto-card-map:hover { transform: translateY(-4px); }

/* =========================================================
   Páginas internas existentes
   ========================================================= */
.psico-hero { height: 50vh; position: relative; background: url('../img/psico-hero.jpg') center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.psico-hero .overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.psico-hero > .text-center { position: relative; z-index: 2; color: var(--color-blanco); }
.psico-hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.psico-hero p.lead { font-size: 1.1rem; margin-bottom: 0; }
.bg-rojo-fondo.text-white.text-center { background-color: var(--color-rojo-fondo) !important; color: var(--color-blanco) !important; padding: 3rem 0; }
.bg-rojo-fondo.text-white.text-center h2, .bg-rojo-fondo.text-white.text-center p.lead { color: var(--color-blanco) !important; margin: 0; }
.psico-card { background-color: #fff; border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.psico-card:hover { transform: translateY(-6px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.psico-card-header { background: var(--color-rojo); color: var(--color-blanco); text-align: center; padding: 1rem 0; }
.psico-card-body { padding: 1.5rem; text-align: center; }
.psico-card-body h5 { margin-bottom: 0.5rem; color: var(--color-negro); }

.section-banner-cursos { background-color: var(--color-rojo-fondo); padding: 3rem 0; text-align: center; }
.section-banner-cursos h1, .section-banner-cursos p { color: var(--color-blanco); }
.curso-card { background-color: var(--color-blanco); border-radius: 1rem; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative; }
.curso-card:hover { transform: translateY(-8px); box-shadow: 0 10px 24px rgba(0,0,0,0.15); }
.curso-card .ratio { height: 180px; overflow: hidden; }
.curso-card .ratio img, .curso-card .ratio video { width: 100%; height: 100%; object-fit: cover; }
.price-badge { position: absolute; top: 1rem; right: 1rem; background-color: var(--color-rojo); color: var(--color-blanco); padding: 0.5rem 0.75rem; border-radius: 2rem; font-weight: 600; }
.curso-title { background-color: var(--color-rojo); color: var(--color-blanco); text-align: center; padding: 0.75rem 0; font-size: 1.25rem; font-weight: 600; margin: 0; }
.curso-card .card-text { padding: 0 1rem 1rem; font-size: 0.95rem; }
.curso-card .btn-rojo { display: block; margin: 0 auto 1rem; }
.requisito-item { display: flex; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid #ddd; }
.requisito-item .icono-check { color: var(--color-rojo); margin-right: 0.75rem; font-size: 1.1rem; }

#contacto { padding: 4rem 0; background-color: var(--color-gris-claro); }
.contacto-card { background-color: var(--color-rojo-fondo); color: var(--color-blanco); border-radius: 0.75rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.contacto-card:hover { transform: translateY(-6px); }
.contacto-card .card-body { padding: 2rem; }
.contacto-card .card-title { font-size: 1.5rem; margin-bottom: 1rem; }
.contacto-card p { font-size: 0.95rem; margin-bottom: 1rem; }
.icono-rojo { color: var(--color-blanco); margin-right: 0.5rem; }
.card-footer .social-link { color: var(--color-blanco); margin: 0 0.5rem; font-size: 1.25rem; transition: transform 0.2s ease; }
.card-footer .social-link:hover { transform: translateY(-3px); color: #ffb3b3; }
.contacto-card iframe { width: 100%; height: 100%; min-height: 350px; border: none; }

/* =========================================================
   Footer y WhatsApp
   ========================================================= */
footer { background-color: var(--color-rojo-fondo); color: var(--color-blanco); text-align: center; padding: 1rem 0; }
.whatsapp-float { position: fixed; bottom: 1.5rem; right: 1.5rem; background-color: #25d366; color: #fff; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: transform 0.3s ease; z-index: 10001; }
.whatsapp-float:hover { transform: translateY(-4px); }

/* =========================================================
   Chat flotante
   ========================================================= */
#chat-widget { position: fixed; bottom: 90px; right: 1.5rem; width: 340px; font-family: 'Poppins', sans-serif; z-index: 10002; }
#chat-toggle { width: 56px; height: 56px; border-radius: 50%; background: var(--color-rojo); color: #fff; display: grid; place-items: center; font-size: 1.25rem; box-shadow: 0 10px 24px rgba(192,28,28,0.35); cursor: pointer; margin-left: auto; }
#chat-body { margin-top: 0.75rem; background: #fff; border-radius: 1rem; box-shadow: 0 12px 30px rgba(0,0,0,0.18); overflow: hidden; display: flex; flex-direction: column; }
#chat-header { background: linear-gradient(90deg, #c01c1c, #8b0000); color: #fff; padding: 0.9rem 1rem; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
#chat-header button { background: none; border: none; color: #fff; font-size: 1.25rem; cursor: pointer; }
#chat-log { max-height: 260px; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; background: #f8f9fb; }
.chat-message { padding: 0.65rem 0.85rem; border-radius: 0.85rem; font-size: 0.9rem; line-height: 1.45; width: fit-content; max-width: 90%; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.chat-message.user { margin-left: auto; background: #fce7e7; color: #7a0b0b; }
.chat-message.bot { background: #fff; color: #333; }
#quick-replies { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1rem 1rem; }
#quick-replies button { background: #f5f5f5; border: 1px solid #ececec; border-radius: 999px; padding: 0.35rem 0.8rem; font-size: 0.85rem; cursor: pointer; transition: all 0.2s ease; }
#quick-replies button:hover { background: #ffecec; border-color: var(--color-rojo); color: var(--color-rojo); }
#chat-input-area { display: flex; gap: 0.5rem; padding: 0.75rem 1rem 1rem; border-top: 1px solid #eee; }
#chat-input { flex: 1; border: 1px solid #e0e0e0; border-radius: 0.75rem; padding: 0.6rem 0.8rem; outline: none; }
#chat-input:focus { border-color: var(--color-rojo); box-shadow: 0 0 0 3px rgba(192,28,28,0.15); }
#chat-send { background: var(--color-rojo); border: none; color: #fff; padding: 0.55rem 1.1rem; border-radius: 0.75rem; font-weight: 600; box-shadow: 0 8px 18px rgba(192,28,28,0.3); cursor: pointer; }

#chat-widget.collapsed #chat-body { display: none; }
#chat-widget.collapsed { width: 56px; }
#chat-widget:not(.collapsed) #chat-toggle { display: none; }

/* =========================================================
   Responsive ajustes
   ========================================================= */
@media (max-width: 992px) {
  .curso-card .ratio { height: 160px; }
  .contacto-card .card-body { padding: 1.5rem; }
  .psico-hero h1 { font-size: 2.5rem; }
  .psico-hero p.lead { font-size: 1rem; }
  .reviews-wrapper { padding: 2rem; flex-direction: column; }
  .static-card { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.1); padding-right: 0; padding-bottom: 1.5rem; width: 100%; }
  .reviews-prev { left: 0; }
  .reviews-next { right: 0; }
}

@media (max-width: 576px) {
  .curso-card .ratio { height: 140px; }
  .psico-hero h1 { font-size: 2rem; }
  .psico-hero p.lead { font-size: 0.9rem; }
  .hero-container { grid-template-columns: 1fr; }
  .hero-highlight { order: -1; }
}