/* ==========================================================================
   CAMCONNECT RESPONSIVE STYLES
   Mobile PWA Navigation, Breakpoints, and Adaptive Layouts
   ========================================================================== */

/* Mobile Bottom Navigation Bar */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 850;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.25rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-icon {
  font-size: 1.25rem;
}

/* --- Media Queries --- */

@media (max-width: 1024px) {
  .segmented-search-grid {
    grid-template-columns: 1fr 1fr;
  }

  .segmented-search-grid .search-btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .blog-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .nav-links-menu,
  .header-desktop-only,
  #header-location-pill {
    display: none !important;
  }

  .mobile-menu-toggle-btn {
    display: flex !important;
  }

  .main-header {
    padding: 0.5rem 0.85rem;
    gap: 0.5rem;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .footer-content-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .contact-layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .mobile-menu-toggle-btn {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* PWA Mobile Bottom Navigation */
  .bottom-nav-bar {
    display: flex;
  }

  /* Hide large desktop FAB on mobile: the bottom bar handles primary actions */
  .floating-action-container {
    display: none !important;
  }

  /* Hide hero side arrows on mobile so headlines have 100% unobstructed readability */
  .slideshow-nav-btn {
    display: none !important;
  }

  .app-viewport {
    padding-bottom: 5.5rem;
  }

  .promo-top-bar {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
  }

  /* Segmented search on mobile */
  .segmented-search-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .segmented-search-grid .search-btn {
    grid-column: 1;
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem !important;
  }

  /* Hero slideshow on mobile */
  .hero-slideshow-container {
    height: 180px;
    margin-bottom: 1rem;
  }

  .hero-slide-overlay {
    padding: 0.85rem 1rem;
    justify-content: center;
  }

  .slide-badge-pill {
    font-size: 0.62rem;
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.25rem;
  }

  .slide-headline {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 0.2rem;
  }

  .slide-subheadline {
    font-size: 0.76rem;
    line-height: 1.25;
    margin-bottom: 0.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .slide-cta-btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
  }

  .slideshow-dots-shelf {
    bottom: 8px;
    right: 12px;
  }

  .hero-greeting-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
  }

  /* Pillar cards: ensure equal height & flex distribution */
  .pillar-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* Listing cards in 2-column mobile grid */
  .listings-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.75rem;
  }

  .listing-image-wrapper {
    height: 135px;
  }

  .listing-price-tag {
    font-size: 0.95rem;
  }

  .listing-title {
    font-size: 0.85rem;
  }

  /* Listing seller footer: stack profile & button so Contact button never clips */
  .listing-seller-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding-top: 0.5rem;
  }

  .listing-seller-footer .seller-mini-profile {
    width: 100%;
  }

  .listing-seller-footer .btn-contact-seller {
    width: 100% !important;
    text-align: center;
    justify-content: center;
    padding: 0.4rem 0.5rem !important;
    font-size: 0.75rem !important;
    border-radius: var(--radius-sm);
  }

  /* Modals: fit snugly without horizontal overflow */
  .modal-container {
    width: 95% !important;
    max-width: 95% !important;
    padding: 1.25rem 1rem !important;
    margin: 0.5rem auto;
    border-radius: var(--radius-lg);
  }

  .blog-cards-grid {
    grid-template-columns: 1fr;
  }

  .blog-card-img-wrap {
    height: 160px;
  }

  .agent-stats-summary, .admin-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .custom-table th, .custom-table td {
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
  }

  .footer-content-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  /* Small smartphones (iPhone SE, Android 360px) */
  .hero-slideshow-container {
    height: 165px;
  }

  .slide-headline {
    font-size: 0.98rem;
  }

  .slide-subheadline {
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
  }

  .slide-cta-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
  }

  .pillar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .pillar-card {
    padding: 0.75rem 0.55rem;
    border-radius: var(--radius-lg);
  }

  .pillar-icon-wrap {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .pillar-tagline-badge {
    font-size: 0.58rem;
    padding: 0.15rem 0.4rem;
  }

  .pillar-card-title {
    font-size: 0.85rem;
  }

  .pillar-card-desc {
    font-size: 0.68rem;
    line-height: 1.28;
    margin-bottom: 0.5rem;
  }

  .pillar-card-footer {
    font-size: 0.68rem;
    padding-top: 0.45rem;
  }

  .pillar-status-indicator {
    font-size: 0.64rem;
  }

  .vendor-card-slide {
    width: 200px;
    padding: 1rem 0.75rem;
  }

  .vendors-showcase-section {
    padding: 1rem 0.75rem;
  }

  .brand-logo-img {
    height: 32px !important;
  }

  .main-header {
    padding: 0.4rem 0.65rem;
  }
}

@media (min-width: 769px) {
  .listings-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}
