.r-footer {
  background-color: #2b2b2b;
  color: #d9d9d9;
  padding-top: 48px;
}

/* ------------------------------------------------------------
   Columna nueva: Logo + redes sociales
------------------------------------------------------------ */
.r-footer .r-footer-brand {
  margin-bottom: 32px;
}

.r-footer .r-footer-brand__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 14px !important;
}

.r-footer .r-footer-brand__logo {
  max-width: 170px;
  height: auto;
}

.r-footer .r-footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.r-footer .r-footer-social li a {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.r-footer .r-footer-social li a img {
  width: 28px;
  height: 28px;
  display: block;
}

.r-footer .r-footer-social li a:hover {
  opacity: 0.75;
  transform: translateY(-2px);
}

.r-footer .r-footer-brand__supersalud {
  display: inline-block;
  margin-top: 4px;
}

.r-footer .r-footer-brand__supersalud img {
  max-width: 180px;
  height: auto;
  display: block;
}

/* ------------------------------------------------------------
   Columnas de contenido existentes (footer_1 a footer_4)
   Reutilizan el patrón ul.nav-bar / li / span,a.link-title
   que ya generan los bloques y menús de Drupal.
------------------------------------------------------------ */
.r-footer .r-footer-col {
  margin-bottom: 32px;
}

.r-footer .r-footer-col .nav-bar {
  list-style: none;
  margin: 0;
  padding: 0;
}

.r-footer .r-footer-col .nav-bar li {
  margin-bottom: 0px;
  font-size: 14px;
  line-height: 1.5;
  color: #d9d9d9;
}

.r-footer .r-footer-col .link-title {
  display: block;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
  text-decoration: none;
  pointer-events: none; /* el primer <a>/<span> del menú es el "título", no un link real */
}

.r-footer .r-footer-col a.nav-link {
  color: #d9d9d9;
  text-decoration: none;
  transition: color 0.2s ease;
}

.r-footer .r-footer-col a.nav-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.r-footer .r-footer-col .num-tel {
  display: block;
  font-weight: 700;
  color: #ffffff;
  font-size: 14px !important;
}

.r-footer .r-footer-col .num-tel__sm {
  font-weight: 700;
  color: #ffffff;
}

/* footer_1: el título real "San Vicente Fundación" es el primer link
   del menú (con clase .is-active); el resto de <li> son las sedes. */
.r-footer .r-footer-1 .nav-bar > li:first-child a.link-title {
  pointer-events: auto; /* este sí es un link real (a <front>) */
  color: #ffffff;
}

/* ------------------------------------------------------------
   Franja inferior: certificaciones + medios de pago
------------------------------------------------------------ */
.r-footer .r-footer-botttom {
  background-color: #1f1f1f;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.r-footer .r-footer-botttom .footer__certs {
  padding: 0;
}

.r-footer .r-footer-botttom .footer__certs img {
  max-height: 60px;
  width: auto;
}

.r-footer .r-footer-botttom .footer__info {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #a3a3a3;
}

.r-footer .r-footer-botttom .footer__info p {
  margin-bottom: 4px;
}

.r-footer .r-footer-botttom .footer__info .color-secondary {
  color: #d9d9d9;
}

.r-footer .r-footer-botttom .list-paymethods {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.r-footer .r-footer-botttom .list-paymethods img {
  max-height: 28px;
  width: auto;
  filter: brightness(0) invert(1); /* logos de pago en blanco para fondo oscuro */
  opacity: 0.85;
}

/* ------------------------------------------------------------
   Franja final: logo + copyright + botones flotantes
------------------------------------------------------------ */
.r-footer .r-footer-botttom--full {
  background-color: #1f1f1f;
  padding: 20px 0;
}

.r-footer .r-footer-botttom--full .footer__copyright {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* OPCIÓN A: se oculta esta copia del logo (queda la de la
   columna nueva arriba). No se borra del bloque en Drupal,
   solo se oculta visualmente. */
.r-footer .r-footer-botttom--full .footer__copyright-img {
  display: none;
}

.r-footer .r-footer-botttom--full .footer__copyright-info {
  font-size: 12px;
  color: #a3a3a3;
  margin: 0;
}

.r-footer .r-footer-botttom--full .footer__copyright-info a {
  color: #a3a3a3;
  text-decoration: underline;
}

.r-footer .r-footer-botttom--full .footer__copyright-info a:hover {
  color: #ffffff;
}

/* ------------------------------------------------------------
   Acordeón: reglas base (todos los tamaños)
   El botón lo inyecta js/footer-accordion.js. En desktop queda
   oculto y el markup original se ve igual que siempre.
------------------------------------------------------------ */
.r-footer .r-footer-acc__toggle {
  display: none;
}

.r-footer .r-footer-acc__panel[hidden] {
  display: none !important;
}

/* Título de un bloque fusionado dentro de otro panel.
   La fusión es permanente en el DOM, por eso se separa en todos
   los tamaños y no solo en móvil. */
.r-footer .r-footer-acc__subtitle {
  margin-top: 20px;
}
/* ------------------------------------------------------------
   Responsive: reordenamiento + acordeón
------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .r-footer {
    padding-top: 0;
    text-align: left;
  }

  /* Aplanado MÍNIMO: solo los contenedores de layout, nunca el .block
     ni su interior. Aplanar dentro del bloque rompe el markup y destapa
     las etiquetas .visually-hidden de Drupal. */
  .r-footer .r-footer__wrap,
  .r-footer .r-footer__grid,
  .r-footer .r-footer-col[data-footer-accordion],
  .r-footer .r-footer-col[data-footer-accordion] > .region {
    display: contents;
  }

  .r-footer .r-footer__row {
    display: flex;
    flex-direction: column;
  }

  /* --- ORDEN EN MÓVIL ---
     El JS pone [data-acc] en cada .block a partir del texto del título.
     El orden de estas reglas importa: la genérica va primero porque
     tiene la misma especificidad que las específicas.
     Verificar los slugs reales en la consola: "[footer-accordion] slugs:". */
  .r-footer .r-footer-acc                      { order: 20; } /* sin regla propia -> al final */
  .r-footer .r-footer-brand                    { order: 1; }
  .r-footer [data-acc="san-vicente-fundacion"] { order: 2; }
  .r-footer [data-acc="atencion-al-usuario"]   { order: 3; }
  .r-footer [data-acc="enlaces-directos"]      { order: 4; }
  .r-footer [data-acc="enlaces-de-interes"]    { order: 5; }

  /* --- Bloque de marca --- */
  .r-footer .r-footer-brand {
    margin-bottom: 0;
    padding: 36px 20px 26px;
  }

  .r-footer .r-footer-brand__inner {
    align-items: center;
    gap: 0;
    text-align: center;
  }

  .r-footer .r-footer-brand__logo {
    max-width: 210px;
    margin: 0 auto 28px;
  }

  .r-footer .r-footer-social {
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
  }

  .r-footer .r-footer-brand__supersalud {
    width: 100%;
    margin-top: 0;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }

  .r-footer .r-footer-brand__supersalud img {
    max-width: 180px;
    margin: 0 auto;
  }

  /* --- Ítems del acordeón (cada .block) --- */
  .r-footer .r-footer-acc {
    margin: 0;
    padding: 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }

  .r-footer .r-footer-acc:last-of-type {
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  }

  /* El título original se sustituye por el botón */
  .r-footer .r-footer-acc__source {
    display: none !important;
  }

  .r-footer .r-footer-acc__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 18px 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .r-footer .r-footer-acc__label {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
  }

  .r-footer .r-footer-acc__icon {
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
  }

  .r-footer .r-footer-acc__icon::before,
  .r-footer .r-footer-acc__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
  }

  .r-footer .r-footer-acc__icon::before {
    width: 16px;
    height: 2px;
  }

  .r-footer .r-footer-acc__icon::after {
    width: 2px;
    height: 16px;
  }

  /* Abierto: se oculta la barra vertical -> queda "−" */
  .r-footer .r-footer-acc__toggle[aria-expanded="true"] .r-footer-acc__icon::after {
    opacity: 0;
  }

  .r-footer .r-footer-acc__panel {
    padding: 0 0 18px;
  }

  .r-footer .r-footer-acc__panel li {
    margin-bottom: 6px;
  }

  .r-footer .r-footer-acc__subtitle {
    margin-top: 18px;
  }

  /* --- Franja inferior --- */
  .r-footer .r-footer-botttom .footer__certs-col {
    text-align: center;
    margin-bottom: 16px;
  }

  .r-footer .r-footer-botttom--full {
    padding: 26px 20px;
  }

  /* Copyright ampliado en móvil. El selector cubre tanto el párrafo
     como el <span> interno, por si algún estilo del tema lo pisa. */
  .r-footer .r-footer-botttom--full .footer__copyright-info,
  .r-footer .r-footer-botttom--full .footer__copyright span {
    font-size: 20px;
    line-height: 30px;
    color: #d9d9d9;
  }

  .r-footer .r-footer-botttom--full .footer__copyright-info a {
    color: #d9d9d9;
  }
}
body {
  overflow-x: hidden;
}

/* ============================================================
   Logo del footer por portal
   Se imprimen los tres logos y aquí se decide cuál se ve, según
   la clase portal-* que svf_theme agrega al <body>.
   ============================================================ */
.r-footer .r-footer-brand__logo {
  display: none;
}

/* Home corporativo: sin clase de portal */
.r-footer .r-footer-brand__logo--corporativo {
  display: block;
}

body.portal-medellin .r-footer .r-footer-brand__logo--corporativo,
body.portal-rionegro .r-footer .r-footer-brand__logo--corporativo {
  display: none;
}

body.portal-medellin .r-footer .r-footer-brand__logo--medellin,
body.portal-rionegro .r-footer .r-footer-brand__logo--rionegro {
  display: block;
}

/* Los logos de hospital son apaisados (384x71 / 389x71) frente al
   corporativo (170x68): con 170px de ancho quedarían de ~31px de alto. */
.r-footer .r-footer-brand__logo--medellin,
.r-footer .r-footer-brand__logo--rionegro {
  max-width: 180px;
  height: auto;
}

@media (max-width: 1200px) {
    .r-footer .r-footer-brand__supersalud img {
      max-width: 140px;
      height: auto;
      display: block;
    }
    .r-footer .r-footer-social li a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: 20px;
    }
    .r-footer .r-footer-brand__logo--medellin, .r-footer .r-footer-brand__logo--rionegro {
    max-width: 140px;
    height: auto;
    }
}