.view-vista-esquema-relacionamiento .swiper-container {
  padding: 32px 32px 64px;
  position: relative;
  box-sizing: border-box;
}

/* Marco decorativo que encierra las tres tarjetas visibles */
.view-vista-esquema-relacionamiento .swiper-container::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 2px solid #C6C6C6;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.swiper-container .grid__item {
  display: none;
}

.view-vista-esquema-relacionamiento .swiper-slide {
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0.001;
  transition: opacity .4s ease, transform .3s ease;
}

.view-vista-esquema-relacionamiento .swiper-slide.swiper-slide-active,
.view-vista-esquema-relacionamiento .swiper-slide.swiper-slide-next,
.view-vista-esquema-relacionamiento .swiper-slide.swiper-slide-prev {
  opacity: 1;
}

.view-vista-esquema-relacionamiento .swiper-slide.swiper-slide-active .esquema-relacionamiento-card {
  transform: translateY(-6px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

.esquema-relacionamiento-card {
    background: #F7F0FF;
    border: 2px solid #BABEC3;
    border-radius: 14px;
    width: 100%;
    max-width: 230px;
    padding: 8px 10px 10px;
    min-height: 315px;
    max-height: 314px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    transition: box-shadow .3s ease, transform .3s ease, opacity .4s;
}

.esquema-relacionamiento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
  border-color: #440099;
}

.esquema-relacionamiento-card .erc-image {
  width: 100%;
  display: flex;
  justify-content: center;
}

.esquema-relacionamiento-card .erc-image img {
  max-width: 178px;
  max-height: 225px;
  min-height: 225px;
  min-width: 178px;
  border-radius: 12px;
  /* border: 2px solid #6a26c7; */
  /* box-shadow: 0 6px 16px rgba(0,0,0,0.15); */
  /* background: #fff; */
  /* padding: 4px; */
}

.esquema-relacionamiento-card .erc-name a {
  display: block;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  color: #333333;
  text-decoration: none;
  transition: color .25s ease;
  padding: 0 8px;
}

.esquema-relacionamiento-card .erc-name a:hover {
  color: #6a26c7;
}

/* Acción */
.esquema-relacionamiento-card .erc-action {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: center;
}

.esquema-relacionamiento-card .erc-button {
  background: #440099;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 22px;
  padding: 10px 26px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  transition: background .25s ease, transform .25s ease;
}

.esquema-relacionamiento-card .erc-button:hover {
  background: #4a148c;
  transform: translateY(-2px);
}

.esquema-relacionamiento-card .erc-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/*Diseño del titulo*/
.viewsreference--view-title {
    font-size: 1.5rem;
    font-weight: bold;
    padding-left: 10px;
    color: #4a148c;
}

/* Navegación */
.view-vista-esquema-relacionamiento .swiper-button-next,
.view-vista-esquema-relacionamiento .swiper-button-prev {
  color: #6a26c7;
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  --swiper-navigation-size: 22px;
}

.view-vista-esquema-relacionamiento .swiper-button-next:hover,
.view-vista-esquema-relacionamiento .swiper-button-prev:hover {
  background: #6a26c7;
  color: #fff;
}

/* Paginación */
.view-vista-esquema-relacionamiento .swiper-pagination-bullet {
  background: #c8a9f3;
  opacity: 1;
}

.view-vista-esquema-relacionamiento .swiper-pagination-bullet-active {
  background: #6a26c7;
}

@media (max-width: 640px) {
  .esquema-relacionamiento-card {
    max-width: 280px;
    padding: 26px 18px 28px;
    min-height: 260px;
  }
  .esquema-relacionamiento-card .erc-image img {
    max-width: 240px;
    padding: 6px;
  }
  .view-vista-esquema-relacionamiento .swiper-container::before {
    width: calc(100% - 40px);
    height: 290px;
  }
}

/* @media (min-width: 1400px) {
  .esquema-relacionamiento-card {
    max-width: 300px;
  }
} */

/* ================= Modal Esquema Relacionamiento ================= */
#esquema-relacionamiento-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}

#esquema-relacionamiento-modal.erm-open { display: block; }

.erm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  animation: ermFade .3s ease;
}

@keyframes ermFade { from { opacity: 0; } to { opacity: 1; } }

.erm-dialog {
  max-width: 430px;
  max-height: 600px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 40px -10px rgba(0,0,0,0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  animation: ermPop .35s ease;
  position: relative;
}

@keyframes ermPop { from { transform: translateY(20px); opacity:0;} to { transform: translateY(0); opacity:1;} }

.erm-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: #fff;
  color: #4a148c;
  font-size: 22px;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease, transform .25s ease;
}

.erm-close-btn:hover { background: #6a26c7; color: #fff; transform: rotate(90deg); }

.erm-header {
  background-image: url('/sites/default/files/2025-10/fondo_header_popup.png');
  display: flex;
  gap: 24px;
  padding: 30px 34px 24px;
  align-items: center;
  position: relative;
  min-height: 280px;
  min-width: 430px;
  max-width: 430px;
  max-height: 280px;
}

.erm-photo {
  position: relative;
  right: 36px;
  bottom: -3px;
}

.erm-photo img {
    min-width: 250px;
    min-height: 263px;
    max-width: 250px;
    max-height: 263px;
    padding: 20px;
}

.erm-name {
  margin: 0;
  position: relative;
  right: 90px;
  width: 180px;
  bottom: 26px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.erm-body {
  padding: 28px 34px 32px;
  max-height: 520px;
  height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.erm-body::-webkit-scrollbar { width: 8px; }
.erm-body::-webkit-scrollbar-track { background: #f1e9ff; border-radius: 4px; }
.erm-body::-webkit-scrollbar-thumb { background: #9d6df5; border-radius: 4px; }
.erm-body::-webkit-scrollbar-thumb:hover { background: #6a26c7; }

.erc-service-block { margin-bottom: 22px; font-size: 15px; line-height: 1.45; color: #3d2b5c; }
.erc-service-block:last-child { margin-bottom: 0; }
.erc-service-block h4, .erc-service-block strong { color: #6a26c7; }

.erm-no-services { font-style: italic; color: #7040b8; }

@media (max-width: 720px) {
  .erm-dialog { max-width: 92%; }
  .erm-header { flex-direction: column; align-items: flex-start; padding: 26px 26px 18px; }
  .erm-photo img { width: 140px; }
  .erm-body { padding: 22px 26px 26px; max-height: 360px; }
}