/* ============================================================
   MODAL AÑADIR PARADA
   ------------------------------------------------------------
   Lógica igual que el modal que sí funciona:
   - dialog con alto fijo relativo al viewport
   - content en flex column
   - header fijo
   - footer fijo
   - body único contenedor con scroll interno
   ============================================================ */


/* ============================================================
   1. TOKENS
   ============================================================ */

:root{
  --cf-stop-bg: #151a1c;
  --cf-stop-bg-2: #1f252a;
  --cf-stop-bg-3: #0f1418;

  --cf-stop-border: rgba(255,255,255,0.10);
  --cf-stop-border-soft: rgba(255,255,255,0.08);

  --cf-stop-text: rgba(255,255,255,0.92);
  --cf-stop-text-soft: rgba(255,255,255,0.78);
  --cf-stop-text-muted: rgba(255,255,255,0.62);

  --cf-stop-neon: #00E7FF;
  --cf-stop-neon-soft: rgba(0,231,255,0.10);

  --cf-stop-radius-xl: 18px;
  --cf-stop-radius-lg: 16px;
  --cf-stop-radius-md: 12px;

  --cf-stop-shadow: 0 22px 55px rgba(0,0,0,.60);
}


/* ============================================================
   2. MODAL BASE
   ============================================================ */

.cf-modal--stop.modal{
  overflow: visible !important;
}

.cf-modal--stop.modal.show{
  backdrop-filter: blur(5px);
}

.cf-modal--stop .modal-dialog{
  margin-top: 4vh !important;
  max-width: min(1180px, calc(100vw - 32px)) !important;
  height: 90vh !important;
  max-height: 90vh !important;
}

.cf-stop-content{
  border-radius: var(--cf-stop-radius-xl) !important;
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background:
    radial-gradient(900px 180px at 15% 0%, rgba(0,231,255,.06), transparent 62%),
    rgba(12,16,20,.97) !important;
  box-shadow:
    var(--cf-stop-shadow),
    0 0 0 1px rgba(255,255,255,.03) inset !important;
}


/* ============================================================
   3. HEADER
   ============================================================ */

.cf-stop-modal-header{
  flex: 0 0 auto !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(255,255,255,.02) !important;
  padding: 10px 14px !important;
}

.cf-stop-modal-headerbar{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cf-stop-modal-header-toprow{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cf-stop-modal-header-left{
  min-width: 0;
  flex: 1 1 auto;
}

.cf-stop-modal-header-right{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cf-stop-modal-title{
  font-weight: 900;
  color: rgba(255,255,255,.95);
  letter-spacing: .2px;
  font-size: 14px;
  margin: 0;
}

.cf-stop-modal-title-wrap{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cf-stop-modal-title-icon{
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.cf-stop-close-btn{
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(255,255,255,.04) !important;
  color: rgba(255,255,255,.85) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.cf-stop-close-btn:hover{
  border-color: rgba(0,231,255,.26) !important;
  background: rgba(255,255,255,.06) !important;
  color: #fff !important;
}


/* ============================================================
   4. BODY CON SCROLL INTERNO
   ============================================================ */

.cf-stop-modal-body-shell.modal-body{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 12px !important;
  background: transparent !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,231,255,.30) rgba(255,255,255,.04);
}

.cf-stop-modal-body-shell.modal-body::-webkit-scrollbar{
  width: 10px;
}

.cf-stop-modal-body-shell.modal-body::-webkit-scrollbar-track{
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.cf-stop-modal-body-shell.modal-body::-webkit-scrollbar-thumb{
  background: rgba(0,231,255,.30);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.12);
}


/* ============================================================
   5. FOOTER FIJO
   ============================================================ */

/* ============================================================
   FOOTER · PROGRESO + ACCIONES
   ============================================================ */

.cf-stop-modal-footer{
  flex: 0 0 auto !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(255,255,255,.015) !important;
  padding: 10px 14px !important;
}

.cf-stop-modal-footerbar{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.cf-stop-footer-progress-wrap{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-stop-footer-progress-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.cf-stop-footer-progress-label{
  font-size: 12px;
  font-weight: 900;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
}

.cf-stop-footer-progress-text{
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,.60);
  white-space: nowrap;
}

.cf-stop-progress-bar.progress{
  height: 10px !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.25),
    0 2px 10px rgba(0,0,0,.18);
}

.cf-stop-progress-bar .progress-bar{
  background:
    linear-gradient(90deg, rgba(0,231,255,.95) 0%, rgba(6,190,132,.95) 100%) !important;
  box-shadow:
    0 0 12px rgba(0,231,255,.24),
    inset 0 1px 0 rgba(255,255,255,.20);
  border-radius: 999px !important;
  transition: width .25s ease;
}

.cf-stop-footer-actions{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ============================================================
   6. LAYOUT INTERNO
   ============================================================ */

.cf-stop-modal-layout{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cf-stop-block{
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cf-stop-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.cf-stop-col{
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cf-stop-row-top{
  display: grid;
  grid-template-columns: minmax(0,1fr) 250px;
  gap: 14px;
  align-items: stretch;
}

.cf-stop-col-days,
.cf-stop-col-hour{
  min-width: 0;
  min-height: 100%;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(31,37,42,1) 0%, rgba(21,26,28,1) 100%);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.cf-stop-geo-grid{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 14px;
  align-items: stretch;
}

.cf-stop-col-geo-form,
.cf-stop-col-map{
  min-height: 330px;
}


/* ============================================================
   7. TEXTOS
   ============================================================ */

.cf-stop-label{
  margin: 0;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,.94);
  letter-spacing: .2px;
}

.cf-stop-section-title{
  font-size: 15px;
  font-weight: 900;
  color: rgba(255,255,255,.95);
  margin-bottom: 4px;
}

.cf-stop-section-text{
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255,255,255,.68);
  margin-bottom: 10px;
}


/* ============================================================
   8. TARJETAS / BLOQUES
   ============================================================ */

.cf-stop-picker-card,
.cf-stop-geo-panel{
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(31,37,42,1) 0%, rgba(21,26,28,1) 100%);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}

.cf-stop-geo-panel{
  height: 100%;
}

.cf-stop-map-shell{
  height: 100%;
  min-height: 330px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}


/* ============================================================
   9. SEPARADOR
   ============================================================ */

.cf-stop-separator{
  display: flex;
  align-items: center;
  gap: 12px;
}

.cf-stop-separator-line{
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.14) 50%, transparent 100%);
}

.cf-stop-separator-text{
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.48);
  white-space: nowrap;
}


/* ============================================================
   10. INPUTS
   ============================================================ */

.cf-stop-text-input.form-control,
.cf-stop-time-input.form-control{
  width: 100%;
  background: linear-gradient(180deg, #1f252a 0%, #151a1c 100%) !important;
  color: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 9999px !important;
  height: 42px !important;
  padding: 0 14px !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.28) !important;
}

.cf-stop-text-input.form-control::placeholder,
.cf-stop-time-input.form-control::placeholder{
  color: rgba(255,255,255,.52) !important;
}

.cf-stop-text-input.form-control:focus,
.cf-stop-time-input.form-control:focus{
  border: 2px solid rgba(0,231,255,.92) !important;
  box-shadow:
    0 0 8px rgba(0,231,255,.30),
    0 0 16px rgba(0,231,255,.18),
    inset 0 0 6px rgba(0,231,255,.10) !important;
  outline: none !important;
}


/* ============================================================
   11. DROPDOWNS
   ============================================================ */

.cf-stop-dropdown .Select-control,
.cf-stop-dropdown .select__control{
  background: linear-gradient(180deg, #1f252a 0%, #151a1c 100%) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 9999px !important;
  min-height: 42px !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.28) !important;
}

.cf-stop-dropdown .Select-placeholder,
.cf-stop-dropdown .select__placeholder{
  color: rgba(255,255,255,.52) !important;
}

.cf-stop-dropdown .Select-value-label,
.cf-stop-dropdown .select__single-value{
  color: rgba(255,255,255,.92) !important;
}

.cf-stop-dropdown .is-focused:not(.is-open) > .Select-control,
.cf-stop-dropdown .select__control--is-focused{
  border: 2px solid rgba(0,231,255,.92) !important;
  box-shadow:
    0 0 8px rgba(0,231,255,.30),
    0 0 16px rgba(0,231,255,.18),
    inset 0 0 6px rgba(0,231,255,.10) !important;
}

.cf-stop-dropdown .Select-menu-outer,
.cf-stop-dropdown .select__menu{
  background: #121618 !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.42) !important;
  overflow: hidden !important;
  z-index: 9999 !important;
}

.cf-stop-dropdown .Select-option,
.cf-stop-dropdown .select__option{
  color: rgba(255,255,255,.92) !important;
  background: transparent !important;
}

.cf-stop-dropdown .Select-option.is-focused,
.cf-stop-dropdown .select__option--is-focused{
  background: rgba(0,231,255,.10) !important;
}

.cf-stop-dropdown .Select-option.is-selected,
.cf-stop-dropdown .select__option--is-selected{
  background: rgba(0,231,255,.16) !important;
}


/* ============================================================
   12. BOTONES
   ============================================================ */

.cf-stop-search-btn,
.cf-stop-confirm-btn{
  height: 42px !important;
  border-radius: 9999px !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.28) !important;
}

.cf-stop-search-btn{
  border: 1px solid rgba(255,255,255,.14) !important;
  background: linear-gradient(180deg, #2a3136 0%, #1b2226 100%) !important;
  color: #fff !important;
}

.cf-stop-confirm-btn{
  border: 1px solid rgba(0,231,255,.25) !important;
  background: linear-gradient(180deg, #0aa8b9 0%, #037a86 100%) !important;
  color: #fff !important;
}

.cf-stop-cancel-btn,
.cf-stop-save-btn{
  height: 38px !important;
  min-width: 132px;
  padding: 0 16px !important;
  border-radius: 9999px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.24) !important;
}

.cf-stop-save-btn{
  border: 1px solid rgba(0,231,255,.25) !important;
  background: linear-gradient(180deg, #0aa8b9 0%, #037a86 100%) !important;
  color: #fff !important;
}

.cf-stop-cancel-btn{
  border: 1px solid rgba(255,255,255,.14) !important;
  background: transparent !important;
  color: rgba(255,255,255,.88) !important;
}


/* ============================================================
   13. BOTONES DE DÍA
   ============================================================ */

#parada-dia-buttons,
.cf-stop-days-buttons{
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 2px 0 0 0;
}

.cf-stop-fecha-btn{
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(31,37,42,1) 0%, rgba(21,26,28,1) 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}

.cf-stop-fecha-btn__dow{
  font-size: 12px;
  line-height: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  opacity: .95;
}

.cf-stop-fecha-btn__dm{
  margin-top: 2px;
  font-size: 10px;
  line-height: 10px;
  font-weight: 800;
  opacity: .80;
}

.cf-stop-fecha-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(0,231,255,.45);
  box-shadow:
    0 10px 22px rgba(0,0,0,.40),
    0 0 10px rgba(0,231,255,.14),
    inset 0 0 10px rgba(0,231,255,.06);
}

.cf-stop-fecha-btn:active{
  transform: translateY(0) scale(.98);
}

.cf-stop-fecha-btn:focus,
.cf-stop-fecha-btn:focus-visible{
  outline: none !important;
}

.cf-stop-fecha-btn--active{
  border: 2px solid rgba(0,231,255,.95);
  background: linear-gradient(180deg, rgba(0,231,255,.20) 0%, rgba(0,231,255,.08) 100%);
  box-shadow:
    0 10px 24px rgba(0,0,0,.45),
    0 0 10px rgba(0,231,255,.30),
    0 0 18px rgba(0,231,255,.20),
    inset 0 0 12px rgba(0,231,255,.12);
}

.cf-stop-fecha-btn--active .cf-stop-fecha-btn__dow{
  opacity: 1;
}

.cf-stop-fecha-btn--active .cf-stop-fecha-btn__dm{
  opacity: .95;
}


/* ============================================================
   14. RESULTADO GEO
   ============================================================ */

.cf-stop-geo-slot{
  min-height: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  width: 100%;
}

.cf-stop-geo-result{
  height: 42px;
  width: 100%;
  border-radius: 9999px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0,231,255,.14) 0%, rgba(0,231,255,.06) 100%);
  border: 1px solid rgba(0,231,255,.36);
  box-shadow:
    0 6px 16px rgba(0,0,0,.28),
    0 0 10px rgba(0,231,255,.12),
    inset 0 0 8px rgba(0,231,255,.04);
}

.cf-stop-geo-row{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.cf-stop-geo-icon{
  flex: 0 0 auto;
}

.cf-stop-geo-text{
  color: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-stop-geo-link,
.cf-stop-geo-badge{
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(0,231,255,.12);
  border: 1px solid rgba(0,231,255,.30);
  color: rgba(0,231,255,.95);
}

.cf-stop-geo-hint{
  height: 42px;
  width: 100%;
  border-radius: 9999px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: rgba(255,255,255,.88);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-stop-geo-hint--warn{
  border: 1px solid rgba(255,193,7,.34);
  background: linear-gradient(180deg, rgba(255,193,7,.10) 0%, rgba(255,193,7,.04) 100%);
}


/* ============================================================
   15. RESPONSIVE
   ============================================================ */

@media (max-width: 980px){
  .cf-stop-row,
  .cf-stop-row-top,
  .cf-stop-geo-grid{
    grid-template-columns: 1fr;
  }

  .cf-stop-col-geo-form,
  .cf-stop-col-map,
  .cf-stop-map-shell{
    min-height: 280px;
  }
}

@media (max-width: 700px){
  .cf-modal--stop .modal-dialog{
    max-width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    margin-top: 8px !important;
  }

  .cf-stop-modal-header-toprow{
    flex-direction: column;
    align-items: stretch;
  }

  .cf-stop-modal-header-right{
    justify-content: flex-start;
  }

  .cf-stop-modal-footerbar{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cf-stop-footer-actions{
    width: 100%;
  }

  .cf-stop-footer-actions > *{
    flex: 1 1 0;
    min-width: 0;
  }

  #parada-dia-buttons,
  .cf-stop-days-buttons{
    flex-wrap: wrap;
  }

  .cf-stop-fecha-btn{
    flex: 0 0 calc(25% - 8px);
    min-width: 62px;
  }
}


@media (max-width: 700px){
  .cf-stop-modal-footerbar{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cf-stop-footer-actions{
    width: 100%;
  }

  .cf-stop-footer-actions > *{
    flex: 1 1 0;
    min-width: 0;
  }
}