/* ===========================
   Pekare Mapa - Clean CSS
   =========================== */

/* Layout */
.pm-wrap{
  display:grid !important;
  grid-template-columns: 1.2fr 1fr !important;
  gap:16px !important;
  align-items:start;
}

.pm-card{
  width:100%;
  border:1px solid #e8e8e8;
  border-radius:16px;
  background:#fff;
  overflow:hidden;
}

.pm-map{ height:75vh; }

.pm-side{
  padding:16px;
  max-height:75vh;
  overflow:auto;
}

.pm-title{
  margin:0 0 10px 0;
  font-size:28px;
  line-height:1.1;
}

.pm-filter{
  margin:0 0 12px 0;
  font-size:14px;
  opacity:.85;
}

@media (max-width: 900px){
  .pm-wrap{ grid-template-columns:1fr !important; }
  .pm-map{ height:60vh; }
}

/* Map overlays */
.pm-map-wrap{ position:relative; }

.pm-overlay{
  position:absolute;
  z-index:500;
  display:flex;
  gap:10px;
  pointer-events:none;
}

.pm-overlay-left{ top:12px; left:50px; }
.pm-overlay-right{
  top:12px;
  right:12px;
  flex-direction:column;
  align-items:flex-end;
}

.pm-legend{
  pointer-events:auto;
  background:rgba(255,255,255,.92);
  border:1px solid #e8e8e8;
  border-radius:14px;
  padding:10px 12px;
  box-shadow:0 10px 24px rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
  min-width:160px;
}

.pm-legend-title{
  font-weight:700;
  margin-bottom:8px;
  font-size:14px;
}

.pm-legend-row{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  padding:3px 0;
}

.pm-swatch{
  width:14px;
  height:14px;
  border-radius:4px;
  border:1px solid rgba(0,0,0,.15);
  display:inline-block;
}

.pm-swatch-vojvodina{ background:#5DADE2; }
.pm-swatch-beograd{ background:#F5B041; }
.pm-swatch-centralna{ background:#58D68D; }
.pm-swatch-jugistok{ background:#AF7AC5; }
.pm-swatch-kosovo{ background:#16A085; }

.pm-btn-overlay{
  pointer-events:auto;
  margin-top:0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #e8e8e8;
  background:rgba(255,255,255,.92);
  box-shadow:0 10px 24px rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
  cursor:pointer;
}

/* Fullscreen */
.pm-fullscreen{
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  border-radius:0 !important;
}
.pm-fullscreen .pm-map{ height:100vh !important; }

@media (max-width: 900px){
  .pm-overlay-left{ top:85px; left:10px; }
  .pm-overlay-right{ top:10px; right:10px; }
  .pm-legend{ min-width:150px; }
}

/* Toolbar */
.pm-toolbar{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:12px;
}

.pm-search input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid #e8e8e8;
  outline:none;
}

.pm-search input:focus{
  border-color:#cfcfcf;
  box-shadow:0 0 0 3px rgba(0,0,0,.04);
}

.pm-meta{
  font-size:13px;
  opacity:.8;
}

/* Badge */
.pm-badge{
  display:inline-flex;
  align-items:center;
  gap:10px;
  width:fit-content;
  max-width:100%;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(0,0,0,.05);
  border:1px solid rgba(0,0,0,.08);
  font-size:13px;
}

.pm-badge-x{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  padding:0 2px;
  opacity:.7;
}
.pm-badge-x:hover{ opacity:1; }

/* List */
.pm-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Base button (used for reset etc.) */
.pm-btn{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ddd;
  background:#fff;
  cursor:pointer;
}

/* Cards */
.pm-item-card{
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:12px;
  background:#fff;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.pm-item-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.pm-item a{ text-decoration:none; }

.pm-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
}

.pm-thumb{
  width:70px;
  height:70px;
  border-radius:12px;
  object-fit:cover;
  flex:0 0 70px;
  border:1px solid rgba(0,0,0,.08);
}

.pm-thumb-ph{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  background:rgba(0,0,0,.04);
}

.pm-body{ flex:1; min-width:0; }

.pm-title-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}

.pm-name{
  font-weight:700;
  line-height:1.2;
}

.pm-open{
  font-size:13px;
  opacity:.75;
  text-decoration:none;
  white-space:nowrap;
}
.pm-open:hover{ opacity:1; }

.pm-desc{
  margin-top:6px;
  font-size:13px;
  opacity:.85;
}

.pm-meta-row{
  margin-top:6px;
  font-size:13px;
  opacity:.9;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.pm-link{
  text-decoration:none;
  border-bottom:1px dashed rgba(0,0,0,.25);
}
.pm-link:hover{ border-bottom-color: rgba(0,0,0,.5); }

.pm-dot{ opacity:.5; }

.pm-hours{
  margin-top:8px;
  font-size:13px;
  opacity:.9;
  padding:6px 8px;
  border-radius:10px;
  background:rgba(0,0,0,.04);
  width:fit-content;
}

/* Chips (open status) */
.pm-chip{
  display:inline-flex;
  gap:8px;
  align-items:center;
  margin:8px 0 6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid rgba(0,0,0,.12);
  background:rgba(255,255,255,.85);
}
.pm-chip-main{ font-weight:600; }
.pm-chip-sub{ opacity:.8; }

.pm-chip-open{ border-color: rgba(0, 150, 0, .25); }
.pm-chip-closed{ border-color: rgba(180, 0, 0, .25); }
.pm-chip-unknown{ border-color: rgba(0, 0, 0, .12); }

.pm-distance{
  font-size:12px;
  opacity:.85;
  margin-bottom:6px;
}

.pm-card-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
  flex-wrap:wrap;
}

/* Geo msg */
.pm-geo-msg{
  margin-top:8px;
  font-size:13px;
  opacity:.85;
}

/* Leaflet popup */
.pm-popup{
  min-width:240px;
  max-width:320px;
}

.pm-popup-top{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.pm-popup-thumb{
  width:56px;
  height:56px;
  border-radius:12px;
  object-fit:cover;
  border:1px solid rgba(0,0,0,.10);
  flex:0 0 56px;
  background:rgba(0,0,0,.04);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
}

.pm-popup-title{
  font-weight:800;
  line-height:1.15;
  margin:0;
  font-size:14px;
}

.pm-popup-meta{
  margin-top:6px;
  font-size:13px;
  opacity:.9;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.pm-popup-meta a{
  text-decoration:none;
  border-bottom:1px dashed rgba(0,0,0,.25);
}
.pm-popup-meta a:hover{ border-bottom-color: rgba(0,0,0,.55); }

.pm-popup-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}

.pm-popup-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  font-size:13px;
  cursor:pointer;
  text-decoration:none;
}

.pm-popup-btn:hover{
  box-shadow:0 8px 18px rgba(0,0,0,.10);
}

.pm-popup-hours{
  margin-top:10px;
  font-size:13px;
  background:rgba(0,0,0,.04);
  border-radius:12px;
  padding:8px 10px;
}

.pm-popup-hours-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:2px 0;
}
.pm-popup-hours-row b{ font-weight:700; }

.leaflet-popup-content{ margin:12px 12px; }
.leaflet-popup-content-wrapper{ border-radius:16px; }

/* ===========================
   PREMIUM CONTROLS (Najbliže / Ukloni / Toggle)
   This part fixes your issue:
   - pm-btn has margin-top:12px globally
   - we must override margin and force identical height
   =========================== */

.pm-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-top:10px;
}

.pm-actions .pm-btn,
.pm-actions .pm-check{
  height:38px !important;
  min-height:38px !important;
  border-radius:999px !important;
  box-sizing:border-box !important;
  align-items:center !important;
  justify-content:center !important;
}

/* dugmad u toolbaru su flex, ali BEZ !important da JS može da sakrije */
.pm-actions .pm-btn{
  display:inline-flex;
}

/* toggle (label) je flex */
.pm-actions .pm-check{
  display:inline-flex !important;
}

/* "Ukloni lokaciju" mora da bude sakriven na load */
#pekareClearNearMe{
  display:none;
}


/* Kill the global margin-top on buttons inside toolbar */
.pm-actions .pm-btn{
  margin-top:0 !important;
}

/* Button sizing (pill) */
.pm-actions .pm-btn{
  padding:0 14px !important;
  font-size:13px !important;
  line-height:1 !important;
}

/* Ghost (Ukloni lokaciju) */
.pm-actions .pm-btn.pm-btn-ghost{
  background:transparent !important;
  border:1px solid rgba(0,0,0,.15) !important;
}

/* Toggle pill (label) */
.pm-check{
  gap:10px;
  padding:0 14px !important;
  border:1px solid rgba(0,0,0,.12) !important;
  background:rgba(255,255,255,.9) !important;
  font-size:13px !important;
  line-height:1 !important;
  user-select:none;
  cursor:pointer;
}

/* Hide browser checkbox + build switch */
.pm-check > input{
  appearance:none;
  -webkit-appearance:none;
  width:36px !important;
  height:20px !important;
  border-radius:999px !important;
  position:relative;
  border:1px solid rgba(0,0,0,.18) !important;
  background:rgba(0,0,0,.06) !important;
  outline:none;
  margin:0 !important;
  flex:0 0 auto;
}

.pm-check > input::after{
  content:"";
  position:absolute;
  top:50%;
  left:2px;
  width:16px;
  height:16px;
  border-radius:999px;
  transform:translateY(-50%);
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.2);
  transition:transform .18s ease;
}

/* Checked */
.pm-check > input:checked{
  border-color: rgba(0,0,0,.10) !important;
  background: rgba(22,160,133,.22) !important;
}

.pm-check > input:checked::after{
  transform:translate(16px, -50%);
}

.pm-check:hover{
  border-color: rgba(0,0,0,.18) !important;
}

.pm-check > input:focus-visible{
  box-shadow:0 0 0 3px rgba(22,160,133,.18);
}

.pm-check > span{
  white-space:nowrap;
  opacity:.92;
  display:inline-flex;
  align-items:center;
  height:100%;
  line-height:1;
}


/* Allow JS/inline to control visibility of "Ukloni lokaciju" */
#pekareClearNearMe{
  display: none !important; /* start hidden */
}

/* When JS sets it to show (inline style), allow it */
#pekareClearNearMe[style*="display: inline-flex"],
#pekareClearNearMe[style*="display:inline-flex"]{
  display: inline-flex !important;
}


/* ===========================
   Marker highlight (bounce + glow)
   =========================== */

.leaflet-marker-icon.pm-marker-pulse{
  transform-origin: bottom center;
  animation:
    pmMarkerBounce .45s ease-in-out 0s 2,
    pmMarkerGlow 1.7s ease-out 0s 1;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.25));
}

@keyframes pmMarkerBounce{
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-10px) scale(1.02); }
  60%  { transform: translateY(0) scale(1); }
  85%  { transform: translateY(-5px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes pmMarkerGlow{
  0%   { filter: drop-shadow(0 0 0 rgba(22,160,133,0)) drop-shadow(0 10px 18px rgba(0,0,0,.15)); }
  30%  { filter: drop-shadow(0 0 18px rgba(22,160,133,.55)) drop-shadow(0 10px 18px rgba(0,0,0,.20)); }
  100% { filter: drop-shadow(0 0 0 rgba(22,160,133,0)) drop-shadow(0 10px 18px rgba(0,0,0,.25)); }
}


/* ===========================
   MarkerCluster premium look
   =========================== */

/* ===========================
   Premium MarkerCluster UI
   =========================== */

/* Wrapper koji MarkerCluster ubacuje */
.pm-cluster-icon{
  background: transparent !important;
  border: none !important;
}

/* Core bubble */
.pm-cluster{
  --pm-size: 38px;
  --pm-ring: rgba(22,160,133,.22);
  --pm-bg: rgba(255,255,255,.92);
  --pm-border: rgba(0,0,0,.12);

  width: var(--pm-size);
  height: var(--pm-size);
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--pm-bg);
  border: 1px solid var(--pm-border);
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
  backdrop-filter: blur(8px);

  position: relative;
  transform-origin: 50% 50%;
  animation: pmClusterIn .18s ease-out;
}

/* Subtle glow ring */
.pm-cluster::before{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:999px;
  background: radial-gradient(circle, var(--pm-ring), rgba(22,160,133,0) 60%);
  opacity:.9;
  pointer-events:none;
}

/* count text */
.pm-cluster__count{
  font: inherit;            /* koristi temu */
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 13px;
  line-height: 1;
  color: #111;
  position: relative;
  z-index: 1;
}

/* Sizes */
.pm-cluster--s{ --pm-size: 36px; }
.pm-cluster--m{ --pm-size: 42px; }
.pm-cluster--l{ --pm-size: 48px; }
.pm-cluster--xl{ --pm-size: 56px; }

/* Bigger text for bigger clusters */
.pm-cluster--m .pm-cluster__count{ font-size: 13px; }
.pm-cluster--l .pm-cluster__count{ font-size: 14px; }
.pm-cluster--xl .pm-cluster__count{ font-size: 15px; }

/* Hover: malo “lift” */
.pm-cluster-icon:hover .pm-cluster{
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

/* Press feel */
.pm-cluster-icon:active .pm-cluster{
  transform: translateY(0) scale(.98);
}

/* scale-in animacija */
@keyframes pmClusterIn{
  from { transform: scale(.82); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}


.pm-empty{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  text-align: center;
}
.pm-empty__icon{
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
}
.pm-empty__title{
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}
.pm-empty__text{
  font-size: 13px;
  opacity: .75;
  margin-bottom: 12px;
}


.pm-btn-primary{
  background:#16A085;
  border-color:#16A085;
  color:#fff;
}

.pm-btn-primary:hover{
  background:#138d75;
  border-color:#138d75;
}

/* da bude iste visine kao ostala dugmad */
.pm-actions .pm-cta-add{
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}


.pm-cta-section{
  margin-top:40px;
}

.pm-cta-card{
  border:1px solid #e8e8e8;
  border-radius:18px;
  padding:24px;
  background:#fff;
  max-width:900px;
}

.pm-cta-card h3{
  margin-top:0;
  margin-bottom:8px;
}

.pm-cta-card p{
  margin-bottom:18px;
  opacity:.85;
}

/* širina ista kao mapa wrapper */
.pm-cta-section{
  margin-top:40px;
  grid-column: 1 / -1; /* ako je unutar grid-a */
}

.pm-cta-card{
  border:1px solid #e8e8e8;
  border-radius:18px;
  padding:24px;
  background:#fff;
}

/* forma */
.pm-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.pm-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.pm-form input,
.pm-form textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid #e8e8e8;
  outline:none;
  font-family:inherit;
  font-size:14px;
}

.pm-form textarea{
  min-height:90px;
  resize:vertical;
}

.pm-form input:focus,
.pm-form textarea:focus{
  border-color:#cfcfcf;
  box-shadow:0 0 0 3px rgba(0,0,0,.04);
}

.pm-form-submit{
  align-self:flex-start;
}

.pm-form-msg{
  font-size:14px;
  margin-top:6px;
}

.pm-form-msg.pm-success{
  color:#16A085;
}

.pm-form-msg.pm-error{
  color:#c0392b;
}

@media(max-width:700px){
  .pm-form-grid{
    grid-template-columns:1fr;
  }
}


.pm-side-titlebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

/* samo za ovo dugme */
.pm-add-bakery-btn{
  font-family:inherit;
  line-height:1;
}

/* isključi hover efekat (da ne vuče Astra/system) */
.pm-add-bakery-btn:hover,
.pm-add-bakery-btn:focus,
.pm-add-bakery-btn:active{
  background: inherit !important; /* ako ti pm-btn već ima bg, ovo ga “zakuca” */
  color: inherit !important;
  filter:none !important;
  transform:none !important;
  box-shadow:none !important;
  opacity:1 !important;
}


.pm-cta-section{
  margin-top: 60px;
}

/* 1) kartica mora 100% širine sekcije */
#pm-cta-form.pm-cta-section{
  width: 100%;
}

#pm-cta-form .pm-cta-card{
  width: 100% !important;
  max-width: none !important;
  display: block !important;
  box-sizing: border-box;
}

/* 2) i sama forma + grid inputi moraju 100% */
#pm-cta-form form.pm-form{
  width: 100% !important;
  max-width: none !important;
  display: block !important;
  box-sizing: border-box;
}

#pm-cta-form .pm-form-grid{
  width: 100%;
  box-sizing: border-box;
}

/* 3) textarea i inputi da ne prave “užu” formu */
#pm-cta-form input,
#pm-cta-form textarea{
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* 4) ako negde ima align-self/justify-self koji je suzio */
#pm-cta-form .pm-cta-card,
#pm-cta-form form.pm-form{
  justify-self: stretch;
  align-self: stretch;
}


/* Razmak iznad textarea Lokacija */
#pm-cta-form textarea[name="locations"]{
  margin-top: 16px !important;
}

/* Razmak iznad drugog textarea (dodatne info) */
#pm-cta-form textarea[name="message"]{
  margin-top: 12px !important;
}

/* Da dugme ne nalegne na textarea */
#pm-cta-form .pm-form-submit{
  margin-top: 10px !important;
}

#pm-cta-form input,
#pm-cta-form textarea{
  display:block;
  width:100%;
}