/* Eenternet listing mobile hotfix — 2026-09-09
   Safe to append after existing styles. Focuses only on public business profile pages. */

/* Prevent remote images, long URLs and nested content from forcing horizontal overflow. */
.listing-heading,
.detail-layout,
.detail-layout > article,
.detail-layout > aside,
.gallery,
.business-title-row,
.contact-card {
  min-width: 0;
  max-width: 100%;
}

.listing-heading,
.detail-layout {
  overflow-x: clip;
}

.business-title-row > div {
  min-width: 0;
}

.listing-heading h1,
.listing-heading p,
.contact-card h2,
.contact-card p,
.contact-meta,
.service-item,
.hours-box {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Gallery: fixed viewport per image so oversized/wide source images cannot stretch layout. */
.gallery {
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.gallery a {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
}

.gallery img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: clamp(220px, 52vw, 380px);
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  background: var(--surface);
}

.business-photo-placeholder,
.business-photo-placeholder img {
  max-width: 100%;
}

.business-photo-placeholder img {
  width: 100%;
  object-fit: contain;
}

.business-logo {
  flex: 0 0 auto;
  max-width: 92px;
  object-fit: contain;
}

/* Buttons and links must never exceed card width. */
.contact-card .button,
.contact-card a,
.detail-layout article a {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.contact-card .button {
  white-space: normal;
  text-align: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
  }
  .contact-card {
    position: static !important;
    width: 100%;
  }
}

@media (max-width: 600px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .listing-heading {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .detail-layout {
    width: 100%;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .business-title-row {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px !important;
    align-items: start !important;
  }

  .business-logo {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px;
    padding: 5px;
    border-radius: 12px;
  }

  .listing-heading h1 {
    font-size: clamp(24px, 8vw, 30px) !important;
    line-height: 1.12;
  }

  .rating-line {
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .listing-heading .chips {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
  }

  .listing-heading .chips a,
  .listing-heading .chips span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .gallery {
    gap: 8px;
  }

  .gallery a {
    flex-basis: 100%;
  }

  .gallery img {
    height: min(62vw, 280px) !important;
    min-height: 190px;
  }

  .business-photo-placeholder img {
    height: min(62vw, 260px) !important;
  }

  .service-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .service-item,
  .hours-box,
  .contact-card {
    width: 100%;
    box-sizing: border-box;
  }

  .contact-card {
    padding: 20px !important;
  }

  .contact-card .button {
    width: 100%;
    box-sizing: border-box;
  }
}
