* {
  box-sizing: border-box;
}

:root {
  --blue: #07579c;
  --blue-dark: #063b6d;
  --orange: #f28c28;
  --gray: #64748b;
  --light: #f5f8fc;
  --white: #ffffff;
  --shadow: 0 12px 35px rgba(15, 48, 82, .16);
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--light);
  color: #18324a;
}

.topbar {
  padding: 20px 28px;
  color: white;
  background: linear-gradient(135deg, #063b6d, #0877c1);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.brand {
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 15px;
  opacity: .9;
}

h1 {
  margin: 4px 0 3px;
  font-size: clamp(22px, 3vw, 34px);
}

.topbar p {
  margin: 0;
  opacity: .88;
}

.controls {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  background: white;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  position: relative;
  z-index: 1000;
}

.search-box {
  flex: 1;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  border: 1px solid #d6e0eb;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 15px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(7,87,156,.1);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  border: 1px solid #d4dfeb;
  background: white;
  color: #35516b;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.filter:hover,
.filter.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.map-wrapper {
  position: relative;
  height: calc(100vh - 190px);
  min-height: 550px;
}

#map {
  width: 100%;
  height: 100%;
}

.info-panel {
  position: absolute;
  z-index: 900;
  top: 18px;
  right: 18px;
  width: min(390px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  overflow-y: auto;
  background: white;
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
}

.info-panel.visible {
  display: block;
}

.close-panel {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: #456;
  font-size: 25px;
  cursor: pointer;
  z-index: 3;
}

.info-content {
  padding: 22px;
}

.type-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.type-hospital {
  color: #9d250e;
  background: #ffe3dc;
}

.type-centro {
  color: #096653;
  background: #d9f5ed;
}

.info-content h2 {
  margin: 0 40px 8px 0;
  color: #173d61;
  font-size: 23px;
}

.address {
  color: #66788a;
  line-height: 1.5;
  margin: 0 0 16px;
}

.convenio {
  padding: 13px;
  border-radius: 12px;
  background: #edf7ff;
  border-left: 4px solid var(--blue);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.photos-title {
  font-weight: 800;
  margin: 12px 0 9px;
}

.photo-placeholder {
  height: 150px;
  border-radius: 12px;
  background: linear-gradient(135deg,#eef3f8,#dce7f1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #718396;
  padding: 20px;
  margin-bottom: 15px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action {
  text-align: center;
  padding: 11px 8px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  border: 0;
  cursor: pointer;
}

.action.primary {
  color: white;
  background: var(--blue);
}

.action.secondary {
  color: var(--blue);
  background: #eaf4fc;
}

.legend {
  position: absolute;
  z-index: 800;
  left: 18px;
  bottom: 18px;
  background: rgba(255,255,255,.95);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.13);
  font-size: 13px;
  line-height: 2;
}

.legend-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: white;
  font-weight: 900;
  margin-right: 5px;
}

.hospital-marker { background: #d94a2f; }
.centro-marker { background: #159a7c; }

.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.custom-marker span {
  transform: rotate(45deg);
  color: white;
  font-size: 19px;
  font-weight: 900;
}

.custom-marker.hospital { background: #d94a2f; }
.custom-marker.centro { background: #159a7c; }

.leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.popup-title {
  font-weight: 800;
  color: #17466e;
  font-size: 15px;
}

.popup-type {
  font-size: 11px;
  color: #718096;
  margin-top: 3px;
}

.empty-state {
  text-align: center;
  padding: 45px 10px;
  color: #718096;
}

.empty-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.empty-state h2 {
  color: #294862;
  font-size: 19px;
}

footer {
  min-height: 42px;
  padding: 11px 20px;
  background: #fff;
  color: #718096;

  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
}

@media (max-width: 700px) {
  .topbar { padding: 16px; }
  .controls { padding: 11px; }
  .map-wrapper { height: calc(100vh - 250px); min-height: 500px; }
  .info-panel {
    top: auto;
    bottom: 12px;
    right: 12px;
    max-height: 62%;
  }
  .legend { left: 10px; bottom: 10px; }
  footer { font-size: 11px; }
}

















/* =========================================================
   RULETA DE FOTOGRAFÍAS
   ========================================================= */

.photo-roulette {
    width: 100%;
    height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px auto 0;
}

.photo-stage {
    width: 320px;
    height: 150px;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #edf6fa;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.roulette-photo {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: 0;
    transform: scale(0.94);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.roulette-photo.active {
    opacity: 1;
    transform: scale(1);
}

.photo-arrow {
    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    background: #e1f6ff;
    color: #0694cf;

    font-size: 25px;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow:
        0 4px 12px rgba(0,0,0,.15);

    transition:
        transform .2s ease,
        background .2s ease;
}

.photo-arrow:hover {
    background: #bcecff;
    transform: scale(1.1);
}

.photo-counter {
    text-align: center;
    font-size: 11px;
    color: #718396;
    margin: 2px 0 10px;
}

.photo-placeholder {
    height: 110px;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #eef9fd,
            #dceef6
        );

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    color: #718396;

    font-size: 13px;

    gap: 6px;
}

.photo-placeholder span {
    font-size: 27px;
}


/* =========================================================
   CEINCE GRANDE Y CELESTE
   ========================================================= */

.brand {
    color: #63d4ff !important;

    font-size: 30px !important;

    font-weight: 900;

    letter-spacing: 4px;

    text-shadow:
        0 0 6px rgba(99, 212, 255, .85),
        0 0 15px rgba(99, 212, 255, .55),
        0 0 28px rgba(99, 212, 255, .30);

    opacity: 1 !important;
}


/* =========================================================
   CEINCE MÁS DESTACADO EN EL ENCABEZADO
   ========================================================= */

.topbar .brand {
    display: inline-block;

    padding: 2px 0;

    transform: scale(1.08);

    transform-origin: left center;
}


/* =========================================================
   CELULAR
   ========================================================= */

@media (max-width: 700px) {

    .brand {
        font-size: 25px !important;
    }

    .photo-roulette {
        height: 125px;
    }

    .photo-stage {
        width: 185px;
        height: 110px;
    }

    .photo-arrow {
        width: 29px;
        height: 29px;

        flex-shrink: 0;

        font-size: 22px;
    }

}





/* =========================================================
   UBICACIÓN ESPECIAL DE CEINCE
   ========================================================= */

.ceince-marker {
    width: 90px;
    height: 100px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: flex-start;

    pointer-events: auto;
}


/* Marcador grande */

.ceince-pin {

    width: 58px;
    height: 58px;

    background: #08245c;

    border: 4px solid #ffffff;

    border-radius: 50% 50% 50% 0;

    transform: rotate(-45deg);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 0 0 5px rgba(85, 213, 255, .22),
        0 0 18px rgba(85, 213, 255, .85),
        0 7px 18px rgba(0, 80, 120, .35);

    animation: ceinceGlow 2s infinite;
}


/* Icono dentro del marcador */

.ceince-pin span {

    transform: rotate(45deg);

    color: white;

    font-size: 29px;

    font-weight: 900;

    text-shadow:
        0 1px 3px rgba(0,0,0,.25);
}


/* Texto CEINCE */

.ceince-label {

    margin-top: 6px;

    padding: 5px 12px;

    border-radius: 20px;

    background: #0d1346;

    color: white;

    font-size: 13px;

    font-weight: 900;

    letter-spacing: 1px;

    white-space: nowrap;

    border: 2px solid white;

    box-shadow:
        0 4px 12px rgba(0,0,0,.25);
}


/* Brillo suave */

@keyframes ceinceGlow {

    0% {

        box-shadow:
            0 0 0 5px rgba(85, 213, 255, .18),
            0 0 15px rgba(85, 213, 255, .65),
            0 7px 18px rgba(0, 80, 120, .30);

    }

    50% {

        box-shadow:
            0 0 0 8px rgba(85, 213, 255, .25),
            0 0 28px rgba(85, 213, 255, .95),
            0 7px 20px rgba(0, 80, 120, .35);

    }

    100% {

        box-shadow:
            0 0 0 5px rgba(85, 213, 255, .18),
            0 0 15px rgba(85, 213, 255, .65),
            0 7px 18px rgba(0, 80, 120, .30);

    }

}




/* =========================================================
   CEINCE - MARCADOR GRANDE CELESTE
   ========================================================= */

.ceince-marker {
    width: 90px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.ceince-pin {
    width: 60px;
    height: 60px;
    background: #1a215c;
    border: 4px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow:
        0 0 0 5px rgba(85,213,255,.20),
        0 0 25px rgba(85,213,255,.90),
        0 8px 20px rgba(0,80,120,.35);
}

.ceince-pin span {
    transform: rotate(45deg);
    color: white;
    font-size: 30px;
    font-weight: 900;
}

.ceince-label {
    margin-top: 7px;
    padding: 5px 13px;
    border-radius: 20px;
    background: #1a215c;
    color: white;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    white-space: nowrap;
    border: 2px solid white;

    box-shadow:
        0 4px 12px rgba(0,0,0,.25);
}


/* =========================================================
   TRANSPORTE
   ========================================================= */



.transport-title {
    color: #072a4b;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 5px;
}

.transport-subtitle {
    color: #667d8b;
    font-size: 12px;
    margin-bottom: 9px;
}

.bus-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bus-line {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    border-radius: 18px;

    background: white;

    color: #087ea9;

    font-size: 12px;
    font-weight: 800;

    box-shadow:
        0 2px 8px rgba(0,80,120,.10);
}

.no-lines {
    color: #788b95;
    font-size: 12px;
}