/* Public agency profile page */
body.ap-profile-page {
  display: block;
  min-height: 100vh;
  background: #f5f0e8;
  font-size: 17px;
}

.ap-page {
  max-width: 1120px;
  margin: 0 auto;
  margin-top: var(--header-h, 60px);
  padding: 1.25rem 1rem 3rem;
  box-sizing: border-box;
}

.ap-back {
  margin-bottom: 1rem;
}

/* ── Hero ── */
.ap-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  margin-bottom: 1.5rem;
}

.ap-logo {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  background: #ece8e2;
  border: 2px solid #f0ebe3;
}

.ap-logo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffd9a8, #ffb347);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ap-hero-main {
  min-width: 0;
}

.ap-name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 800;
  color: #1f1f1f;
  line-height: 1.2;
}

.ap-location {
  margin: 0 0 0.75rem;
  color: #666;
  font-size: 1.05rem;
}

.ap-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ap-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.ap-badge--verified {
  background: #e8f5e9;
  color: #2e7d32;
}

.ap-badge--listings {
  background: #fff3e6;
  color: #c45f00;
}

.ap-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ap-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  background: #faf7f2;
  border: 1px solid #ebe4d8;
  border-radius: 10px;
  color: #333;
  text-decoration: none;
  font-size: 0.98rem;
  transition: border-color 0.15s, background 0.15s;
}

.ap-contact-chip:hover {
  border-color: orange;
  background: #fff8f0;
}

.ap-contact-chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: orange;
}

/* ── Content grid ── */
.ap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.ap-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ap-card-title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  padding-bottom: 0.55rem;
  border-bottom: 3px solid orange;
  display: inline-block;
}

.ap-about {
  margin: 0;
  color: #484848;
  line-height: 1.65;
  font-size: 1.05rem;
  white-space: pre-line;
}

.ap-about--empty {
  color: #999;
  font-style: italic;
}

.ap-map {
  display: block;
  height: 300px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #e8e4de;
}

.ap-address {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
}

/* ── Listings ── */
.ap-listings {
  margin-top: 0.5rem;
}

.ap-listings-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.ap-listings-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #222;
}

.ap-listings-count {
  margin: 0;
  font-size: 1rem;
  color: #777;
}

.ap-listings .houses-carts-container {
  margin-top: 0;
}

.ap-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #fff;
  border-radius: 14px;
  color: #777;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.ap-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .ap-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.35rem 1.15rem;
  }

  .ap-logo,
  .ap-logo-placeholder {
    margin: 0 auto;
  }

  .ap-badges,
  .ap-contact-row {
    justify-content: center;
  }

  .ap-grid {
    grid-template-columns: 1fr;
  }

  .ap-map {
    height: 220px;
  }

  .ap-location {
    font-size: 1rem;
  }

  .ap-badge {
    font-size: 0.88rem;
  }

  .ap-contact-chip {
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
  }

  .ap-card-title {
    font-size: 1.1rem;
  }

  .ap-about {
    font-size: 1rem;
  }

  .ap-address {
    font-size: 0.95rem;
  }

  .ap-listings-title {
    font-size: 1.2rem;
  }

  .ap-listings-count {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .ap-page {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .ap-contact-chip {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}
