/* ==========================================================
   MAGISTRI — Gestión de Cobros
   Estilos del theme (sobre Bootstrap 5.3)
   ========================================================== */

:root {
  --mg-red: #d31027;
  --mg-red-dark: #9e0b1c;
  --mg-red-soft: #fdecee;
  --mg-dark: #1f2430;
  --mg-gray: #5a6472;
  --mg-light: #f5f5f6;
  --mg-serif: "Playfair Display", Georgia, serif;
  --mg-sans: "Mulish", -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  font-family: var(--mg-sans);
  color: var(--mg-gray);
  font-size: 15px;
  line-height: 1.7;
  background: #fff;
}

h1, h2, h3, .h1, .h2, .h3, .serif { font-family: var(--mg-serif); color: var(--mg-dark); }
h4, h5, h6 { font-family: var(--mg-sans); color: var(--mg-dark); font-weight: 700; }

a { color: var(--mg-red); text-decoration: none; }
a:hover { color: var(--mg-red-dark); }

.text-red { color: var(--mg-red) !important; }
.bg-red { background-color: var(--mg-red) !important; }

.eyebrow {
  font-size: 20px;
  line-height: 20px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mg-red);
  margin-bottom: .75rem;
}

.btn-mg {
  background: var(--mg-red);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: .65rem 1.5rem;
  border-radius: .35rem;
  border: 1px solid var(--mg-red);
  transition: all .2s ease;
}
.btn-mg:hover { background: var(--mg-red-dark); border-color: var(--mg-red-dark); color: #fff; }

.btn-mg-outline {
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: .65rem 1.5rem;
  border-radius: .35rem;
  border: 1px solid rgba(255,255,255,.55);
  transition: all .2s ease;
}
.btn-mg-outline:hover { background: #fff; color: var(--mg-dark); }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  padding: .85rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.site-header .navbar-nav .nav-link {
  color: var(--mg-dark);
  font-size: 18px;
  font-weight: 600;
  padding: .5rem .85rem;
  position: relative;
}
.site-header .navbar-nav .nav-link:hover,
.site-header .navbar-nav .current-menu-item > .nav-link,
.site-header .navbar-nav .current_page_item > .nav-link { color: var(--mg-red); }
.site-header .navbar-nav .current-menu-item > .nav-link::after,
.site-header .navbar-nav .current_page_item > .nav-link::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 0;
  height: 2px; background: var(--mg-red);
}
.header-social a {
  color: var(--mg-dark);
  font-size: 18px;
  margin-left: .8rem;
}
.header-social a:hover { color: var(--mg-red); }

.brand-logo { display: flex; align-items: center; gap: .55rem; }
.brand-logo img { max-height: 44px; width: auto; }
.brand-mark { color: var(--mg-red); font-size: 1.9rem; line-height: 1; }
.brand-text { line-height: 1.05; }
.brand-text .brand-name { font-weight: 900; letter-spacing: .06em; color: var(--mg-dark); font-size: 1.05rem; }
.brand-text .brand-tag { font-size: .5rem; letter-spacing: .22em; color: var(--mg-gray); text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 6.5rem 0 4.5rem;
}
.hero { overflow: hidden; }
.hero video {
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,22,35,.55) 0%, rgba(15,22,35,.65) 100%);
  z-index: 2;
}
.hero > .container { position: relative; z-index: 3; }

/* Respeta la preferencia de movimiento reducido: oculta el video y deja la imagen */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
.hero .eyebrow { color: #fff; opacity: .9; }
.hero h1 {
  color: #fff;
  font-weight: 700;
  font-size: 59px;
  line-height: 1.2;
  max-width: 870px;
  margin: 0 auto 1.25rem;
}
.hero .hero-text { max-width: 870px; margin: 0 auto 1.75rem; font-size: 22px; opacity: .92; }

.hero-stats { margin-top: 3rem; }
.hero .hero-stats .stat-num { font-family: var(--mg-serif); font-size: 39px; font-weight: 700; color: #fff; }
.hero .hero-stats .stat-label { font-size: 16px; opacity: .85; }

.why-box {
  margin: 3rem auto 0;
  max-width: 800px;
  background: rgba(30, 38, 45, .45);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  border-radius: .75rem;
  padding: 1.5rem 2rem;
}
.why-box h5 { color: #fff; margin-bottom: 1.1rem; }
.hero .why-box h5 { font-size: 20px; line-height: 20px; }
.why-box .why-item { color: #fff; font-size: 16px; font-weight: 600; display: flex; gap: .5rem; align-items: flex-start; }
.why-box .why-item i { color: #fff; opacity: .9; margin-top: .1rem; }

/* ---------- Secciones ---------- */
.section { padding: 5rem 0; }
h2.section-title { font-size: 55px; font-weight: 400; line-height: 55px; }
.section-title { font-weight: 400; }
.section-lead { max-width: 620px; margin: 1rem auto 0; font-size: .9rem; }

/* Sobre nosotros */
.about-feature { display: flex; gap: 1rem; margin-top: 1.4rem; }
.about-feature .icon-badge {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: .6rem;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.about-feature h6 { margin-bottom: .2rem; font-size: .9rem; }
.about-feature p { margin: 0; font-size: .85rem; }

.mission-card {
  background: var(--mg-light);
  border-left: 3px solid var(--mg-red);
  border-radius: .9rem;
  padding: 2.4rem 2.2rem;
  height: 100%;
}
.mission-card .icon-badge {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  margin-bottom: 1.2rem;
}
.mission-card .mission-years { font-size: 2rem; font-weight: 800; color: var(--mg-red); font-family: var(--mg-sans); }

/* Servicios */
.service-card {
  border: 1px solid #ececee;
  border-radius: .75rem;
  padding: 1.9rem 1.7rem;
  height: 100%;
  background: #fff;
  transition: box-shadow .25s ease, transform .25s ease;
}
.service-card:hover { box-shadow: 0 18px 40px rgba(31,36,48,.1); transform: translateY(-3px); }
.service-card .icon-badge {
  width: 52px; height: 52px; border-radius: .7rem;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
  margin-bottom: 1.1rem;
}
.service-card h5 { font-size: .98rem; }
.service-card p { font-size: .84rem; }
.link-more { font-size: .8rem; font-weight: 700; color: var(--mg-red); }
.link-more i { transition: transform .2s ease; }
.link-more:hover i { transform: translateX(4px); }

/* Valores */
.value-card {
  border: 1px solid #ececee;
  border-radius: .75rem;
  padding: 1.9rem 1.6rem;
  height: 100%;
  background: #fff;
}
.value-card.is-featured { box-shadow: 0 20px 45px rgba(31,36,48,.12); border-color: transparent; }
.value-card .icon-badge {
  width: 50px; height: 50px; border-radius: .7rem;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  margin-bottom: 1rem;
}
.value-card h5 { font-family: var(--mg-serif); font-size: 1.05rem; }
.value-card p { font-size: .83rem; margin: 0; }

/* Sección roja */
.red-section {
  background: linear-gradient(180deg, #e01126 0%, var(--mg-red-dark) 100%);
  color: #fff;
  padding: 5rem 0;
}
.red-section .eyebrow, .red-section h2, .red-section p { color: #fff; }
.red-section .section-lead { opacity: .92; }
.red-card {
  background: rgba(120, 8, 20, .55);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .75rem;
  padding: 1.8rem 1.5rem;
  height: 100%;
}
.red-card .icon-badge {
  width: 48px; height: 48px; border-radius: .65rem;
  background: rgba(255,255,255,.14); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  margin-bottom: 1rem;
}
.red-card h5 { color: #fff; font-family: var(--mg-serif); font-size: 1.02rem; }
.red-card p { font-size: .82rem; margin: 0; opacity: .92; }

/* Industrias */
.industry-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid #e6e6e9; border-radius: 2rem;
  background: #fff;
  padding: .5rem 1.1rem;
  font-size: .8rem; font-weight: 600; color: var(--mg-dark);
  margin: .3rem .25rem;
  transition: all .2s ease;
}
.industry-pill i { color: var(--mg-red); }
.industry-pill:hover { border-color: var(--mg-red); color: var(--mg-red); }

/* CTA */
.cta-section { background: var(--mg-light); padding: 5rem 0; }
.cta-section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ---------- Footer ---------- */
.site-footer { background: var(--mg-red); color: #fff; padding: 4rem 0 0; font-size: .85rem; }
.site-footer a { color: #fff; opacity: .9; }
.site-footer a:hover { opacity: 1; color: #fff; text-decoration: underline; }
.site-footer h6 { color: #fff; font-size: .95rem; margin-bottom: 1.1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: .55rem; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-tag { color: rgba(255,255,255,.8); }
.footer-brand .brand-mark { color: #fff; }
.footer-social a {
  display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.4); border-radius: 50%; margin-right: .5rem;
}
.footer-social a:hover { background: #fff; color: var(--mg-red) !important; text-decoration: none; }
.footer-contact li { display: flex; gap: .6rem; align-items: flex-start; }
.footer-contact i { margin-top: .2rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.25);
  margin-top: 3rem;
  padding: 1.2rem 0;
  font-size: .78rem;
}

/* ---------- Contenido interno (blog / páginas) ---------- */
.page-hero {
  background: var(--mg-dark) center/cover no-repeat;
  position: relative; color: #fff; padding: 4.5rem 0;
}
.page-hero::before { content:""; position:absolute; inset:0; background: rgba(15,22,35,.6); }
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem,3.5vw,2.6rem); }

.entry-content h2, .entry-content h3 { margin-top: 2rem; }
.entry-content img { max-width: 100%; height: auto; border-radius: .5rem; }

.post-card { border: 1px solid #ececee; border-radius: .75rem; overflow: hidden; height: 100%; background:#fff; }
.post-card .post-thumb { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post-card .card-body { padding: 1.4rem; }
.post-meta { font-size: .75rem; color: var(--mg-gray); }

.scf-box {
  background: var(--mg-light); border-left: 3px solid var(--mg-red);
  border-radius: .6rem; padding: 1.2rem 1.4rem; margin: 1.5rem 0; font-size: .88rem;
}

/* ==========================================================
   Ajustes de tipografía y componentes
   ========================================================== */
p { font-size: 16px; }
.section-lead,
.service-card p,
.value-card p,
.red-card p { font-size: 16px; }

.btn-mg { font-size: 16px; padding: 10px 40px; }
.link-more { font-size: 14px; }
.industry-pill { font-size: 14px; }

.about-feature .icon-badge,
.mission-card .icon-badge,
.service-card .icon-badge,
.value-card .icon-badge {
  width: 52px;
  height: 52px;
  font-size: 29px;
}
.red-card .icon-badge {
  width: 62px;
  height: 62px;
  font-size: 45px;
}

.about-feature h6 { font-size: 18px; }
.mission-card h5 { font-family: var(--mg-serif); font-size: 22px; }
.service-card h5 { font-size: 18px; }
.value-card h5 { font-size: 26px; font-weight: normal; }
.red-card h5 { font-size: 24px; font-weight: normal; }

/* Escalado de los tamaños fijos en pantallas menores */
@media (max-width: 991px) {
  .hero h1 { font-size: 44px; }
  .hero .hero-text { font-size: 19px; }
  h2.section-title { font-size: 40px; line-height: 44px; }
  .hero .hero-stats .stat-num { font-size: 32px; }
}

@media (max-width: 767px) {
  .hero { padding: 4.5rem 0 3.5rem; }
  .section { padding: 3.5rem 0; }
  .why-box { padding: 1.25rem 1.25rem; }
  .hero h1 { font-size: 34px; line-height: 1.25; }
  .hero .hero-text { font-size: 17px; }
  h2.section-title { font-size: 30px; line-height: 36px; }
  .eyebrow { font-size: 16px; line-height: 18px; }
  .hero .hero-stats .stat-num { font-size: 28px; }
}

/* ==========================================================
   PÁGINAS INTERIORES (Servicios / Quiénes Somos)
   ========================================================== */

/* --- Hero de página interior --- */
.inner-hero {
  position: relative;
  background: var(--mg-dark) center/cover no-repeat;
  color: #fff;
  padding: 7rem 0 6rem;
  overflow: hidden;
  text-align: center;
}
.inner-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,22,35,.62) 0%, rgba(15,22,35,.72) 100%);
  z-index: 1;
}
/* Retícula sutil como en el boceto */
.inner-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}
.inner-hero > .container { position: relative; z-index: 3; }
.inner-hero h1 {
  color: #fff;
  font-weight: 700;
  font-size: 55px;
  line-height: 1.15;
  max-width: 870px;
  margin: 0 auto 1.1rem;
}
.inner-hero .hero-text { max-width: 720px; margin: 0 auto; font-size: 18px; opacity: .92; }
.inner-hero .eyebrow { color: #fff; opacity: .9; }

/* Antetítulo con línea lateral (bocetos) */
.eyebrow-line { display: inline-flex; align-items: center; gap: .75rem; }
.eyebrow-line::before {
  content: ""; width: 34px; height: 1px; background: currentColor; opacity: .6;
}

/* Subrayado corto bajo el título */
.title-rule { width: 64px; height: 3px; background: var(--mg-red); border-radius: 2px; margin: 1rem auto 0; }

/* --- Timeline "¿Cómo funciona?" --- */
.process { position: relative; max-width: 780px; margin: 0 auto; }
.process-step { position: relative; display: flex; gap: 1.75rem; padding-bottom: 2.25rem; }
.process-step:last-child { padding-bottom: 0; }
.process-num {
  flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--mg-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  position: relative; z-index: 2;
}
/* Línea vertical que une los pasos */
.process-step::before {
  content: ""; position: absolute;
  left: 23px; top: 46px; bottom: 0; width: 1px;
  background: #e4e4e7;
}
.process-step:last-child::before { display: none; }
.process-body {
  flex: 1 1 auto;
  background: #fff;
  border: 1px solid #f0f0f2;
  border-left: 3px solid var(--mg-red);
  border-radius: .5rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 30px rgba(31,36,48,.05);
}
.process-body h3 { font-family: var(--mg-serif); font-size: 24px; font-weight: 700; margin-bottom: .6rem; }
.process-body p { margin: 0; font-size: 16px; }

/* --- Tarjetas de diferenciadores (borde izquierdo) --- */
.edge-card {
  background: #fff;
  border: 1px solid #f0f0f2;
  border-left: 3px solid var(--mg-red);
  border-radius: .4rem;
  padding: 1.75rem 1.6rem;
  height: 100%;
}
.edge-card .icon-badge {
  width: 46px; height: 46px; border-radius: .5rem;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  margin-bottom: 1.1rem;
}
.edge-card h5 { font-family: var(--mg-serif); font-size: 22px; font-weight: 700; margin-bottom: .5rem; }
.edge-card p { margin: 0; }

/* --- Píldoras de industria con flecha --- */
.industry-pill .fa-chevron-right { font-size: 11px; opacity: .55; margin-left: .35rem; }

/* --- Bloque historia (imagen + texto) --- */
.story-img {
  width: 100%; border-radius: .5rem; object-fit: cover;
  box-shadow: 0 22px 50px rgba(31,36,48,.16);
}
.story-text h2 { font-family: var(--mg-serif); font-size: 36px; font-weight: 700; line-height: 1.25; margin-bottom: 1.2rem; }

/* --- Misión y Visión --- */
.mv-section { background: var(--mg-light); }
.mv-card {
  background: #fff;
  border-left: 3px solid var(--mg-red);
  border-radius: .4rem;
  padding: 2rem 1.9rem;
  height: 100%;
}
.mv-card .icon-badge {
  width: 52px; height: 52px; border-radius: .5rem;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  margin-bottom: 1.2rem;
}
.mv-card h5 { font-family: var(--mg-serif); font-size: 24px; font-weight: 700; margin-bottom: .6rem; }
.mv-card p { margin: 0; }

/* --- Valores en fila con separador --- */
.value-slim { padding: 0 1.4rem; border-left: 1px solid #ececee; height: 100%; }
.value-slim .icon-badge {
  width: 44px; height: 44px; border-radius: .5rem;
  background: var(--mg-red-soft); color: var(--mg-red);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-bottom: 1rem;
}
.value-slim h5 { font-family: var(--mg-serif); font-size: 22px; font-weight: 700; margin-bottom: .4rem; }
.value-slim p { margin: 0; font-size: 15px; }

/* --- Botón volver arriba --- */
.to-top {
  position: fixed; left: 1.5rem; right: auto; bottom: 1.5rem; z-index: 1040;
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--mg-red);
  border: 1px solid #e6e6e9;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(31,36,48,.14);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .25s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--mg-red); color: #fff; border-color: var(--mg-red); }

@media (max-width: 991px) {
  .inner-hero h1 { font-size: 40px; }
  .story-text h2 { font-size: 30px; }
  .value-slim { border-left: 0; padding: 0; }
}
@media (max-width: 767px) {
  .inner-hero { padding: 5rem 0 4rem; }
  .inner-hero h1 { font-size: 32px; }
  .inner-hero .hero-text { font-size: 16px; }
  .process-step { gap: 1rem; }
  .process-body { padding: 1.2rem 1.2rem; }
  .process-body h3 { font-size: 20px; }
}

/* Logo del footer */
.site-footer .footer-brand { text-decoration: none; align-items: center; }
.site-footer .footer-brand:hover { text-decoration: none; opacity: .9; }
.site-footer .footer-brand img { max-width: 100%; height: auto; display: block; }

/* Mapa de contacto */
.contact-map iframe { width: 100%; height: 420px; border: 0; display: block; }

/* ==========================================================
   CONTACT FORM 7 — Magistri
   ========================================================== */
.contact-form {
  width: 100%;
}
.contact-form .form-group {
  margin-bottom: 20px;
}
.contact-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--mg-dark);
  font-family: var(--mg-sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 13px 16px;
  box-sizing: border-box;
  border: 1px solid #d9dee7;
  border-radius: .5rem;
  outline: 0;
  background: #fff;
  color: var(--mg-dark);
  font-family: var(--mg-sans);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #929aa6;
  opacity: 1;
}
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--mg-red);
  box-shadow: 0 0 0 3px rgba(211, 16, 39, .10);
}
.contact-form select {
  cursor: pointer;
}
.contact-form .form-submit {
  margin-top: 8px;
}
.contact-form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 30px;
  border: 1px solid var(--mg-red);
  border-radius: .35rem;
  background: var(--mg-red);
  color: #fff;
  font-family: var(--mg-sans);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.contact-form input[type="submit"]:hover {
  border-color: var(--mg-red-dark);
  background: var(--mg-red-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(158, 11, 28, .18);
}
.contact-form input[type="submit"]:active {
  transform: translateY(0);
}
.contact-form .wpcf7-not-valid {
  border-color: #c62828 !important;
}
.contact-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  color: #b42318;
  font-size: 13px;
}
.wpcf7 form .wpcf7-response-output {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: .5rem;
  font-size: 14px;
  line-height: 1.5;
}
.wpcf7 form.sent .wpcf7-response-output {
  border: 1px solid #16803c;
  background: #f1fbf4;
  color: #125f31;
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
  border: 1px solid #c62828;
  background: #fff4f4;
  color: #9f1d1d;
}
.contact-form .wpcf7-spinner {
  margin: 0 0 0 12px;
  vertical-align: middle;
}

/* ==========================================================
   MOBILE UX — navegación y portada
   Estos overrides están al final para prevalecer sobre reglas
   anteriores del theme y de Bootstrap en pantallas pequeñas.
   ========================================================== */
@media (max-width: 991.98px) {
  /* Header más compacto y menú desplegable superpuesto. */
  .site-header {
    padding: .6rem 0;
  }
  .site-header .navbar,
  .site-header .navbar > .container {
    position: relative;
  }
  .brand-logo img {
    max-height: 38px;
  }
  .site-header .navbar-toggler {
    padding: .35rem .5rem;
    border-color: #dedee2;
    box-shadow: none !important;
  }
  .site-header .navbar-collapse {
    position: absolute;
    top: calc(100% + .6rem);
    left: .75rem;
    right: .75rem;
    z-index: 1060;
    margin: 0;
    padding: .65rem;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #ececee;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 18px 45px rgba(31, 36, 48, .16);
  }
  .site-header .navbar-nav {
    margin: 0 !important;
  }
  .site-header .navbar-nav .nav-link {
    display: block;
    padding: .72rem .8rem;
    border-radius: .45rem;
    font-size: 15px;
    line-height: 1.3;
  }
  .site-header .navbar-nav .nav-link:hover,
  .site-header .navbar-nav .current-menu-item > .nav-link,
  .site-header .navbar-nav .current_page_item > .nav-link {
    background: var(--mg-red-soft);
  }
  .site-header .navbar-nav .current-menu-item > .nav-link::after,
  .site-header .navbar-nav .current_page_item > .nav-link::after {
    display: none;
  }

  /* Portada: reduce tipografías y aire sin tocar páginas internas. */
  .hero {
    padding: 4rem 0 3rem;
  }
  .hero h1 {
    max-width: 760px;
    font-size: 38px;
    line-height: 1.15;
  }
  .hero .hero-text {
    max-width: 700px;
    font-size: 17px;
    line-height: 1.6;
  }
  .hero .eyebrow,
  #nosotros .eyebrow,
  #servicios .eyebrow,
  #experiencia .eyebrow,
  #industrias .eyebrow {
    font-size: 14px;
    line-height: 1.35;
  }
  #nosotros h2.section-title,
  #servicios h2.section-title,
  #valores h2.section-title,
  #experiencia h2.section-title,
  #industrias h2.section-title {
    font-size: 36px;
    line-height: 1.12;
  }
  .hero .hero-stats .stat-num {
    font-size: 30px;
  }
  .hero .hero-stats .stat-label,
  .hero .why-box .why-item {
    font-size: 14px;
    line-height: 1.45;
  }

  .section,
  .red-section,
  .cta-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  #servicios.section.pt-0,
  #valores.section.pt-0 {
    padding-top: 0;
  }

  .mission-card,
  .service-card,
  .value-card,
  .red-card {
    padding: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 15px;
    line-height: 1.62;
  }
  p,
  .section-lead,
  .service-card p,
  .value-card p,
  .red-card p {
    font-size: 15px;
    line-height: 1.62;
  }

  .site-header {
    padding: .5rem 0;
  }
  .site-header .navbar-collapse {
    top: calc(100% + .5rem);
    left: .5rem;
    right: .5rem;
    max-height: calc(100vh - 78px);
  }
  .brand-logo img {
    max-height: 34px;
  }

  /* Hero: contenido más escaneable y botones cómodos para dedo. */
  .hero {
    min-height: auto;
    padding: 3.35rem 0 2.6rem;
    background-position: center center;
  }
  .hero > .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  .hero h1 {
    max-width: 560px;
    margin-bottom: 1rem;
    font-size: clamp(28px, 8.2vw, 34px);
    line-height: 1.14;
  }
  .hero .hero-text {
    max-width: 540px;
    margin-bottom: 1.35rem;
    font-size: 15.5px;
    line-height: 1.55;
  }
  .hero .d-flex.justify-content-center.gap-2.flex-wrap {
    gap: .65rem !important;
  }
  .hero .btn-mg,
  .hero .btn-mg-outline {
    min-height: 46px;
    padding: .7rem 1.15rem;
    font-size: 14px;
  }

  /* Estadísticas: tres datos alineados, sin el salto 2 + 1 de Bootstrap. */
  .hero-stats {
    margin-top: 2.1rem;
    --bs-gutter-x: .6rem;
    --bs-gutter-y: .75rem;
  }
  .hero-stats > .col-6 {
    flex: 0 0 33.333333%;
    width: 33.333333%;
  }
  .hero .hero-stats .stat-num {
    font-size: 25px;
    line-height: 1.1;
  }
  .hero .hero-stats .stat-label {
    margin-top: .25rem;
    font-size: 11.5px;
    line-height: 1.3;
  }

  .why-box {
    margin-top: 2rem;
    padding: 1.15rem;
    text-align: left !important;
  }
  .hero .why-box h5 {
    margin-bottom: .85rem;
    font-size: 17px;
    line-height: 1.3;
    text-align: left;
  }
  .why-box .row {
    --bs-gutter-y: .65rem;
  }
  .hero .why-box .why-item {
    gap: .55rem;
    font-size: 13.5px;
  }

  /* Secciones de portada: menos scroll vacío y jerarquía más legible. */
  .section,
  .red-section,
  .cta-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  #servicios.section.pt-0,
  #valores.section.pt-0 {
    padding-top: 0;
  }
  #nosotros .row.g-5,
  #servicios .row.g-4,
  #valores .row.g-4,
  #experiencia .row.g-4 {
    --bs-gutter-y: 1rem;
  }
  #nosotros h2.section-title,
  #servicios h2.section-title,
  #valores h2.section-title,
  #experiencia h2.section-title,
  #industrias h2.section-title {
    margin-bottom: .8rem;
    font-size: 28px;
    line-height: 1.16;
  }
  #servicios .text-center.mb-5,
  #valores .text-center.mb-5,
  #experiencia .text-center.mb-5 {
    margin-bottom: 1.75rem !important;
  }
  .section-lead {
    margin-top: .7rem;
    max-width: 560px;
  }

  .about-feature {
    gap: .8rem;
    margin-top: 1.1rem;
    align-items: flex-start;
  }
  .about-feature .icon-badge,
  .mission-card .icon-badge,
  .service-card .icon-badge,
  .value-card .icon-badge {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }
  .about-feature h6 {
    font-size: 16px;
    line-height: 1.35;
  }
  .about-feature p {
    font-size: 14px;
  }

  .mission-card {
    margin-top: .25rem;
    padding: 1.35rem;
    border-radius: .7rem;
  }
  .mission-card h5 {
    font-size: 20px;
    line-height: 1.3;
  }
  .mission-card p.mt-2 {
    font-size: 14px !important;
  }
  .mission-card .mission-years {
    font-size: 1.65rem;
  }

  .service-card,
  .value-card,
  .red-card {
    padding: 1.3rem;
    border-radius: .65rem;
  }
  .service-card h5 {
    font-size: 17px;
    line-height: 1.3;
  }
  .value-card h5,
  .red-card h5 {
    font-size: 20px;
    line-height: 1.25;
  }
  .red-card .icon-badge {
    width: 48px;
    height: 48px;
    font-size: 28px;
  }

  #industrias .mb-4 {
    margin-bottom: 1.25rem !important;
  }
  .industry-pill {
    gap: .35rem;
    margin: .2rem .1rem;
    padding: .45rem .75rem;
    font-size: 12.5px;
    line-height: 1.25;
  }

  .cta-section h2 {
    font-size: 27px;
    line-height: 1.2;
  }
  .cta-section p {
    margin-bottom: 1.3rem !important;
  }

  /* Contact Form 7 en móvil. */
  .contact-form .form-group {
    margin-bottom: 15px;
  }
  .contact-form label {
    margin-bottom: 6px;
    font-size: 14px;
  }
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form input[type="tel"],
  .contact-form select,
  .contact-form textarea {
    min-height: 48px;
    padding: 11px 13px;
    font-size: 16px; /* evita zoom automático en iOS */
  }
  .contact-form textarea {
    min-height: 125px;
  }
  .contact-form input[type="submit"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 18px;
  }
}

@media (max-width: 575.98px) {
  .hero {
    padding-top: 2.8rem;
  }
  .hero h1 {
    font-size: clamp(26px, 8.5vw, 31px);
  }
  .hero .btn-mg,
  .hero .btn-mg-outline {
    width: 100%;
  }
  .hero .hero-stats .stat-num {
    font-size: 23px;
  }
  .hero .hero-stats .stat-label {
    font-size: 10.5px;
  }
  #nosotros h2.section-title,
  #servicios h2.section-title,
  #valores h2.section-title,
  #experiencia h2.section-title,
  #industrias h2.section-title {
    font-size: 26px;
  }
  .industry-pill {
    max-width: 100%;
    white-space: normal;
  }
}

/* ==========================================================
   MAGISTRI — ANIMACIONES DE ENTRADA + TAMAÑO DE LOGO
   Solo CSS. No modifica PHP/JS ni el comportamiento del theme.
========================================================== */

/* Logo del header */
.site-header .brand-logo img,
.site-header .custom-logo-link img,
.site-header img.custom-logo {
  width: 230px;
  max-width: 230px;
  max-height: none;
  height: auto;
  object-fit: contain;
}

/* Animaciones base */
@keyframes mgFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes mgFadeInSlideLeft {
  0% {
    opacity: 0;
    transform: translate3d(-34px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes mgFadeInSlideTop {
  0% {
    opacity: 0;
    transform: translate3d(0, -28px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes mgFadeInSlideBottom {
  0% {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Entrada general del sitio */
.site-header {
  animation: mgFadeInSlideTop .7s cubic-bezier(.2,.7,.2,1) both;
}

.hero,
.inner-hero,
.page-hero {
  animation: mgFadeIn .85s ease-out both;
}

.hero .eyebrow,
.hero h1,
.inner-hero .eyebrow,
.inner-hero h1,
.page-hero h1 {
  animation: mgFadeInSlideTop .8s cubic-bezier(.2,.7,.2,1) both;
}

.hero h1,
.inner-hero h1,
.page-hero h1 {
  animation-delay: .08s;
}

.hero .hero-text,
.inner-hero .hero-text {
  animation: mgFadeInSlideBottom .8s cubic-bezier(.2,.7,.2,1) .16s both;
}

.hero .d-flex.justify-content-center,
.hero-stats,
.hero .why-box {
  animation: mgFadeInSlideBottom .85s cubic-bezier(.2,.7,.2,1) both;
}

.hero .d-flex.justify-content-center { animation-delay: .24s; }
.hero-stats { animation-delay: .32s; }
.hero .why-box { animation-delay: .40s; }

/* Títulos y textos principales */
.section-title,
.section-lead,
.section .eyebrow,
.red-section .eyebrow,
.cta-section h2,
.cta-section p {
  animation: mgFadeInSlideBottom .8s cubic-bezier(.2,.7,.2,1) both;
}

.section-lead,
.cta-section p {
  animation-delay: .08s;
}

/* Secciones alternadas para dar movimiento sin sobrecargar */
#nosotros .row > [class*="col-"]:first-child,
#experiencia .row > [class*="col-"]:first-child,
.template-content .row > [class*="col-"]:first-child {
  animation: mgFadeInSlideLeft .8s cubic-bezier(.2,.7,.2,1) both;
}

#nosotros .row > [class*="col-"]:last-child,
#experiencia .row > [class*="col-"]:last-child,
.template-content .row > [class*="col-"]:last-child {
  animation: mgFadeInSlideBottom .8s cubic-bezier(.2,.7,.2,1) .08s both;
}

/* Cards / bloques visuales */
.about-feature,
.mission-card,
.service-card,
.value-card,
.red-card,
.industry-pill,
.contact-form,
.wpcf7,
.site-footer .widget,
footer .widget {
  animation: mgFadeInSlideBottom .7s cubic-bezier(.2,.7,.2,1) both;
}

/* Stagger ligero para grids */
.service-card:nth-child(2n),
.value-card:nth-child(2n),
.red-card:nth-child(2n),
.industry-pill:nth-child(2n),
.about-feature:nth-child(2n) {
  animation-delay: .06s;
}

.service-card:nth-child(3n),
.value-card:nth-child(3n),
.red-card:nth-child(3n),
.industry-pill:nth-child(3n),
.about-feature:nth-child(3n) {
  animation-delay: .12s;
}

/* Imágenes y medios entran con fade suave */
main img:not(.custom-logo),
main video,
main iframe {
  animation: mgFadeIn .9s ease-out both;
}

/* Móvil */
@media (max-width: 767.98px) {
  .site-header .brand-logo img,
  .site-header .custom-logo-link img,
  .site-header img.custom-logo {
    width: 160px;
    max-width: 160px;
    max-height: none;
    height: auto;
  }

  /* Movimientos más cortos para que la navegación se sienta rápida */
  .site-header,
  .hero,
  .inner-hero,
  .page-hero,
  .hero .eyebrow,
  .hero h1,
  .hero .hero-text,
  .hero .d-flex.justify-content-center,
  .hero-stats,
  .hero .why-box,
  .section-title,
  .section-lead,
  .about-feature,
  .mission-card,
  .service-card,
  .value-card,
  .red-card,
  .industry-pill,
  .contact-form,
  .wpcf7 {
    animation-duration: .58s;
  }
}

/* Accesibilidad: respeta usuarios que desactivan animaciones */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================
   TABLET UX — 768px a 991px
   Más ancho útil en vertical y menos márgenes laterales.
   ========================================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Aprovecha prácticamente todo el ancho disponible en tablet. */
  .site-header .navbar > .container,
  .hero > .container,
  .section > .container,
  .red-section > .container,
  .cta-section > .container,
  .page-hero > .container,
  .inner-hero > .container,
  main > .container,
  .site-footer > .container,
  .site-footer .container {
    width: 100%;
    max-width: none;
    padding-left: 18px;
    padding-right: 18px;
  }

  /* Hero más inmersivo en orientación vertical. */
  .hero {
    min-height: auto;
    padding: 4.25rem 0 3.5rem;
  }
  .hero h1 {
    max-width: 900px;
    font-size: clamp(36px, 5.2vw, 48px);
  }
  .hero .hero-text {
    max-width: 820px;
  }

  /* Menos aire lateral/interior para que las tarjetas respiren mejor. */
  .mission-card,
  .service-card,
  .value-card,
  .red-card,
  .why-box,
  .process-body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Secciones algo más compactas en vertical. */
  .section,
  .red-section,
  .cta-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* Reduce gutters de Bootstrap solo dentro del contenido de portada. */
  .hero .row,
  #nosotros .row,
  #servicios .row,
  #valores .row,
  #experiencia .row,
  #industrias .row,
  .cta-section .row {
    --bs-gutter-x: 1.25rem;
  }

  /* El desplegable usa casi todo el ancho de la pantalla. */
  .site-header .navbar-collapse {
    left: 18px;
    right: 18px;
  }
}

/* Tablets en vertical: sensación full-screen sin márgenes de container. */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
  .hero > .container,
  .section > .container,
  .red-section > .container,
  .cta-section > .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero {
    width: 100%;
  }

  #nosotros h2.section-title,
  #servicios h2.section-title,
  #valores h2.section-title,
  #experiencia h2.section-title,
  #industrias h2.section-title {
    font-size: clamp(32px, 4.7vw, 40px);
  }
}


/* ==========================================================
   BOTONES FLOTANTES — TODO EL SITIO
   WhatsApp a la derecha / Volver arriba a la izquierda
   ========================================================== */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1050;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.whatsapp-float i {
  font-size: 34px;
  line-height: 1;
}

.whatsapp-float__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  color: #fff;
  background: #1ebe5d;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 34px rgba(0,0,0,.26);
}

.whatsapp-float:focus-visible {
  outline: 3px solid rgba(37,211,102,.35);
  outline-offset: 3px;
}

/* El botón volver arriba queda en el lado opuesto. */
.to-top {
  left: 24px;
  right: auto;
  bottom: 24px;
}

@media (max-width: 767.98px) {
  .whatsapp-float {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .whatsapp-float i {
    font-size: 31px;
  }

  .to-top {
    left: 16px;
    right: auto;
    bottom: 16px;
  }
}


/* ==========================================================
   FIX RESPONSIVE GLOBAL — evita desplazamiento horizontal
   y simplifica Servicios / detalles en móvil
   ========================================================== */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
body { position: relative; }
img, video, iframe, svg { max-width: 100%; }
.row { min-width: 0; }
.row > * { min-width: 0; }
.entry-content, .service-card, .mission-card, .red-card, .edge-card, .mv-card {
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 767.98px) {
  html, body { overflow-x: hidden; }
  .container, .container-fluid {
    max-width: 100%;
  }
  .inner-hero {
    padding: 3.6rem 0 3rem;
  }
  .inner-hero h1 {
    font-size: clamp(27px, 8vw, 32px);
    line-height: 1.14;
    overflow-wrap: anywhere;
  }
  .inner-hero .hero-text {
    font-size: 15px;
    line-height: 1.55;
  }

  /* Servicios y páginas internas: una columna real en teléfonos. */
  .post-type-archive-servicio .row > [class*="col-"],
  .single-servicio .row > [class*="col-"],
  .single-servicio .wp-block-columns,
  .single-servicio .wp-block-column {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  .single-servicio .wp-block-columns {
    display: block !important;
  }
  .single-servicio .wp-block-column + .wp-block-column {
    margin-top: 1.25rem;
  }
  .post-type-archive-servicio .service-card,
  .single-servicio .mission-card {
    padding: 1.25rem;
  }
  .post-type-archive-servicio .service-card h2,
  .single-servicio h2,
  .single-servicio h3,
  .single-servicio h4,
  .single-servicio h5 {
    line-height: 1.22;
  }
  .single-servicio .entry-content h2 { font-size: 24px; }
  .single-servicio .entry-content h3 { font-size: 21px; }
  .single-servicio .entry-content h4 { font-size: 18px; }
  .single-servicio .entry-content p,
  .single-servicio .entry-content li,
  .post-type-archive-servicio .service-card p {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
  .single-servicio aside {
    margin-top: .5rem;
  }
}
