/* ============================================================
   Nova Post Pickup Map – v4.0
   ============================================================ */

/* ── Wrapper – pełna szerokość kontenera ── */
.novapost-map-wrapper {
  /* Wypełniamy cały kontener WC niezależnie od jego paddingu */
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  margin-top: 10px;
  background: #f8f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  clear: both;
}

/* ── Header ── */
.np-map-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.np-map-icon  { font-size: 20px; line-height: 1; }
.np-map-title { font-weight: 700; font-size: 15px; color: #1a202c; }

/* ── Search bar ── */
.np-search-bar {
  position: relative;
  margin-bottom: 10px;
  z-index: 1000;
}
.np-search-bar input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 36px 9px 12px;
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.np-search-bar input[type="text"]:focus {
  outline: none;
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
.np-search-icon {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px; pointer-events: none;
}

/* ── Search dropdown ── */
.np-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: #fff;
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 10000;
  overflow: hidden;
}
.np-sr-item {
  padding: 9px 14px; cursor: pointer;
  display: flex; align-items: baseline; gap: 8px;
  transition: background .1s;
}
.np-sr-item:hover { background: #f0f4ff; }
.np-sr-city   { font-weight: 600; font-size: 14px; color: #1a202c; }
.np-sr-region { font-size: 12px; color: #718096; }
.np-sr-empty  { padding: 10px 14px; color: #718096; font-size: 13px; text-align: center; }

/* ── Zoom hint ── */
.np-zoom-hint {
  margin-bottom: 8px; padding: 8px 12px;
  background: #fffbeb; border: 1px solid #f6d860;
  border-radius: 6px; font-size: 13px;
  color: #92620a; text-align: center;
}

/* ── Map container: fill full wrapper width ── */
.np-leaflet-map {
  width: 100%;
  height: 440px;
  border-radius: 6px;
  border: 1px solid #d0d6e0;
  overflow: hidden;
  z-index: 0;
  display: block;
}

/* Leaflet internal z-index fix */
.novapost-map-wrapper .leaflet-pane { z-index: 4; }
.novapost-map-wrapper .leaflet-top,
.novapost-map-wrapper .leaflet-bottom { z-index: 5; }

/* ── Custom marker ── */
.np-marker {
  width: 28px; height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .15s;
}
.np-marker:hover { transform: rotate(-45deg) scale(1.15); }
.np-marker svg   { transform: rotate(45deg); }

/* ── Cluster ── */
.np-cluster {
  background: #c0392b; color: #fff;
  border-radius: 50%; text-align: center;
  font-weight: 700; font-size: 13px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* ── Popup ── */
.np-popup             { font-size: 13px; line-height: 1.5; max-width: 270px; }
.np-popup-name        { font-weight: 700; font-size: 14px; color: #1a202c; margin-bottom: 4px; }
.np-popup-type        { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #c0392b; margin-bottom: 4px; font-weight: 600; }
.np-popup-addr        { color: #4a5568; margin-bottom: 3px; }
.np-popup-addr--small { font-size: 12px; color: #718096; }
.np-popup-hours       { color: #4a5568; margin-bottom: 3px; }
.np-popup-select-btn {
  display: block; width: 100%; margin-top: 10px; padding: 7px 12px;
  background: #c0392b; color: #fff; border: none; border-radius: 5px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.np-popup-select-btn:hover { background: #96281b; }

/* ── Selected panel ── */
.np-selected-panel {
  margin-top: 12px; padding: 12px 14px;
  background: #fff; border: 2px solid #c0392b;
  border-radius: 7px; animation: npSlideIn .25s ease;
}
.np-selected-panel.np-hidden { display: none; }
@keyframes npSlideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.np-selected-label   { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #718096; margin-bottom: 4px; font-weight: 600; }
.np-selected-name    { font-weight: 700; font-size: 14px; color: #1a202c; }
.np-selected-address { color: #4a5568; font-size: 13px; margin-bottom: 10px; }
.np-confirm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; background: #c0392b; color: #fff;
  border: none; border-radius: 5px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .15s;
}
.np-confirm-btn:hover      { background: #96281b; transform: translateY(-1px); }
.np-confirm-btn.np-confirmed { background: #27ae60; cursor: default; }

/* ── Status ── */
.np-status          { margin-top: 8px; font-size: 12px; text-align: center; color: #718096; }
.np-status--error   { color: #c53030; }
.np-status--loading { color: #2b6cb0; }
.np-status--ok      { color: #276749; }
.np-status--hint    { color: #92620a; }

/* ── MarkerCluster animation ── */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
  transition: transform .3s ease-out, opacity .3s ease-in;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .np-leaflet-map { height: 300px; }
  .novapost-map-wrapper { padding: 10px; }
}
