/* ═══════════════════════════════════════════════════════════
   Businessspot — Responsive Stylesheet
   Mobile-first: 375px → 768px → 1024px → 1440px+
   ═══════════════════════════════════════════════════════════ */

/* ── Global overrides ───────────────────────────────────── */
img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal overflow on all pages */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   LEFT / RIGHT ALIGNMENT — Bootstrap gutter fix

   Root cause: Bootstrap .row.g-5 adds negative margins of
   -24px per side, which overflows a 20px container padding.
   Fix: Reset row gutters on mobile, use direct column padding.
   ══════════════════════════════════════════════════════════ */

/* Step 1 – Give all containers a reliable horizontal padding */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Step 2 – On screens < 992px, collapse ALL Bootstrap row gutters
   so negative margins don't bleed outside the container */
@media (max-width: 991.98px) {
  .row {
    --bs-gutter-x: 0px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Restore g-4 / g-3 card grids spacing (homepage + similar section) */
  .row.g-4,
  .row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
    margin-left: calc(-0.5 * 1rem) !important;
    margin-right: calc(-0.5 * 1rem) !important;
  }

  .row.g-4 > [class*="col-"],
  .row.g-3 > [class*="col-"] {
    padding-left: calc(0.5 * 1rem) !important;
    padding-right: calc(0.5 * 1rem) !important;
  }
}

/* Step 3 – Desktop: restore normal Bootstrap gutter */
@media (min-width: 992px) {
  .container,
  .container-fluid,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* Mobile filter bar */
.d-lg-none[style*="padding:12px 16px"] {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  height: auto;
  min-height: 64px;
  padding: 0;
}

.navbar-toggler {
  padding: 6px 8px;
  color: var(--dark);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile only: expand the collapsed nav full-width */
@media (max-width: 991.98px) {
  .navbar .container {
    flex-wrap: wrap;
  }

  #mainNav.collapse.show {
    width: 100%;
    padding: 12px 0 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }

  .navbar-brand {
    font-size: 18px;
  }
}

/* Desktop: enforce single-row inline navbar */
@media (min-width: 992px) {
  .navbar {
    height: 64px;
  }

  .navbar .container {
    flex-wrap: nowrap;
  }

  #mainNav {
    display: flex !important;
    flex-basis: auto;
    width: auto;
    padding: 0;
    border-top: none;
    margin-top: 0;
  }
}


/* ── Hero Section ──────────────────────────────────────── */
.hero-section {
  padding: 32px 0 24px;
}

.hero-title {
  font-size: clamp(28px, 7vw, 56px);
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 14px;
  margin-bottom: 18px;
  padding: 0 8px;
}

/* Search bar — mobile stacked */
.hero-search {
  flex-direction: row;
  flex-wrap: nowrap;
  padding: 6px 6px 6px 14px;
  gap: 0;
  align-items: center;
}

.hero-search input {
  font-size: 14px;
  min-width: 0;
}

.hero-search #nearMeBtn {
  padding: 8px 10px !important;
  margin-right: 6px !important;
  flex-shrink: 0;
}

.hero-search .btn-green {
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Category chips — scroll on small screens */
.hero-chips {
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.hero-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 576px) {
  .hero-section {
    padding: 44px 0 36px;
  }

  .hero-title {
    font-size: clamp(32px, 5vw, 56px);
  }

  .hero-subtitle {
    font-size: 17px;
    padding: 0;
  }

  .hero-search .btn-green {
    padding: 10px 20px;
    font-size: 14px;
  }

  .hero-chips {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (min-width: 992px) {
  .hero-section {
    padding: 56px 0 46px;
  }

  .hero-title {
    font-size: clamp(40px, 5vw, 56px);
  }

  .hero-subtitle {
    font-size: 18px;
  }
}

/* ── Stats Bar ────────────────────────────────────────── */
.stats-bar {
  padding: 12px 0;
}

.stats-bar-inner {
  gap: 0;
}

.stat-item {
  padding: 8px 12px;
  flex: 1 1 50%;
  border-right: none;
  border-bottom: 1px solid var(--border);
  justify-content: center;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.stat-item:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.stat-item:nth-child(3),
.stat-item:nth-child(4) {
  border-bottom: none;
}

.stat-number {
  font-size: 18px;
}

.stat-label {
  font-size: 11px;
}

@media (min-width: 576px) {
  .stats-bar {
    padding: 14px 0;
  }

  .stat-item {
    flex: 1 1 25%;
    flex-direction: row;
    text-align: left;
    padding: 10px 20px;
    border-bottom: none;
    border-right: 1px solid var(--border);
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .stat-item:last-child {
    border-right: none;
  }

  .stat-number {
    font-size: 20px;
  }
}

@media (min-width: 992px) {
  .stats-bar {
    padding: 16px 0;
  }

  .stat-item {
    padding: 8px 32px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-number {
    font-size: 22px;
  }
}

/* ── Sections ──────────────────────────────────────────── */
.section-pad {
  padding: 28px 0;
}

.section-pad-sm {
  padding: 20px 0;
}

.section-header {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 22px;
}

@media (min-width: 768px) {
  .section-pad {
    padding: 40px 0;
  }

  .section-pad-sm {
    padding: 28px 0;
  }

  .section-title {
    font-size: 26px;
  }
}

@media (min-width: 992px) {
  .section-pad {
    padding: 48px 0;
  }

  .section-pad-sm {
    padding: 36px 0;
  }

  .section-title {
    font-size: 28px;
  }

  .section-header {
    flex-wrap: nowrap;
    margin-bottom: 22px;
  }
}

/* ── Company Cards ─────────────────────────────────────── */
.co-card {
  padding: 18px;
}

.co-card-name {
  font-size: 15px;
  white-space: normal;        /* allow wrapping */
  overflow: visible;
  text-overflow: unset;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.co-card-desc {
  -webkit-line-clamp: 2;
  font-size: 13px;
}

@media (min-width: 768px) {
  .co-card {
    padding: 22px;
  }

  .co-card-name {
    font-size: 16px;
    -webkit-line-clamp: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .co-card-desc {
    -webkit-line-clamp: 3;
  }
}

@media (min-width: 1024px) {
  .co-card {
    padding: 24px;
  }
}

/* ── Category Grid ─────────────────────────────────────── */
.cat-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cat-item {
  padding: 18px 8px;
  gap: 8px;
}

.cat-item i {
  font-size: 22px;
}

.cat-item-name {
  font-size: 12px;
}

@media (min-width: 576px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .cat-item {
    padding: 20px 12px;
  }

  .cat-item i {
    font-size: 24px;
  }

  .cat-item-name {
    font-size: 13px;
  }
}

@media (min-width: 768px) {
  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .cat-item {
    padding: 24px 12px;
    gap: 10px;
  }

  .cat-item i {
    font-size: 26px;
  }
}

/* ── CTA Banner ────────────────────────────────────────── */
.cta-banner {
  flex-direction: column;
  padding: 32px 24px;
  gap: 24px;
  align-items: flex-start;
  text-align: left;
}

.cta-banner h2 {
  font-size: 22px;
}

.cta-banner p {
  font-size: 14px;
}

.cta-banner .d-flex {
  width: 100%;
}

.cta-banner .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 576px) {
  .cta-banner {
    padding: 40px 36px;
  }

  .cta-banner h2 {
    font-size: 24px;
  }

  .cta-banner .btn {
    width: auto;
  }
}

@media (min-width: 992px) {
  .cta-banner {
    flex-direction: row;
    padding: 48px 56px;
    align-items: center;
    gap: 32px;
  }

  .cta-banner h2 {
    font-size: 28px;
  }

  .cta-banner .d-flex {
    width: auto;
    flex-shrink: 0;
  }
}

/* ── Search Page ───────────────────────────────────────── */
.search-bar-section {
  flex-direction: column;
  padding: 16px 0;
}

.search-bar-wrap {
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
}

.search-input-box {
  width: 100%;
}

@media (min-width: 768px) {
  .search-bar-wrap {
    flex-direction: row;
    padding: 0;
    width: auto;
  }

  .search-input-box {
    width: 320px;
  }
}

/* ── Company List Cards (search results) ───────────────── */
.company-list-card {
  gap: 12px;
  padding: 16px 0;
}

.co-logo-box {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.co-name {
  font-size: 15px;
}

.co-header {
  flex-wrap: wrap;
}

.co-stats {
  gap: 6px;
}

@media (min-width: 576px) {
  .company-list-card {
    gap: 16px;
    padding: 20px 0;
  }

  .co-logo-box {
    width: 52px;
    height: 52px;
  }

  .co-name {
    font-size: 17px;
  }
}

/* ── Sidebar Filter ────────────────────────────────────── */
.page-layout {
  padding: 24px 0;
}

@media (min-width: 992px) {
  .page-layout {
    padding: 40px 0;
  }
}

/* ── Footer ────────────────────────────────────────────── */
.gd-footer {
  padding: 36px 0 20px;
}

.gd-footer .col-6 {
  margin-bottom: 8px;
}

.gd-footer-bottom {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding-top: 20px;
  margin-top: 28px;
}

.gd-footer-bottom .d-flex {
  gap: 20px;
}

@media (min-width: 576px) {
  .gd-footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 992px) {
  .gd-footer {
    padding: 48px 0 24px;
  }

  .gd-footer-bottom {
    padding-top: 24px;
    margin-top: 40px;
  }
}

/* ── Listing Detail Page ───────────────────────────────── */
.listing-header {
  padding: 16px 0 20px;
}

/* Listing header info — stack logo + title cleanly on mobile */
.listing-header .d-flex.flex-column.flex-md-row {
  gap: 16px !important;
}

/* Listing header actions — full-width buttons on mobile */
@media (max-width: 575px) {
  .listing-header .d-flex.gap-2.flex-shrink-0.flex-wrap {
    width: 100%;
  }

  .listing-header .d-flex.gap-2.flex-shrink-0.flex-wrap .btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  /* Review sort form — wrap on small screens */
  #sortForm {
    flex-wrap: wrap;
    gap: 6px !important;
  }

  #sortForm select {
    width: 100% !important;
  }

  /* Review header row — stack on very small screens */
  .col-lg-8 > .d-flex.align-items-center.justify-content-between.mb-4 {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Review items — prevent text from running edge-to-edge
     The items use padding:28px 0 (no horizontal padding) which
     means with container padding they're fine, but let's make sure
     the star row doesn't overflow */
  .col-lg-8 [style*="padding:28px 0"] {
    padding: 20px 0 !important;
  }
}

@media (min-width: 768px) {
  .listing-header {
    padding: 28px 0 32px;
  }
}

@media (min-width: 992px) {
  .listing-header {
    padding: 40px 0;
  }
}

/* Sidebar cards on mobile — reduce internal padding */
@media (max-width: 767px) {
  /* Rating summary card */
  .col-lg-4 [style*="border-radius:var(--radius-lg);padding:28px"] {
    padding: 20px !important;
  }

  /* Company info card */
  .col-lg-4 [style*="border-radius:var(--radius-lg);padding:24px"] {
    padding: 16px !important;
  }

  /* Large rating number — reduce on small screens */
  [style*="font-size:56px;font-weight:900"] {
    font-size: 44px !important;
  }

  /* Gallery strip — shorter on mobile */
  #galleryTrack {
    height: 200px !important;
  }

  #galleryWrap [style*="height:280px"] {
    height: 200px !important;
  }
}

/* ── Utility: touch-friendly min tap target ────────────── */
@media (max-width: 767px) {
  .btn {
    min-height: 44px;
    padding: 10px 18px;
  }

  .chip {
    min-height: 36px;
    padding: 7px 14px;
  }

  .filter-pill {
    min-height: 36px;
    padding: 8px 14px;
  }
}

/* ── Extra Large / Wide Screens ─────────────────────────── */
@media (min-width: 1400px) {
  .hero-title {
    font-size: 56px;
  }

  .hero-subtitle {
    font-size: 19px;
    max-width: 560px;
  }

  .hero-search {
    max-width: 680px;
  }
}
