.tas-halal-finder {
  --tas-content-gutter: 20px;
  --tas-halal-map-height: clamp(380px, 70vh, 650px);
  --tas-halal-list-width: clamp(300px, 32vw, 440px);
  width: 99vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 24px 0 0;
  background: var(--background-color);
}

.tas-halal-finder__inner {
  width: 100%;
  max-width: none;
  margin: 0;
}

.tas-halal-finder__heading {
  margin: 0 0 20px;
  padding: 0 var(--tas-content-gutter);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--primary);
}

.tas-halal-finder__toolbar {
  margin-bottom: 16px;
  padding: 0 var(--tas-content-gutter);
}

.tas-halal-finder__search-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  max-width: 1080px;
  margin: 0 auto;
}

.tas-halal-finder__search-input {
  flex: 1 1 280px;
  min-width: 0;
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-body);
  background: var(--white);
}

.tas-halal-finder__search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.tas-halal-finder__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 22px;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.tas-halal-finder__btn--detect {
  color: var(--primary);
  background: var(--white);
  border: 1px solid var(--border-light);
}

.tas-halal-finder__btn--detect:hover {
  border-color: var(--accent);
}

.tas-halal-finder__btn--search {
  color: var(--text-on-primary);
  background: var(--primary);
}

.tas-halal-finder__btn--search:hover {
  opacity: 0.92;
}

.tas-halal-finder__location-hint {
  max-width: 1080px;
  margin: 14px auto 0;
  font-size: 0.875rem;
  line-height: 1.55;
  text-align: center;
  color: var(--text-muted);
}

.tas-halal-finder__location-hint .fa-circle-info {
  margin-right: 6px;
  color: var(--accent);
}

.tas-halal-finder__location-hint a {
  margin-left: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.tas-halal-finder__location-hint a:hover {
  text-decoration: underline;
}

.tas-halal-finder__mobile-tabs {
  display: none;
  gap: 10px;
  margin-bottom: 0;
  padding: 0 var(--tas-content-gutter) 16px;
}

.tas-halal-finder__tab {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  cursor: pointer;
}

.tas-halal-finder__tab.is-active {
  color: var(--text-on-primary);
  background: var(--primary);
  border-color: var(--primary);
}

.tas-halal-finder__layout {
  display: grid;
  grid-template-columns: var(--tas-halal-list-width) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  height: var(--tas-halal-map-height);
  max-height: var(--tas-halal-map-height);
  overflow: hidden;
  border-top: 1px solid var(--border-light);
}

.tas-halal-finder__col-title {
  margin: 0;
  padding: 18px 20px 14px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary);
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
  flex-shrink: 0;
}

.tas-halal-finder__col-title--map {
  display: none;
}

.tas-halal-finder__col--list {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--white);
  border-right: 1px solid var(--border-light);
}

.tas-halal-finder__col--map {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tas-halal-finder__status {
  margin: 0;
  padding: 12px 20px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
  flex-shrink: 0;
}

.tas-halal-finder__status.is-error {
  color: #b42318;
}

.tas-halal-finder__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: none;
  border-radius: 0;
  background: var(--white);
}

.tas-halal-finder__item {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s ease;
}

.tas-halal-finder__item:last-child {
  border-bottom: none;
}

.tas-halal-finder__item:hover,
.tas-halal-finder__item.is-active {
  background: rgba(0, 0, 0, 0.03);
}

.tas-halal-finder__item.is-active {
  box-shadow: inset 4px 0 0 var(--accent);
}

.tas-halal-finder__item-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--white);
  background: #e74c3c;
}

.tas-halal-finder__item-body {
  min-width: 0;
  flex: 1;
}

.tas-halal-finder__item-name {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--primary);
}

.tas-halal-finder__item-meta {
  margin-bottom: 6px;
}

.tas-halal-finder__rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tas-halal-finder__stars {
  position: relative;
  display: inline-flex;
  line-height: 1;
}

.tas-halal-finder__stars-track {
  display: inline-flex;
  gap: 2px;
}

.tas-halal-finder__stars-track .fa-star {
  font-size: 0.75rem;
}

.tas-halal-finder__stars-track--empty {
  color: #d9dce3;
}

.tas-halal-finder__stars-track--empty .fa-star {
  font-weight: 400;
  opacity: 0.85;
}

.tas-halal-finder__stars-track--full {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  color: #f5a623;
  white-space: nowrap;
}

.tas-halal-finder__rating-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-body);
}

.tas-halal-finder__item-address {
  margin: 0 0 6px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tas-halal-finder__item-distance {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.tas-halal-finder__navigate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none !important;
}

.tas-halal-finder__navigate:hover {
  text-decoration: underline !important;
}

.tas-halal-finder__map-wrap {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #e8ecef;
}

.tas-halal-finder__map-search {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transform: translateX(-50%);
}

.tas-halal-finder__map-search:hover {
  background: #f8f8f8;
}

.tas-halal-finder__map-search[hidden] {
  display: none !important;
}

.tas-halal-finder__map-sync {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
  margin: 0;
  padding: 12px 16px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: var(--white);
  cursor: pointer;
}

.tas-halal-finder__map-sync input {
  margin-top: 2px;
  flex-shrink: 0;
}

.tas-halal-finder__map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.tas-halal-finder__map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.92);
}

.tas-halal-finder__info {
  max-width: 280px;
  padding: 4px 2px;
}

.tas-halal-finder__info-name {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--primary);
}

.tas-halal-finder__info-address {
  margin: 0 0 8px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.tas-halal-finder__info-nav {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none !important;
}

.tas-halal-finder__info-nav:hover {
  text-decoration: underline !important;
}

@media (max-width: 991px) {
  .tas-halal-finder {
    --tas-halal-list-width: minmax(0, 1fr);
  }

  .tas-halal-finder__layout {
    grid-template-columns: 1fr;
  }

  .tas-halal-finder__col--list {
    border-right: none;
  }
}

@media (max-width: 767px) {
  .tas-halal-finder {
    --tas-halal-list-max-height: min(360px, 45vh);
    --tas-halal-map-height: clamp(280px, 42vh, 420px);
    padding: 20px 0 0;
  }

  .tas-halal-finder__search-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .tas-halal-finder__search-input {
    flex: 0 0 auto;
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.35;
  }

  .tas-halal-finder__btn {
    width: 100%;
    padding: 12px 18px;
  }

  .tas-halal-finder__mobile-tabs {
    display: none;
  }

  .tas-halal-finder__layout {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .tas-halal-finder__col--list,
  .tas-halal-finder__col--map {
    display: flex !important;
    width: 100%;
    max-height: none;
  }

  /*
   * Mobile list column uses height:auto. flex:1 1 0 + min-height:0 then
   * collapses the <ol> to 0px (markers still render on the map). Size the
   * list by content and scroll within max-height instead.
   */
  .tas-halal-finder__col--list {
    order: 1;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    border-right: none;
  }

  .tas-halal-finder__list {
    flex: 0 1 auto;
    min-height: 0;
    max-height: var(--tas-halal-list-max-height);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .tas-halal-finder__col--map {
    order: 2;
    height: auto;
    border-top: 1px solid var(--border-light);
  }

  .tas-halal-finder__col-title--map {
    display: block;
  }

  .tas-halal-finder__map-wrap {
    flex: 0 0 auto;
    height: var(--tas-halal-map-height);
    min-height: var(--tas-halal-map-height);
  }

  .tas-halal-finder__map {
    height: var(--tas-halal-map-height);
    min-height: var(--tas-halal-map-height);
  }

  .tas-halal-finder__navigate {
    padding: 6px 0;
  }
}

@media (min-width: 768px) {
  .tas-halal-finder__col--list,
  .tas-halal-finder__col--map {
    display: flex !important;
  }
}
