/* --- Accordion: заборона згортання --- */
.accordion-no-collapse .accordion-button {
  pointer-events: none;
  cursor: default;
}
.accordion-no-collapse .accordion-button::after {
  display: none !important;
}
.accordion-no-collapse .accordion-button.collapsed {
  pointer-events: none;
}
.accordion-no-collapse .accordion-collapse {
  display: block !important;
}

/* --- 1. Глобальні налаштування --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

body, .leaflet-container, .card, .popup-content {
  font-family: 'Nunito', sans-serif !important;
}

/* --- 2. Кнопки Selectize --- */
.selectize-input {
  max-height: 150px !important;
  overflow-y: auto !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
}
.selectize-dropdown {
  z-index: 10000 !important;
}

/* --- 3. Таблиця Reactable --- */
.services-table {
  font-size: 0.95rem;
  border: none;
}
.services-table .header {
  background-color: #f8f9fa;
  color: #495057;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ef6c00;
}
.services-table .rt-tr:hover {
  background-color: #fff3e0 !important;
  transition: background-color 0.2s;
}
mark {
  background-color: #ffe0b2;
  color: #e65100;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: bold;
}

/* --- 4. ПОШУК --- */
.rt-search {
  margin-bottom: 15px !important;
  position: relative;
}

.rt-search-input {
  border: 1px solid #cfd8dc !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  padding-right: 35px !important;
  width: 100% !important;
  font-size: 14px !important;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}
.rt-search-input:focus {
  border-color: #ef6c00 !important;
  box-shadow: 0 0 0 3px rgba(239, 108, 0, 0.1) !important;
  outline: none;
}

input[type='search']::-webkit-search-cancel-button:hover {
  background-color: #ef6c00;
}

/* --- 5. Картки --- */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 24px;
}
.card-header {
  background: linear-gradient(135deg, #ef6c00 0%, #ff9800 100%);
  color: white;
  border: none;
  padding: 18px 24px;
  font-weight: 700;
  font-size: 1.1rem;
}
.card-body {
  padding: 0 !important;
}

/* --- 6. Маркери кластерів --- */
.marker-cluster-custom {
  background-color: rgba(239, 108, 0, 0.6);
  border-radius: 50%;
}
.marker-cluster-custom div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  background-color: #ef6c00;
  font-family: 'Nunito', sans-serif;
  line-height: 30px;
  box-shadow: 0 0 0 4px rgba(239, 108, 0, 0.3);
}

/* --- 7. Контроли карти --- */
.leaflet-bar a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  background-color: white !important;
  color: #546e7a !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  border: none !important;
  margin-bottom: 8px !important;
  font-size: 16px !important;
  transition: all 0.2s ease;
}
.leaflet-bar a:hover {
  background-color: #fff3e0 !important;
  color: #ef6c00 !important;
  transform: translateY(-1px);
}

.leaflet-control-layers-toggle {
  background-image: none !important;
  width: 35px !important;
  height: 35px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px !important;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.leaflet-control-layers-toggle::before {
  content: '\f5fd';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 20px;
  color: #546e7a;
}
.leaflet-control-layers-toggle:hover::before {
  color: #ef6c00;
}

.leaflet-control-layers-expanded {
  padding: 15px !important;
  min-width: 180px;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
  border: none !important;
}
.leaflet-control-layers-list::before {
  display: block;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid #eee;
  font-weight: 800;
  color: #ef6c00;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}
.leaflet-control-layers-overlays::before {
  display: block;
  padding-top: 10px;
  margin-top: 5px;
  margin-bottom: 5px;
  border-top: 1px dashed #cfd8dc;
  font-weight: 800;
  color: #546e7a;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}
.leaflet-control-layers-separator {
  display: none !important;
}
.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

/* --- 8. Попапи Leaflet --- */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 0;
  overflow: hidden;
}
.leaflet-popup-content {
  margin: 16px;
  line-height: 1.6;
}
.popup-header {
  color: #ef6c00;
  font-weight: 800;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 8px;
  font-size: 1.2em;
}

/* --- 9. Модальне вікно --- */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999 !important;
  opacity: 0;
  animation: fadeInOverlay 0.3s forwards;
}
.popup-content {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.3);
  position: relative;
  width: 600px;
  max-width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f3f4;
  border: none;
  color: #5f6368;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.popup-close-btn:hover {
  background: #ef6c00;
  color: white;
  transform: rotate(90deg);
}

@keyframes fadeInOverlay {
  to { opacity: 1; }
}
@keyframes popIn {
  to { transform: scale(1); }
}

/* --- 10. Мобільна адаптація --- */
@media (max-width: 991px) {
  .map-accordion .accordion-body {
    padding: 0 !important;
  }
  .map-accordion .accordion-body .services-table {
    padding: 0 10px;
  }
}

@media (max-width: 600px) {
  .popup-content {
    width: 95% !important;
    max-height: 80vh;
    padding: 20px 16px;
  }
  .popup-close-btn {
    width: 40px;
    height: 40px;
    font-size: 24px;
    background: #fff3e0;
    color: #ef6c00;
  }
  .leaflet-bar a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 18px !important;
  }
  .rt-search-input {
    padding: 10px 14px !important;
    font-size: 16px !important;
  }
}
