/* ============================================================
   MOTORX — Services Page Styles
   css/services.css
   ============================================================ */

/* ─── PAGE LAYOUT ────────────────────────────────────────────── */
.services-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  position: absolute;
  top: var(--navbar-height, 64px);
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
}

/* ─── FILTER PANEL ───────────────────────────────────────────── */
.services-panel {
  background: var(--clr-bg-surface);
  border-inline-end: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.services-panel-header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
}

.services-panel-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--clr-text-primary);
  margin-bottom: var(--space-4);
}

.services-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.services-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}

/* Provider list cards */
.provider-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-card);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.provider-list-item:hover,
.provider-list-item.active {
  border-color: var(--clr-brand);
  background: var(--clr-brand-glow);
}

.provider-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--clr-brand-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.provider-info { flex: 1; min-width: 0; }

.provider-name {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--clr-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-type {
  font-size: var(--text-xs);
  color: var(--clr-brand);
  font-weight: var(--font-semibold);
  margin-top: 2px;
}

.provider-city {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.provider-rating {
  font-size: var(--text-xs);
  color: var(--clr-warning);
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

/* Become provider button */
.become-provider-btn {
  margin: var(--space-4) var(--space-5);
  flex-shrink: 0;
}

/* ─── MAP CONTAINER ──────────────────────────────────────────── */
.map-container {
  position: relative;
  flex: 1;
}

#services-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
  background: var(--clr-bg-card) !important;
  border: 1px solid var(--clr-border-strong) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--clr-text-primary) !important;
  font-family: var(--font-sans) !important;
  padding: 0 !important;
}

.leaflet-popup-tip { background: var(--clr-bg-card) !important; }

.map-popup {
  padding: var(--space-4);
  min-width: 200px;
}

.map-popup-name  { font-size: var(--text-base); font-weight: var(--font-bold); color: var(--clr-text-primary); margin-bottom: var(--space-2); }
.map-popup-type  { font-size: var(--text-xs); color: var(--clr-brand); font-weight: var(--font-semibold); margin-bottom: var(--space-2); }
.map-popup-city  { font-size: var(--text-xs); color: var(--clr-text-muted); margin-bottom: var(--space-3); }
.map-popup-actions { display: flex; gap: var(--space-2); }

/* Custom marker */
.custom-marker {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  background: var(--clr-brand);
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(33,150,243,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-marker-inner {
  transform: rotate(45deg);
  font-size: 16px;
}

/* ─── SERVICE DETAIL MODAL BODY ──────────────────────────────── */
.service-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.service-detail-item { display: flex; flex-direction: column; gap: var(--space-1); }
.service-detail-label { font-size: var(--text-xs); color: var(--clr-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.service-detail-value { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--clr-text-primary); }

.service-contact-buttons {
  display: flex;
  gap: var(--space-3);
}

.whatsapp-btn {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}
.whatsapp-btn:hover { background: #1da851; color: #fff; }

/* ─── PROVIDER REGISTRATION FORM ────────────────────────────── */
.provider-map-hint {
  padding: var(--space-3) var(--space-4);
  background: var(--clr-info-bg);
  border: 1px solid var(--clr-info);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--clr-info);
  margin-bottom: var(--space-5);
}

#provider-mini-map {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  margin-bottom: var(--space-5);
  z-index: 1;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .services-layout { grid-template-columns: 260px 1fr; }
}

@media (max-width: 768px) {
  .services-layout { grid-template-columns: 1fr; height: auto; }
  .services-panel {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-overlay);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  [dir="rtl"] .services-panel { transform: translateX(100%); }
  .services-panel.open { transform: translateX(0); }
  .map-container { height: calc(100vh - var(--navbar-height)); }
}

.services-map,
#services-map,
.map-container {
  height: 100%;
  position: relative;
  z-index: 1;
}

/* ─── LEAFLET MARKER ICON BORDER FIX ────────────────────────── */
/* The broad rule below was adding a white square to all markers.  */
/* We now ONLY apply the clean border to our specific custom pin,  */
/* and explicitly reset Leaflet's default icon wrapper.             */

/* Reset Leaflet's default icon elements — removes the white box */
.leaflet-marker-icon {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* The inner img inside default Leaflet icons (if any) */
.leaflet-marker-icon img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: block;
}

/* Our divIcon wrapper div — keep it transparent, no square */
.leaflet-div-icon {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* The inner icon element inside our custom marker */
.custom-marker-inner {
  transform: rotate(45deg);
  font-size: 16px;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  line-height: 1;
}
