/* ==========================================================================
   Sponsored slots — /browse-businesses (above Top 100 #1)
   Mirrors the .top-pro-row layout (rank tile · photo tile · 3 detail lines ·
   CTA) with a red treatment so paid placements read as distinct from the
   organic, review-ranked list. Rotation logic: js/sponsor-slots.js
   ========================================================================== */
.sponsor-slots {
  --sp-red: #dc2626;
  --sp-red-deep: #b91c1c;
  --sp-red-soft: #fef2f2;
  --sp-red-line: #fecaca;
  --sp-ease: cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 0 1.25rem;
}

.sponsor-slots__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  color: #71717a;
}
.sponsor-slots__head strong { color: var(--sp-red-deep); font-weight: 800; letter-spacing: 0.02em; }
.sponsor-slots__head a { color: var(--sp-red-deep); font-weight: 700; text-decoration: none; white-space: nowrap; }
.sponsor-slots__head a:hover { text-decoration: underline; }

.sponsor-slots__list { display: flex; flex-direction: column; }

/* ---- Row (same geometry as .top-pro-row) ---- */
.sponsor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 112px;
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--sp-red-soft);
  border: 2px solid var(--sp-red);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.07), 0 6px 18px -6px rgba(220, 38, 38, 0.28);
  transition: opacity 200ms var(--sp-ease), transform 200ms var(--sp-ease);
}
.sponsor-slots.is-swapping .sponsor-row { opacity: 0; transform: translateY(4px); }

.sponsor-row--skeleton {
  border-color: var(--sp-red-line);
  box-shadow: none;
  background: linear-gradient(90deg, #fff5f5 0%, #fee2e2 50%, #fff5f5 100%) 0 0 / 200% 100%;
  animation: sp-shimmer 1.4s linear infinite;
}
@keyframes sp-shimmer { to { background-position: -200% 0; } }

.sp-left { display: flex; align-items: center; gap: 1.25rem; flex: 1; min-width: 0; }

/* Small "Sponsored" label above the name */
.sp-tag {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--sp-red-deep);
}

/* Photo tile with monogram fallback (same as Top 100) */
.sp-photo {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1.5px solid var(--sp-red-line);
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
}
.sp-mono {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
}
.sp-mono .gi { width: 20px; height: 20px; margin-bottom: 2px; }
.sp-mono b { font-size: 0.85rem; font-weight: 900; letter-spacing: 0.04em; line-height: 1.1; }
.sp-mono i {
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
  font-style: normal;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.sp-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #ffffff; }

/* Details */
.sp-details { flex: 1; min-width: 0; }
.sp-line1 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.25rem; min-width: 0; }
.sponsor-name {
  margin: 0;
  min-width: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #09090b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sponsor-name a { color: inherit; text-decoration: none; }
.sponsor-name a:hover { color: var(--sp-red-deep); }

.sp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--sp-red-line);
  color: var(--sp-red-deep);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.sp-line2,
.sp-line3 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.sp-line2 { margin-bottom: 0.35rem; font-size: 0.85rem; color: #64748b; }
.sp-line2 strong { color: #27272a; }
.sp-rating {
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  font-weight: 800;
  font-size: 0.85rem;
}
.sp-reviews { color: #475569; font-size: 0.88rem; font-weight: 700; }
.sp-line3 { font-size: 0.84rem; color: #64748b; }
.sp-line3 a { font-weight: 700; text-decoration: none; }
.sp-line3 a:hover { text-decoration: underline; }
.sp-claim { color: #09090b; }
.sp-site { color: var(--sp-red-deep); }
.sp-dot { color: #cbd5e1; }
.sp-line3 .gi { width: 14px; height: 14px; vertical-align: -2px; }

/* CTAs */
.sponsor-actions { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.sponsor-call,
.sponsor-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.3rem;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 160ms var(--sp-ease), border-color 160ms var(--sp-ease), transform 160ms var(--sp-ease);
}
.sponsor-call {
  background: #ffffff;
  color: var(--sp-red-deep);
  border: 1.5px solid var(--sp-red-line);
}
.sponsor-call:hover { border-color: var(--sp-red); }
.sponsor-call svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sponsor-profile {
  background: var(--sp-red);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.sponsor-profile:hover { background: var(--sp-red-deep); }
.sponsor-call:active,
.sponsor-profile:active { transform: scale(0.97); }
.sponsor-call:focus-visible,
.sponsor-profile:focus-visible,
.sponsor-row a:focus-visible { outline: 2px solid var(--sp-red); outline-offset: 2px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .sponsor-row { flex-direction: column; align-items: stretch; gap: 1rem; }
  .sponsor-actions > a { flex: 1; }
}
/* ==========================================================================
   Mobile card layout (≤640px) — shared by sponsor rows and organic rows.
   Header: logo tile + (Sponsored label / rank chip) + name & pill.
   Body: rating/serving and address run the full card width.
   Footer: hairline divider, links, then CTAs side by side.
   ========================================================================== */
@media (max-width: 640px) {
  /* ---- Sponsor rows ---- */
  .sponsor-row { padding: 1rem; gap: 0.9rem; min-height: 0; border-radius: 16px; }
  .sp-left {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 0.85rem;
    row-gap: 0.55rem;
    align-items: start;
  }
  .sp-details { display: contents; }
  .sp-photo { grid-column: 1; grid-row: 1 / span 2; width: 56px; height: 56px; border-radius: 12px; }
  .sp-tag { grid-column: 2; grid-row: 1; align-self: end; margin-bottom: -0.3rem; }
  .sp-line1 {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin: 0;
  }
  .sponsor-name { white-space: normal; font-size: 1.06rem; line-height: 1.25; }
  .sp-pill { font-size: 0.68rem; }
  .sp-line2 { grid-column: 1 / -1; margin: 0; gap: 0.35rem 0.5rem; }
  .sp-line3 {
    grid-column: 1 / -1;
    gap: 0.35rem 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--sp-red-line);
  }
  .sp-addr { flex-basis: 100%; color: #475569; }
  .sp-addr + .sp-dot { display: none; }
  .sponsor-actions { flex-wrap: wrap; gap: 0.5rem; }
  .sponsor-actions > a { flex: 1 1 130px; padding: 0.72rem 0.4rem; font-size: 0.84rem; }
  .sponsor-call svg { flex-shrink: 0; }

  /* ---- Organic Top 100 rows (inline styles → !important) ---- */
  .top-pro-row {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1rem !important;
    gap: 0.9rem !important;
    border-radius: 16px !important;
  }
  .top-pro-row > div:first-child {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    column-gap: 0.85rem !important;
    row-gap: 0.55rem !important;
    align-items: start !important;
  }
  /* rank tile → chip on logo corner */
  .top-pro-row > div:first-child > div:nth-child(1) {
    grid-area: 1 / 1 !important;
    z-index: 3 !important;
    justify-self: start !important;
    align-self: start !important;
    width: auto !important;
    height: auto !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    border: 2px solid #ffffff !important;
    background: #1d4ed8 !important;
    color: #ffffff !important;
    font-size: 0.68rem !important;
    line-height: 1.2 !important;
    transform: translate(-8px, -8px) !important;
  }
  .top-pro-row > div:first-child > div:nth-child(1) > span { display: none !important; }
  /* logo tile */
  .top-pro-row > div:first-child > div:nth-child(2) {
    grid-area: 1 / 1 !important;
    width: 56px !important;
    height: 56px !important;
  }
  /* details wrapper dissolves so its lines can span the card */
  .top-pro-row > div:first-child > div:nth-child(3) { display: contents !important; }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(1) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.3rem !important;
    margin: 0 !important;
    min-width: 0 !important;
  }
  .top-pro-row h3 {
    white-space: normal !important;
    font-size: 1.06rem !important;
    line-height: 1.25 !important;
    max-width: 100% !important;
  }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(2) {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    gap: 0.35rem 0.5rem !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(2) > div { white-space: nowrap !important; flex-shrink: 0 !important; }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(2) > span:nth-of-type(2) { display: none !important; }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(2) > span:nth-of-type(3) { flex-basis: 100% !important; }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(3) {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.35rem 0.6rem !important;
    padding-top: 0.6rem !important;
    border-top: 1px solid #e2e8f0 !important;
  }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(3) > span:first-of-type { flex-basis: 100% !important; }
  .top-pro-row > div:first-child > div:nth-child(3) > div:nth-child(3) > span:nth-of-type(2) { display: none !important; }
  /* CTA */
  .top-pro-row > div:last-child {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .top-pro-row > div:last-child > a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 0.75rem 1rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sponsor-row { transition: none; }
  .sponsor-row--skeleton { animation: none; }
}
