/* ============================================
   Trusted Plumbers — Listing Page Styles
   ============================================ */

/* Google Reviews button */
.btn-reviews {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
  font-size: 0.8125rem;
  gap: 0.3rem;
}
.btn-reviews:hover {
  background: #fef3c7;
  border-color: #F59E0B;
  color: #78350f;
}
.btn-reviews svg { color: #F59E0B; }

/* ===== LISTING HERO ===== */
.listing-hero {
  background:
    radial-gradient(ellipse 70% 80% at 10% 50%, rgba(29,78,216,0.05) 0%, transparent 60%),
    var(--grey);
  padding: var(--sp-8) 0 var(--sp-10);
  border-bottom: 1px solid rgba(30,41,59,0.06);
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--grey-dark);
}

.breadcrumb a {
  color: var(--grey-dark);
  font-size: 0.8125rem;
}

.breadcrumb a:hover { color: var(--blue); }

.breadcrumb span[aria-hidden] {
  color: var(--grey-mid);
}

.listing-hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.listing-hero-text h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  margin-bottom: var(--sp-3);
}

.listing-hero-text h1 span {
  color: var(--blue);
}

.listing-hero-sub {
  color: var(--grey-dark);
  font-size: 1rem;
  margin-bottom: var(--sp-4);
}

.listing-hero-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.lh-stat {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: var(--grey-dark);
  font-weight: 500;
}

/* Compact search in hero */
.listing-search {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.ls-field {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
}

.ls-field svg {
  color: var(--grey-dark);
  flex-shrink: 0;
}

.ls-field select {
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--slate);
  background: transparent;
  appearance: none;
  padding-right: var(--sp-6);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

/* ===== SPLIT LAYOUT (list left, map right) ===== */
.listing-split-wrap {
  display: grid;
  grid-template-columns: 1fr 45%;
  align-items: start;
  min-height: calc(100vh - 72px);
}

.split-list-panel {
  min-width: 0;
  border-right: 1px solid rgba(30,41,59,0.08);
}

.split-map-panel {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  background: #e8eef4;
}

.split-map-panel #map {
  width: 100%;
  height: 100%;
}

/* ===== LAYOUT ===== */
.listing-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-8);
  padding: var(--sp-8) var(--sp-6) var(--sp-16);
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

.listings-col {
  min-width: 0;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.filter-count {
  font-size: 0.9375rem;
  color: var(--grey-dark);
}

.filter-count strong {
  color: var(--slate);
  font-weight: 700;
}

.filter-pills {
  display: flex;
  gap: var(--sp-2);
}

.pill {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--grey-mid);
  color: var(--grey-dark);
  background: transparent;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.pill:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.pill:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.sort-select {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--grey-dark);
  border: 1.5px solid var(--grey-mid);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.sort-select:hover,
.sort-select:focus-visible {
  border-color: var(--blue);
}

/* ===== PLUMBER CARD ===== */
.plumber-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.plumber-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(30,41,59,0.06);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-5);
  align-items: start;
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
  position: relative;
}

.plumber-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: rgba(29,78,216,0.1);
}

/* Verified Pro tier — blue accent */
.plumber-card.verified-pro {
  border-color: rgba(29,78,216,0.15);
}

.plumber-card.verified-pro::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, #60A5FA 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Platinum Verified tier — gold accent */
.plumber-card.platinum {
  border-color: rgba(180,130,0,0.2);
}

.plumber-card.platinum::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #B45309 0%, var(--amber) 50%, #FCD34D 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Legacy — keep .trusted working during transition */
.plumber-card.trusted {
  border-color: rgba(29,78,216,0.15);
}
.plumber-card.trusted::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, #60A5FA 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Avatar */
.pc-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--sky);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Card body */
.pc-header {
  margin-bottom: var(--sp-3);
}

.pc-name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-2);
}

.pc-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.pc-name a {
  color: var(--slate);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.pc-name a:hover { color: var(--blue); }

/* Tier badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px var(--sp-2);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tier-badge--verified-pro {
  background: rgba(29,78,216,0.08);
  color: #1D4ED8;
  border: 1px solid rgba(29,78,216,0.2);
}

.tier-badge--platinum {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid rgba(180,130,0,0.3);
}

/* Legacy — keep .trusted-badge working */
.trusted-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: rgba(29,78,216,0.08);
  color: #1D4ED8;
  border: 1px solid rgba(29,78,216,0.2);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px var(--sp-2);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Rating */
.pc-rating {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.stars {
  display: flex;
  gap: 1px;
}

.star {
  font-size: 1rem;
  color: var(--grey-mid);
  line-height: 1;
}

.star.filled { color: var(--amber); }
.star.half {
  position: relative;
  color: var(--grey-mid);
}
.star.half::before {
  content: '★';
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: var(--amber);
}

.rating-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--slate);
}

.rating-count {
  font-size: 0.8125rem;
  color: var(--grey-dark);
}
.rating-gmaps {
  color: #92400e;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rating-gmaps:hover { color: #78350f; }

/* Meta */
.pc-meta {
  display: flex;
  gap: var(--sp-5);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.pc-location,
.pc-experience {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 0.8125rem;
  color: var(--grey-dark);
}

.pc-location svg,
.pc-experience svg {
  flex-shrink: 0;
  color: var(--grey-mid);
}

/* Badges */
.pc-badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px var(--sp-2);
  border-radius: var(--radius-full);
}

.badge--green {
  background: var(--green-light);
  color: #166534;
}

.badge--grey {
  background: var(--grey);
  color: var(--grey-dark);
}

/* Services */
.pc-services {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.service-tag {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--blue);
  background: var(--sky);
  padding: 3px var(--sp-3);
  border-radius: var(--radius-full);
}

/* Trust score bar */
.pc-trust-score {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.ts-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-dark);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ts-bar {
  flex: 1;
  height: 6px;
  background: var(--grey);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ts-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
  border-radius: var(--radius-full);
}

.ts-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--blue);
  white-space: nowrap;
}

/* Actions */
.pc-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: stretch;
  min-width: 140px;
}

.pc-actions .btn {
  justify-content: center;
  font-size: 0.875rem;
  padding: var(--sp-2) var(--sp-4);
}

.pc-phone-display {
  font-size: 0.8125rem;
  color: var(--grey-dark);
  text-align: center;
  font-weight: 500;
}

/* ===== AD SLOT ===== */
.ad-slot {
  background: var(--grey);
  border: 1px dashed var(--grey-mid);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-dark);
  font-size: 0.75rem;
  margin-bottom: var(--sp-8);
}

.ad-slot--in-content {
  height: 280px;
}

.ad-slot--sidebar {
  height: 300px;
  margin-top: var(--sp-5);
}

.ad-slot:empty::after {
  content: attr(data-ad) ' Ad';
}

/* ===== SEO CONTENT ===== */
.seo-content {
  background: var(--grey);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
}

.seo-content h2 {
  font-size: 1.375rem;
  margin-bottom: var(--sp-4);
}

.seo-content h3 {
  font-size: 1.125rem;
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.seo-content p {
  font-size: 0.9375rem;
  color: var(--grey-dark);
  line-height: 1.75;
}

.seo-list {
  list-style: disc;
  padding-left: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.seo-list li {
  font-size: 0.9375rem;
  color: var(--grey-dark);
  line-height: 1.6;
}

.seo-list a {
  color: var(--blue);
  font-weight: 500;
}

/* ===== SIDEBAR ===== */
.listing-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(30,41,59,0.06);
  box-shadow: var(--shadow-card);
  padding: var(--sp-5) var(--sp-6);
}

.sidebar-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: var(--sp-4);
  color: var(--slate);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.sidebar-links a {
  font-size: 0.9375rem;
  color: var(--grey-dark);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  transition: color var(--duration-fast) var(--ease-out);
}

.sidebar-links a::before {
  content: '→';
  font-size: 0.75rem;
  color: var(--blue);
}

.sidebar-links a:hover {
  color: var(--blue);
}

/* Affiliate sidebar card */
.sidebar-affiliate {
  background: linear-gradient(135deg, var(--sky) 0%, var(--white) 100%);
  border-color: rgba(29,78,216,0.1);
}

.affiliate-icon {
  width: 52px;
  height: 52px;
  background: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-4);
}

.sidebar-affiliate h3 {
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}

.sidebar-affiliate p {
  font-size: 0.875rem;
  color: var(--grey-dark);
  line-height: 1.65;
}

.affiliate-disclosure {
  font-size: 0.6875rem;
  color: var(--grey-dark);
  margin-top: var(--sp-3) !important;
  line-height: 1.5;
}

/* ===== LOADING STATE ===== */
.cards-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-16);
  color: var(--grey-dark);
  font-size: 0.9375rem;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--grey);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.rating-source {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--grey-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .listing-layout {
    grid-template-columns: 1fr;
  }

  .listing-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-5);
  }

  .ad-slot--sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .listing-hero-inner {
    flex-direction: column;
  }

  .listing-search {
    width: 100%;
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .ls-field {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
  }

  .listing-search .btn {
    width: 100%;
    justify-content: center;
  }

  .plumber-card {
    grid-template-columns: 1fr;
  }

  .pc-left {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
  }

  .pc-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: auto;
  }

  .pc-actions .btn {
    flex: 1;
  }

  .listing-sidebar {
    grid-template-columns: 1fr;
  }

  /* Stack split layout on mobile — map on top, list below */
  .listing-split-wrap {
    grid-template-columns: 1fr;
  }

  .split-map-panel {
    position: relative;
    top: 0;
    height: 280px;
    border-left: none;
    border-bottom: 1px solid rgba(30,41,59,0.08);
  }

  .split-list-panel {
    border-right: none;
  }

  .listing-layout {
    padding: var(--sp-6) var(--sp-4) var(--sp-12);
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* ============================================
   MAP
   ============================================ */
#map {
  width: 100%;
  height: 100%;
}

/* Map pins */
.map-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(29,78,216,0.35);
  transition: transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}

.map-pin svg {
  transform: rotate(45deg);
  color: #fff;
}

.map-pin--verified-pro {
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(29,78,216,0.4);
}

.map-pin--platinum {
  background: var(--amber);
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}

/* Legacy */
.map-pin--trusted {
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(29,78,216,0.4);
}

.map-pin--hover,
.map-pin:hover {
  transform: rotate(-45deg) scale(1.2);
  box-shadow: 0 4px 16px rgba(29,78,216,0.45);
}

/* Map popup */
.map-popup {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.5;
  min-width: 160px;
}

.map-popup strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 4px;
}

.popup-verified-pro {
  color: var(--blue);
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 3px;
}

.popup-platinum {
  color: #92400E;
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 3px;
}

/* Legacy */
.popup-trusted {
  color: var(--blue);
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 3px;
}

.popup-rating {
  color: var(--grey-dark);
  margin-bottom: 2px;
}

.popup-suburb {
  color: var(--grey-dark);
  margin-bottom: 4px;
}

.popup-score {
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 6px;
}

.popup-link {
  display: inline-block;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.8125rem;
}

.popup-link:hover { color: var(--blue-dark); }

/* Highlighted card when pin clicked */
.plumber-card.map-highlight {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  background: var(--sky);
}

/* ============================================
   INSURANCE BADGES (two-tier)
   ============================================ */
.badge--amber {
  background: rgba(245,158,11,0.1);
  color: #92400E;
  border: 1px solid rgba(245,158,11,0.25);
}

@media (max-width: 768px) {
  .listing-map-wrap {
    height: 260px;
  }
}
