/* css/home.css */

.home-container {
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 80px); /* Space for tab bar and floating button */
}

.header-section {
  background-color: var(--bg-card);
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

/* Top App Bar Styles */
.top-app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.search-section {
  padding: 16px 20px 4px 20px;
}

.app-logo-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 850;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-action-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.top-action-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--primary-color);
}

.top-action-btn svg, .top-action-btn i {
  width: 20px !important;
  height: 20px !important;
}

/* Horizontal Scroll Sections */
.scroll-section {
  margin-top: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title span {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
}

.show-all {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
}

.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 0 20px 20px 20px;
  scrollbar-width: none; /* Firefox */
}

.horizontal-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Developers Circles */
.developer-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* Offer Cards / Top Projects */
.offer-card {
  width: 280px;
  height: 180px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  background-color: var(--bg-subtle);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}

.offer-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offer-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  padding: 20px 16px 12px 16px;
  color: white;
}

.offer-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.offer-location {
  font-size: 0.8rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}

/* Property Card (Unified) */
.property-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.horizontal-scroll .property-card {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.property-card-image-wrap {
  position: relative;
  height: 200px; /* Base height, overrides below */
  width: 100%;
}

.horizontal-scroll .property-card .property-card-image-wrap {
  height: 170px;
}

.property-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-badge-top {
  position: absolute;
  top: 12px;
  left: 12px; /* Actions top-left on card */
  display: flex;
  gap: 8px;
}

.circle-img-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.circle-img-badge:hover {
  background: rgba(0, 0, 0, 0.65);
}

.img-badge-bottom-right {
  position: absolute;
  bottom: 12px;
  right: 12px; /* Label bottom-right */
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.delivery-label {
  font-size: 0.65rem;
  opacity: 0.85;
}

.delivery-year {
  font-size: 0.85rem;
  font-weight: 700;
}

.property-card-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-specs-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.spec-pill {
  background-color: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.card-price-container {
  margin-top: 4px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price-start-label {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.card-installments {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-chat {
  flex: 6;
  background-color: var(--primary-color);
  color: var(--text-inverse);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.btn-chat:hover {
  background-color: var(--primary-color-hover);
}

.btn-contact-small {
  flex: 2;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: transparent;
  transition: all 0.2s;
}

.btn-whatsapp {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success-color);
}

.btn-whatsapp:hover {
  background-color: rgba(16, 185, 129, 0.05);
  border-color: var(--success-color);
}

.btn-call {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-call:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.action-btn {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.action-btn:hover, .action-btn.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: var(--bg-card);
}

.action-btn.icon-only {
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Card Title Row & Brand/Publisher Badges */
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.card-title-row .card-title {
  margin-bottom: 0;
  flex: 1;
}

/* Brand Logo Container */
.brand-logo-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  max-height: 24px;
}

.brand-logo-img svg {
  display: block;
}

/* Publisher Avatar Pill (Broker / Office) */
.publisher-avatar-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 8px 4px 12px; /* RTL padding: image on left/right, text on right/left */
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
  max-width: 150px;
}

.publisher-avatar-pill img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.publisher-avatar-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Custom coloring based on role */
.publisher-avatar-pill.office {
  border-color: rgba(16, 185, 129, 0.2);
  background-color: rgba(16, 185, 129, 0.05);
}

.publisher-avatar-pill.office span {
  color: #059669;
}

.publisher-avatar-pill.broker {
  border-color: rgba(99, 102, 241, 0.2);
  background-color: rgba(99, 102, 241, 0.05);
}

.publisher-avatar-pill.broker span {
  color: #4f46e5;
}

.img-badge-bottom-left {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: white;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  z-index: 2;
}

.img-badge-bottom-left i, .img-badge-bottom-left svg {
  width: 12px !important;
  height: 12px !important;
}
