/* =====================================================================
   RS Store Locator – rs-store-locator.css
   Version 4.2

   Changes from v3.1:
   – Search bar (.sl-search-wrap, .sl-search-inner, .sl-search-input,
     .sl-search-clear, .sl-search-icon)
   – Active / highlighted card state (.sl-card--active)
   – "No results" panel (.sl-no-results)
   – Smooth fade-in transition on card renders
   – Minor micro-interaction polish (card hover lift, transition easing)
   All existing rules are preserved unchanged.
===================================================================== */

/* ========================= CONTAINER ========================= */
.sl-container {
  max-width: 1440px;
  margin: 20px auto;
}

/* ========================= SEARCH BAR ========================= */
.sl-search-wrap {
  margin: 0 auto 28px;
  max-width: 680px;
  padding: 0 4px;
}

.sl-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #FFD3D2;
  border-radius: 50px;
  padding: 0 16px;
  box-shadow: 0 4px 20px rgba(215, 58, 47, 0.10);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.sl-search-inner:focus-within {
  border-color: #d73a2f;
  box-shadow: 0 4px 28px rgba(215, 58, 47, 0.22);
}

.sl-search-icon {
  font-size: 18px;
  margin-right: 0px;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.55;
  pointer-events: none;
}

.sl-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding:12px 10px!important;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: #222;
  background: transparent;
  line-height: 1.4;
  border:none!important ;
}

.sl-search-input::placeholder {
  color: #aaa;
  font-size: 14px;
}

/* Clear (×) button inside the search field */
.sl-search-clear {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #aaa;
  padding: 4px 6px;
  border-radius: 50%;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease;
}

.sl-search-clear:hover {
  color: #d73a2f;
  background: #FFD3D2;
}


/* Search hint text */
.sl-search-hint {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin: 8px 0 0;
  letter-spacing: 0.01em;
}

/* ========================= TABS ========================= */
.sl-tabs {
  display: flex;
  background: #EAEAEA;
  border-radius: 30px;
  width: 420px;
  margin: 0 auto 40px;
  padding: 4px;
}

.sl-tab {
  flex: 1;
  padding: 10px 24px;
  border: none;
  border-radius: 26px;
  background: transparent;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .3s cubic-bezier(.25, .46, .45, .94);
  color: #000;
  position: relative;
  overflow: hidden;
  font-family: "DM Sans", sans-serif;
}

.sl-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transition: left .5s;
}

.sl-tab:hover::before { left: 100%; }
.sl-tab:hover         { color: #fff; }

.sl-tab.active {
  background: linear-gradient(135deg, #d73a2f 0%, #ff6b6b 100%);
  color: white;
}


/* ========================= RESULT COUNT BADGE ========================= */
.sl-result-count {
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #d73a2f;
  background: #fff0ef;
  border: 1px solid #FFD3D2;
  border-radius: 20px;
  padding: 5px 16px;
  display:done;
  margin: 0 auto 12px;
  width: auto;
}

.sl-cards {
  text-align: center;  /* centres the result-count badge */
}

/* carousel and static-grid are block-level — reset text-align */
.sl-cards .sl-carousel-wrapper,
.sl-cards .sl-static-grid {
  text-align: left;
}


/* ========================= STATIC GRID (1–3 results, no carousel) ========================= */
/* Completely separate from carousel — no overflow:hidden, no transforms */
.sl-static-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 30px 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Each card slot in the grid */
.sl-static-grid .sl-carousel-slide {
  flex: 1 1 300px;
  max-width: 420px;
  padding: 0;
  display: flex;
  box-sizing: border-box;
}

/* Single result — fixed width, properly centred */
.sl-static-grid .sl-carousel-slide:only-child {
  flex: 0 0 420px;
  max-width: 100%;
}

/* The card inside fills the slot */
.sl-static-grid .sl-card {
  width: 100%;
}

/* ========================= CUSTOM CAROUSEL ========================= */
.sl-carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 30px 0!important;
  position: relative;
}

/* The visible window — clips the track */
.sl-carousel-track-outer {
  flex: 1;
  overflow: hidden;
}

/* The scrolling track — slides sit inline inside it */
.sl-carousel-track {
  display: flex;
  will-change: transform;
  margin-top: 10px;
  margin-bottom: 5px;
}

/* Each slide */
.sl-carousel-slide {
  flex-shrink: 0;
  padding: 0 2px;
  box-sizing: border-box;
  display: flex;
}

/* ========================= ARROWS ========================= */
.sl-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px !important;
  border: none;
  background: linear-gradient(135deg, #d73a2f, #ff6b6b);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(215, 58, 47, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  z-index: 10;
  user-select: none;
}

.sl-arrow:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 28px rgba(215, 58, 47, 0.6);
}

.sl-arrow.sl-arrow-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ========================= STORE CARD ========================= */
.sl-card {
  width: 100%;
  background: white;
  border-radius: 20px;
  padding: 32px 24px;
  border: 2px solid #FFD3D2;
  transition:
    transform        0.3s cubic-bezier(.25, .46, .45, .94),
    box-shadow       0.3s cubic-bezier(.25, .46, .45, .94),
    border-color     0.3s ease;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: 4px 4px 66px rgba(211, 45, 39, 0.24) inset;
  cursor: pointer; /* Cards are now clickable */
}

.sl-card:hover {
  transform: translateY(-4px);
  /*box-shadow: 0 16px 40px rgba(215, 58, 47, 0.18), 4px 4px 66px rgba(211, 45, 39, 0.24) inset;*/
}

/* Active / selected card highlight */
.sl-card--active {
  border-color: #d73a2f;
  box-shadow:
    0 0 0 3px rgba(215, 58, 47, 0.18),
    0 16px 40px rgba(215, 58, 47, 0.22),
    4px 4px 66px rgba(211, 45, 39, 0.28) inset;
  transform: translateY(-4px);
}

/* Smooth fade-in when carousel re-renders */
.sl-carousel-wrapper {
  animation: sl-fade-in 0.3s ease;
}

@keyframes sl-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ========================= CARD CONTENT ========================= */
.sl-location {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  color: #d73a2f;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sl-card h3 {
  color: #D32D27;
  font-family: "DM Sans", sans-serif;
  margin-bottom: 18px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
}

.sl-address {
  color: #666;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 2px;
}

.sl-city-state {
  font-family: "Inter", sans-serif;
  margin-bottom: 16px;
}

.sl-card .phone,
.sl-card .email {
  font-size: 14px;
  font-family: "Inter", sans-serif;
  margin-bottom: 10px;
  color: #666;
}

/* ========================= NO RESULTS ========================= */
.sl-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  animation: sl-fade-in 0.3s ease;
}

.sl-no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.sl-no-results p {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  color: #888;
  font-weight: 500;
  margin: 0;
}

/* ========================= MAP ========================= */
.sl-map-container {
  border-radius: 25px;
  overflow: hidden;
  height: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
  margin-top: 20px;
}

/* Note: the map div now uses class .sl-map (not the bare #sl-map ID)
   so multiple instances on the same page each get their own unique ID. */
.sl-map {
  width: 100%;
  height: 100%;
}

/* Keep legacy #sl-map selector working for any theme CSS overrides */
#sl-map {
  width: 100%;
  height: 100%;
}

/* ========================= LOADING ========================= */
.sl-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 420px;
  color: #6c757d;
  font-size: 1.3rem;
  font-weight: 500;
}

.sl-loading i {
  font-size: 3.5rem;
  margin-right: 20px;
  animation: spin 1.2s linear infinite;
}

/* ========================= RESPONSIVE ========================= */
@media (max-width: 768px) {
  .sl-search-wrap {
    margin-bottom: 18px;
    padding: 0;
  }

  .sl-search-input {
   font-size: 14px;
   padding: 10px 7px !important;
  }

  .sl-tabs {
    width: 100%;
    max-width: 420px;
    flex-direction: row;
    margin: 0 auto 10px !important;
  }

  .sl-carousel-wrapper {
    padding: 16px 0;
    gap: 4px;
  }

  .sl-tab{
    padding: 10px 10px;
  font-weight: 500;
    letter-spacing: 0.1px;
    font-size: 0.9rem;
  }
  .sl-card h3{
    font-size: 18px;
    line-height: 1.2;
  }
  .sl-address{
    font-size: 14px;
    line-height: 1.4;
  }

  .sl-arrow {
    width: 25px;
    height: 25px;
    font-size: 16px;
  }
  .sl-city-state{
    font-size: 14px;
  }
  .sl-location{
    font-size: 14px;
    gap: 2px;
  }
  .sl-card .phone, .sl-card .email{
    font-size: 13px;    
  }

  .sl-map-container {
    height: 350px;
  }

  .sl-card h3 {
    font-size: 20px;
  }

  .sl-no-results {
    padding: 40px 16px;
  }
}

/* ========================= LOADING SPIN ========================= */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================= MAP PIN ========================= */
.pin {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  background: #D32D27;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -20px 0 0 -20px;
  transform: rotate(-45deg);
  z-index: 10;
}

.pin:after {
  content: "";
  width: 12px;
  height: 12px;
  margin: 6px;
  background: #e6e6e6;
  position: absolute;
  border-radius: 50%;
}

.bounce {
  animation: bounce 1s;
}

@keyframes bounce {
  0%   { opacity: 0; transform: translateY(-2000px) rotate(-45deg); }
  60%  { opacity: 1; transform: translateY(30px)    rotate(-45deg); }
  80%  {              transform: translateY(-10px)   rotate(-45deg); }
  100% {              transform: translateY(0)       rotate(-45deg); }
}

/* ========================= LEAFLET POPUP ========================= */
.leaflet-popup-content-wrapper {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  border: 2px solid #f0f0f0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 12px 16px !important;
  font-family: "Inter", sans-serif;
}

.leaflet-popup-tip {
  background: #f8f9fa;
  border: 2px solid #f0f0f0;
}

.leaflet-container a.leaflet-popup-close-button {
  width: 30px !important;
  height: 30px !important;
  font-size: 20px;
  top: 5px !important;
  right: 5px !important;
  color: #fff !important;
}

/* ========================= FIX OVERFLOW IN PAGE BUILDERS ========================= */
.elementor-section:has(.sl-container),
.wp-block-group:has(.sl-container),
.entry-content:has(.sl-container),
section:has(.sl-container) {
  overflow: visible !important;
}
