/* =============================================
   OFICINAS MUNICIPALES
============================================= */
#oficinasMunicipalesTitle {
  overflow: hidden;
}

.mc-title-drop {
  display: inline-block;
  animation: mcDropBounce 1.3s cubic-bezier(0.28, 0.84, 0.42, 1) both;
}

.mc-title-drop--delay {
  animation-delay: 0.15s;
  margin-left: 0.25em;
}

@keyframes mcDropBounce {
  0%   { transform: translateY(-160%); opacity: 0; }
  45%  { transform: translateY(0);     opacity: 1; }
  60%  { transform: translateY(-16px); }
  75%  { transform: translateY(0); }
  87%  { transform: translateY(-7px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mc-title-drop {
    animation: none;
  }
}

/* =============================================
   MAPA A PANTALLA COMPLETA
============================================= */
.oficinas-fullmap {
  position: relative;
  width: 100%;
  height: calc(100vh - 4.5rem);
  overflow: hidden;
}

#oficinasMap {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--color-gray-100);
}

/* --- Overlay superior: breadcrumb + título --- */
.oficinas-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  background: #fafafa;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(3,62,140,0.14);
  animation: oficinasFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes oficinasFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.oficinas-overlay-top .breadcrumb {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  margin-bottom: 0 !important;
}

.oficinas-title {
  margin: 0 !important;
  text-align: center !important;
  font-size: var(--text-base) !important;
  line-height: 1 !important;
}

/* --- Sidebar flotante --- */
.oficinas-sidebar {
  position: absolute;
  z-index: 500;
  display: flex;
  flex-direction: column;
  left: var(--space-5);
  right: var(--space-5);
  bottom: var(--space-5);
  max-height: 40vh;
  padding: var(--space-4);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(3,62,140,0.18);
  overflow-y: auto;
  animation: oficinasFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@media (min-width: 768px) {
  .oficinas-sidebar {
    top: 90px;
    right: auto;
    bottom: var(--space-5);
    width: 300px;
    max-height: none;
  }
}

.oficinas-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-300, #d1d5db) transparent;
}

.oficinas-sidebar::-webkit-scrollbar {
  width: 5px;
}

.oficinas-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.oficinas-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-gray-300, #d1d5db);
  border-radius: var(--radius-full);
}

.oficinas-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

.oficinas-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.oficinas-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-bottom: 0;
}

.oficinas-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--color-gray-400);
  transition: background 0.2s ease, color 0.2s ease;
}

.oficinas-search-btn svg {
  width: 16px;
  height: 16px;
}

.oficinas-search-btn:hover,
.oficinas-search-btn--active {
  background: var(--color-gray-100);
  color: var(--color-primary);
}

.oficinas-search-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
  margin-bottom: 0;
}

.oficinas-search-wrap--open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: var(--space-3);
}

.oficinas-search-wrap > * {
  overflow: hidden;
  min-height: 0;
}

.oficinas-search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-white);
  font-family: inherit;
  font-size: 13px;
  color: var(--color-primary-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.oficinas-search-input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0,179,230,0.12);
}

.oficinas-no-results {
  font-size: 12px;
  color: var(--color-gray-400);
  text-align: center;
  padding: var(--space-3) 0;
}

.oficina-item--hidden {
  display: none !important;
}

.oficinas-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.oficina-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.oficina-item:hover {
  background: var(--color-white);
  border-color: var(--color-gray-200);
}

.oficina-item--active {
  background: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(3,62,140,0.1);
}

.oficina-item-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-gray-400);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.oficina-item--active .oficina-item-dot {
  background: linear-gradient(135deg, #ffb347 0%, var(--color-orange) 100%);
  box-shadow: 0 0 0 4px rgba(238,123,0,0.18);
}

.oficina-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.oficina-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary-dark);
  line-height: 1.3;
}

.oficina-item-sub {
  font-size: 12px;
  color: #444;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Controles de zoom: centrados en altura --- */
.oficinas-fullmap .leaflet-top.leaflet-right {
  top: 50%;
  transform: translateY(-50%);
}

.oficinas-fullmap .leaflet-control-zoom {
  border: none !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(3,62,140,0.18) !important;
}

.oficinas-fullmap .leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  background: #00b3e6 !important;
  color: var(--color-white) !important;
  font-weight: 700;
  font-size: 18px;
  border: none !important;
  transition: filter 0.2s ease;
}

.oficinas-fullmap .leaflet-control-zoom a:first-child {
  border-radius: 14px 14px 0 0 !important;
}

.oficinas-fullmap .leaflet-control-zoom a:last-child {
  border-radius: 0 0 14px 14px !important;
}

.oficinas-fullmap .leaflet-control-zoom a + a {
  border-top: 1px solid rgba(255,255,255,0.25) !important;
}

.oficinas-fullmap .leaflet-control-zoom a:hover {
  filter: brightness(1.1);
}

/* --- Pines personalizados (Leaflet) --- */
.oficina-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.oficina-pin-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb347 0%, var(--color-orange) 100%);
  border: 2px solid var(--color-white);
  box-shadow: 0 2px 8px rgba(238,123,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.oficina-pin:hover .oficina-pin-dot {
  transform: scale(1.15);
}

.oficina-pin--active .oficina-pin-dot {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ffb347 0%, var(--color-orange) 100%);
  box-shadow: 0 0 0 6px rgba(238,123,0,0.18), 0 2px 10px rgba(238,123,0,0.4);
}

/* Popups minimalistas */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(3,62,140,0.18);
}
.leaflet-popup-content {
  margin: 10px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: var(--color-gray-500);
}
.leaflet-popup-content strong {
  color: var(--color-primary-dark);
}
.leaflet-container a.leaflet-popup-close-button {
  color: var(--color-gray-400);
}
