/* --- 0. ELEMENTOR & ASTRA BOX-BREAKERS --- */
/* Forces the theme to let the container take full width without breaking the scroll */
.elementor-section.elementor-section-boxed > .elementor-container,
.ast-container,
.site-content,
.entry-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --- 1. GLOBAL WRAPPER (FIXED WIDTH) --- */
#sf-directory-wrapper,
#sf-directory-wrapper * {
  box-sizing: border-box !important;
}

#sf-directory-wrapper {
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;

  /* Using 100% instead of 100vw to prevent horizontal overflow */
  width: 100% !important;
  max-width: 100% !important;

  /* Force breakout logic using calc to avoid scrollbars */
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100vw !important;

  height: 100vh !important;
  min-height: 100vh !important;

  background: #fff !important;
  overflow: hidden !important;
  z-index: 99 !important;
}

/* --- 2. HEADER & SEARCH UI --- */
.sf-ui-header {
  padding: 30px 60px !important;
  background: #fff !important;
  border-bottom: 1px solid #eee !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important; /* Forces children to respect centering */
}

.sf-search-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important; /* Stretches nearly to the edges */
  margin: 0 auto 20px !important; /* Centers the bar itself */
}

.sf-search-icon {
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  color: #999;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 20px !important;
  line-height: 1 !important;
  transition: color 0.4s ease;
}

.sf-search-icon svg {
  display: block !important;
  margin: 0 !important;
  transition: color 0.4s ease !important;
}

#sf-search-input {
  width: 100% !important;
  padding: 16px 20px 16px 55px !important;
  border-radius: 50px !important;
  border: 1px solid #000 !important;
  background: #fff !important;
  font-size: 14px !important;
  outline: none !important;
  display: block !important;
  height: 55px !important; /* Explicit height for better vertical alignment */
}

/* --- 3. CATEGORY PILLS (Centered to match search) --- */
#sf-filter-pills,
#sf-subcategory-pills {
  display: flex !important;
  gap: 12px !important;
  padding: 5px 0 !important;
  width: 100% !important;
  justify-content: flex-start !important; /* Matches the start of the search bar */
  overflow-x: auto !important;
}

/* CATEGORY PILLS */
.pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  cursor: pointer;
  font-weight: 500;
  font-size: 18px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.pill.active {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.pill i {
  font-size: 14px;
  display: flex;
  align-items: center;
}

.pill span {
  display: inline-block;
}

#sf-subcategory-pills {
  margin-top: 8px !important;
}

.sub-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sub-pill.active {
  background: #fff;
  font-weight: 500;
}

/* --- 4. MAIN LAYOUT (SIDEBAR + MAP) --- */
.sf-ui-main {
  display: flex !important;
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* BUSINESS CARDS */
.sf-biz-card {
  background: #fff !important;
  border-radius: 20px !important;
  padding: 20px !important;
  margin-bottom: 20px !important;
  display: flex !important;
  gap: 15px !important;
  align-items: center !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06) !important;
}

.sf-biz-card img {
  width: 100px !important;
  height: 100px !important;
  border-radius: 15px !important;
  object-fit: cover !important;
}

/* --- 5. THE MAP --- */
#sf-map-canvas {
  flex: 1 !important;
  height: 100% !important;
  background: #f0f0f0 !important;
}

.badge {
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 11px;
  color: white;
  font-weight: bold;
}

#sf-sidebar {
  width: 420px !important;
  min-width: 420px !important;
  background: #a7d7c5;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 2;
  /* 🔥 SHADOW (NOW WILL WORK) */
  box-shadow:
    6px 0 18px rgba(0, 0, 0, 0.12),
    2px 0 6px rgba(0, 0, 0, 0.08);
  transition: background-color 0.4s ease;
  padding: 0 !important;
}

.sf-list-inner {
  padding: 0 0 0 0;
}

/* 🔥 FULL WIDTH ROW (FIX MAIN ISSUE) */
.sf-biz-row {
  display: flex;
  align-items: center;
  gap: 14px;

  width: 100%; /* ✅ FULL WIDTH */
  padding: 14px 20px; /* matches your UI */

  border-radius: 0; /* ❗ remove rounded box */
  background: transparent;
  position: relative;
  z-index: 1;

  transition: background 0.25s ease;
}

/* THIS is the trick */
.sf-biz-row::before {
  content: "";
  position: absolute;
  inset: 0; /* full cover */

  background: rgba(0, 0, 0, 0); /* default */
  z-index: -1;
  transition: background 0.25s ease;
}

.sf-biz-row:hover::before {
  background: rgba(0, 0, 0, 0.08);
}

/* 🔥 WHITE DIVIDER */
.sf-biz-row::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0px;
  right: 0px;

  height: 1px;
  background: rgba(255, 255, 255, 0.6);
}

.sf-biz-row:last-child::after {
  display: none;
}

/* 🔥 HOVER FULL WIDTH (DARKER SHADE) */
.sf-biz-row:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* IMAGE */
.sf-biz-row img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
}

/* TEXT */
.sf-row-content {
  display: flex;
  flex-direction: column;
  margin-left: 20px;
}

.sf-row-content h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #000;
}

/* BADGE (LIKE YOUR IMAGE) */
.sf-row-content .badge {
  margin-top: 12px; /* ⬆️ increased top spacing */
  padding: 4px 8px; /* ⬅️ reduced horizontal padding */

  border-radius: 20px;
  border: 1px solid #000;

  display: inline-block; /* 🔥 IMPORTANT (prevents full stretch) */
  width: fit-content; /* 🔥 keeps it tight */

  text-align: center;
  color: #000;
  font-size: 12px;
  font-weight: 500;
}

/* SCROLLBAR TRACK */
#sf-sidebar::-webkit-scrollbar {
  width: 10px;
}

/* TRACK (transparent so it floats) */
#sf-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

/* THUMB (floating look) */
#sf-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;

  /* 🔥 FLOATING EFFECT WITHOUT BREAKING HOVER */
  border: 3px solid transparent;
  background-clip: content-box;
}

/* HOVER EFFECT */
#sf-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  padding: 0 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #000;
  overflow: hidden;
}

.leaflet-popup-tip {
  border: 1px solid #000;
  box-shadow: none;
}

.leaflet-popup-content {
  margin: 0 !important;
}

.sf-popup {
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: center;
  min-width: 220px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.sf-popup img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.sf-popup-content {
  display: flex;
  flex-direction: column;
}

.sf-popup-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.sf-popup-badge {
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #000;
  font-size: 11px;
  display: inline-block;
  width: fit-content;
}

* SVG MARKER CLEAN FIX */ .sf-marker-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(0); /* crisp rendering */
}

/* SHADOW = REAL DEPTH */
.custom-marker svg {
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

/* HOVER EFFECT (SUBTLE LIKE GOOGLE MAPS) */
.custom-marker:hover svg {
  transform: translateY(-5px) scale(1.08);
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.28));
}

/* FIX BLUR / PIXELATION */
.leaflet-marker-icon.custom-marker {
  background: transparent !important;
  border: none !important;
}

/* ========================= */
/* 🔥 FINAL PREMIUM MAP UI */
/* ========================= */

#sf-map-canvas {
  position: relative;
}

/* 🎯 PERFECT BALANCE (LIGHT BUT NOT WASHED) */
.leaflet-tile {
  filter: brightness(1.02) /* slightly brighter */ contrast(0.92)
    /* soft but still visible */ saturate(0.95); /* keep subtle color */
}

/* 🎯 LIGHT PREMIUM OVERLAY (VERY CONTROLLED) */
#sf-map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;

  /* 🔥 very soft wash (this is the sweet spot) */
  background: linear-gradient(
    rgba(255, 255, 255, 0.4),
    rgba(250, 250, 250, 0.3)
  );

  pointer-events: none;
  z-index: 1;
}

/* 🎯 BASE BACKGROUND (SOFT LIGHT GREY) */
.leaflet-container {
  background: #f2f2f2;
}

/* 🎯 KEEP UI ABOVE OVERLAY */
.leaflet-pane,
.leaflet-marker-pane,
.leaflet-popup-pane {
  z-index: 500 !important;
}

/* 🔥 ZOOM CONTAINER */
.leaflet-control-zoom {
  background: #f4f4f4 !important;
  border-radius: 10px !important;
  border: none !important;
  overflow: hidden;

  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* REMOVE DEFAULT */
.leaflet-control-zoom a {
  border: none !important;
  background: transparent !important;
  color: #000 !important;
  font-weight: 500;
}

/* SIZE */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  width: 60px;
  height: 60px;
  line-height: 44px;
  font-size: 24px;
}

/* DIVIDER LINE */
.leaflet-control-zoom-in {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* HOVER (SUBTLE) */
.leaflet-control-zoom a:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}


.sf-extra-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.sf-extra-filters-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.sf-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-right: 4px;
}

.sf-price-label {
    margin-left: 12px;
}



















/* ========================= */
/* CUSTOM PRICE DROPDOWN */
/* ========================= */

.sf-custom-dropdown{
    position:relative;
    min-width:180px;
}

.sf-custom-selected{
    height:44px;

    padding:0 16px;

    display:flex;
    align-items:center;

    border:1px solid #ddd;
    border-radius:10px;

    background:#fff;

    font-size:14px;
    font-weight:500;
    color:#444;

    cursor:pointer;

    transition:all .2s ease;

    position:relative;
}

.sf-custom-selected:hover{
    background:#fafafa;
    border-color:#d0d0d0;
}

.sf-custom-selected::after{
    content:"";

    position:absolute;

    right:16px;
    top:50%;

    width:8px;
    height:8px;

    border-right:2px solid #777;
    border-bottom:2px solid #777;

    transform:translateY(-60%) rotate(45deg);
}

.sf-custom-options{
    position:absolute;

    top:52px;
    left:0;
    right:0;

    background:#fff;

    border:1px solid #e5e5e5;
    border-radius:10px;

    overflow:hidden;

    box-shadow:0 10px 25px rgba(0,0,0,0.08);

    display:none;

    z-index:9999;
}

.sf-custom-options.open{
    display:block;
}

.sf-custom-option{
    padding:12px 16px;

    font-size:14px;
    color:#444;

    cursor:pointer;

    transition:all .2s ease;
}

.sf-custom-option:hover{
    background:#f5f5f5;
}










/* ===================================================== */
/* 🔥 LARGE TABLETS */
/* ===================================================== */

@media (max-width: 1200px){

  .sf-ui-header{
    padding: 24px 30px !important;
  }

  #sf-sidebar{
    width: 360px !important;
    min-width: 360px !important;
  }

  .sf-biz-row img{
    width: 85px;
    height: 85px;
  }

  .sf-row-content h4{
    font-size: 18px;
  }

  .pill{
    font-size: 16px;
    padding: 9px 16px;
  }
}

/* ===================================================== */
/* 🔥 TABLET */
/* ===================================================== */

@media (max-width: 992px){

  #sf-directory-wrapper{
    height: auto !important;
    min-height: 100vh !important;
    overflow: hidden !important;
  }

  .sf-ui-main{
    flex-direction: column !important;
    height: auto !important;
  }

  /* HEADER */
  .sf-ui-header{
    padding: 20px !important;
  }

  /* SEARCH */
  .sf-search-wrapper{
    margin-bottom: 16px !important;
  }

  #sf-search-input{
    height: 52px !important;
    font-size: 15px !important;
  }

  /* CATEGORY PILLS */
  #sf-filter-pills,
  #sf-subcategory-pills{
    overflow-x: auto !important;
    overflow-y: hidden !important;

    flex-wrap: nowrap !important;

    scrollbar-width: none;
  }

  #sf-filter-pills::-webkit-scrollbar,
  #sf-subcategory-pills::-webkit-scrollbar{
    display:none;
  }

  .pill{
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 15px;
  }

  .sub-pill{
    flex-shrink: 0;
  }

  /* FILTERS */
  .sf-extra-filters-wrapper{
    gap: 10px;
  }

  /* SIDEBAR */
  #sf-sidebar{
    width: 100% !important;
    min-width: 100% !important;

    height: 420px !important;
    min-height: 420px !important;

    order: 2;
  }

  /* MAP */
  #sf-map-canvas{
    width: 100% !important;
    height: 60vh !important;
    min-height: 500px !important;

    order: 1;
  }

  /* BUSINESS ROW */
  .sf-biz-row{
    padding: 16px !important;
    gap: 14px;
  }

  .sf-biz-row img{
    width: 90px;
    height: 90px;
  }

  .sf-row-content{
    margin-left: 0;
  }

  .sf-row-content h4{
    font-size: 18px;
    line-height: 1.3;
  }

  /* ZOOM BUTTONS */
  .leaflet-control-zoom-in,
  .leaflet-control-zoom-out{
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 20px;
  }
}

/* ===================================================== */
/* 🔥 MOBILE */
/* ===================================================== */

@media (max-width: 767px){

  /* WRAPPER */
  #sf-directory-wrapper{
    width: 100% !important;

    left: 0 !important;
    transform: none !important;

    overflow-x: hidden !important;
  }

  /* HEADER */
  .sf-ui-header{
    padding: 16px !important;
  }

  /* SEARCH */
  #sf-search-input{
    height: 48px !important;

    padding: 12px 16px 12px 48px !important;

    font-size: 14px !important;
  }

  .sf-search-icon{
    left: 16px !important;
  }

  /* PILLS */
  .pill{
    font-size: 14px;
    padding: 8px 14px;
    gap: 8px;
  }

  .pill i{
    font-size: 12px;
  }

  .sub-pill{
    font-size: 12px;
    padding: 7px 12px;
  }

  /* FILTERS */
  .sf-extra-filters-wrapper{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sf-custom-dropdown{
    width: 100%;
  }

  .sf-custom-selected{
    width: 100%;
  }

  /* MAP */
  #sf-map-canvas{
    height: 45vh !important;
    min-height: 320px !important;
  }

  /* SIDEBAR */
  #sf-sidebar{
    height: 55vh !important;
    min-height: 55vh !important;
    max-height: 55vh !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    -webkit-overflow-scrolling: touch !important;
}

  /* BUSINESS ROW */
  .sf-biz-row{
    align-items: flex-start;

    padding: 14px !important;
    gap: 12px;
  }

  .sf-biz-row img{
    width: 72px;
    height: 72px;

    border-radius: 10px;
  }

  .sf-row-content h4{
    font-size: 16px;
  }

  .sf-row-content .badge{
    margin-top: 8px;
    font-size: 11px;
  }

  /* POPUP */
  .sf-popup{
    min-width: 180px;
    padding: 10px;
  }

  .sf-popup img{
    width: 54px;
    height: 54px;
  }

  .sf-popup-title{
    font-size: 13px;
  }

  /* ZOOM */
  .leaflet-control-zoom{
    transform: scale(.9);
    transform-origin: bottom right;
  }

  /* REMOVE HUGE SHADOW */
  #sf-sidebar{
    box-shadow:
      0 -4px 12px rgba(0,0,0,0.08);
  }
}

/* ===================================================== */
/* 🔥 EXTRA SMALL DEVICES */
/* ===================================================== */

@media (max-width: 480px){

  .sf-ui-header{
    padding: 14px !important;
  }

  .pill{
    font-size: 13px;
    padding: 7px 12px;
  }

  .sf-biz-row{
    padding: 12px !important;
  }

  .sf-row-content h4{
    font-size: 15px;
  }

  #sf-map-canvas{
    min-height: 280px !important;
  }
}

/* ======================================== */
/* 🔥 GLOBAL OVERFLOW FIX */
/* ======================================== */

html,
body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* MAIN WRAPPER */
#sf-directory-wrapper{
    overflow-x: hidden !important;
}

/* MOBILE FIX */
@media (max-width: 767px){

    #sf-directory-wrapper{
        width: 100% !important;
        max-width: 100% !important;

        left: 0 !important;
        transform: none !important;
    }

    .sf-ui-main,
    .sf-ui-header,
    #sf-sidebar,
    #sf-map-canvas{
        max-width: 100% !important;
    }
}