/* Home page (index.jsp) on phones: tighter sections, side-scrolling rows instead of long stacks. Desktop unchanged. */

/* Trust badges marquee track (built by js/index-trust-marquee.js): invisible to layout above phone width */
body.index-page .trust-track { display: contents; }
body.index-page .trust-row .is-clone { display: none; }

@keyframes ubq-trust-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 767.98px) {
  body.index-page .page-shell { padding-left: 12px; padding-right: 12px; }
  body.index-page .page-shell > section { margin-bottom: 14px; }
  body.index-page .card { border-radius: 14px; }

  /* Hero */
  body.index-page .hero { padding-top: 14px; gap: 14px; }
  body.index-page .hero-left h1 { font-size: 1.6rem; line-height: 1.2; margin-bottom: 6px; }
  body.index-page .hero-left h1 br { display: none; }
  body.index-page .hero-left > p { font-size: 0.9rem; margin-bottom: 10px; }
  body.index-page .trust-row {
    display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -12px; padding: 2px 12px 4px;
  }
  body.index-page .trust-row::-webkit-scrollbar { display: none; }
  body.index-page .trust-row article {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; min-width: 0;
  }
  body.index-page .trust-row .trust-icon { width: 26px; height: 26px; font-size: 0.75rem; margin: 0; flex: 0 0 26px; }
  body.index-page .trust-row h4 { font-size: 0.76rem; margin: 0; white-space: nowrap; }
  body.index-page .trust-row small { display: none; }
  body.index-page .trust-row.is-marquee {
    display: block; overflow: hidden; padding-left: 0; padding-right: 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  }
  body.index-page .trust-row.is-marquee .trust-track {
    display: flex; width: max-content; animation: ubq-trust-marquee 16s linear infinite;
  }
  body.index-page .trust-row.is-marquee article { margin-right: 8px; }
  body.index-page .trust-row.is-marquee .is-clone { display: flex; }
  body.index-page .trust-row.is-marquee:hover .trust-track,
  body.index-page .trust-row.is-marquee:active .trust-track { animation-play-state: paused; }
  body.index-page .search-panel { padding: 14px; }
  body.index-page .search-tabs .tab { white-space: nowrap; padding-top: 4px; padding-bottom: 8px; }
  body.index-page .search-panel .popular-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  body.index-page .search-panel .popular-row::-webkit-scrollbar { display: none; }

  /* Quick services: 3 x 2 icon tiles */
  body.index-page .quick-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  body.index-page .quick-services .mini-card {
    flex-direction: column; align-items: center; text-align: center; gap: 6px;
    padding: 12px 6px; min-height: 0; margin: 0;
  }
  body.index-page .quick-services .mini-card > div:last-child { width: 100%; }
  body.index-page .quick-services .mini-badge { margin: 0 auto; }
  body.index-page .quick-services h4 { font-size: 0.74rem; line-height: 1.25; margin: 0; }
  body.index-page .quick-services .tiny-pill { display: block; width: max-content; margin: 3px auto 0; font-size: 0.58rem; }
  body.index-page .quick-services p,
  body.index-page .quick-services a { display: none; }

  /* Virtual clinic: image on top, full-width text */
  body.index-page .status-grid { gap: 14px; }
  body.index-page .clinic-card h3 { font-size: 1rem; }
  body.index-page .clinic-layout { display: flex; flex-direction: column-reverse; gap: 10px; }
  body.index-page .clinic-layout img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 12px; margin: 0; }
  body.index-page .clinic-layout ul { margin: 0; padding: 0; }
  body.index-page .clinic-layout li { font-size: 0.85rem; margin-bottom: 6px; }
  body.index-page .clinic-card .compact-btn { width: 100%; }

  /* Live queue: smaller header, stats in one row */
  body.index-page .queue-card .section-head h3 { font-size: 1rem; }
  body.index-page .queue-top { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
  body.index-page .queue-top img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
  body.index-page .queue-depts { grid-column: 1 / -1; }
  body.index-page .stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  body.index-page .stats-row > div {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 8px 4px; background: #f8fafc; border-radius: 10px; min-width: 0;
  }
  body.index-page .stats-row strong { font-size: 1.05rem; line-height: 1.2; }
  body.index-page .stats-row span { font-size: 0.66rem; }
  body.index-page .queue-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.index-page .queue-actions button { font-size: 0.82rem; padding: 10px 6px; margin: 0; }

  /* Specializations: 4 per row */
  body.index-page .catalog-grid { gap: 14px; }
  body.index-page .spec-grid { grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
  body.index-page .spec-grid p { font-size: 0.7rem; line-height: 1.2; margin: 4px 0 0; }

  /* Why choose: two columns */
  body.index-page .why-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.index-page .why-list li { padding: 6px 0; border: 0; align-items: flex-start; }
  body.index-page .why-list .why-text { font-size: 0.74rem; line-height: 1.3; }

  /* Connect with us: one row per partner type */
  body.index-page .connect-panel__title { font-size: 1.25rem; }
  body.index-page .connect-panel .connect-grid.connect-grid--three { display: flex; flex-direction: column; gap: 8px; }
  body.index-page .connect-panel .connect-grid--three .join-card {
    display: grid; grid-template-columns: 40px 1fr; grid-template-areas: "icon title" "icon text" "btn btn";
    column-gap: 10px; row-gap: 2px; padding: 10px 12px; min-height: 0; text-align: left;
  }
  body.index-page .join-card .join-card__icon { grid-area: icon; width: 40px; height: 40px; margin: 0; }
  body.index-page .join-card h4 { grid-area: title; font-size: 0.95rem; margin: 0; }
  body.index-page .join-card p { grid-area: text; font-size: 0.78rem; margin: 0; }
  body.index-page .join-card .join-btn { grid-area: btn; margin-top: 8px; width: 100%; text-align: center; }

  /* UBIQ-Saathi: shorter image */
  body.index-page .saathi-panel__visual img { min-height: 0; height: 170px; width: 100%; object-fit: cover; }

  /* Impact numbers: compact grid */
  body.index-page .impact-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px; padding: 12px; }
  body.index-page .impact-row .impact-item {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 0; min-width: 0;
  }
  body.index-page .impact-row .impact-item strong { font-size: 1.05rem; }
  body.index-page .impact-row .impact-item span { font-size: 0.66rem; line-height: 1.2; }

  /* e-HRC banner */
  body.index-page .ehrc-promo-banner { padding: 16px; }
  body.index-page .ehrc-promo__headline { font-size: 1.5rem; }
  body.index-page .ehrc-promo-banner .ehrc-promo__affiliations { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 6px; min-height: 0; }
  body.index-page .ehrc-promo__affil { padding: 0 4px; gap: 4px; }
  body.index-page .ehrc-promo__affil { flex: 1 1 0; min-width: 0; }
  body.index-page .ehrc-promo__affil strong { font-size: 0.72rem; }
  body.index-page .ehrc-promo__affil small { font-size: 0.62rem; }
  body.index-page .ehrc-promo__affil-sep { display: none; }
  body.index-page .ehrc-promo__features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  body.index-page .ehrc-promo__feat-sep { display: none; }
  body.index-page .ehrc-promo__feature { gap: 8px; align-items: flex-start; }
  body.index-page .ehrc-promo__feature strong { font-size: 0.74rem; line-height: 1.25; }
  body.index-page .ehrc-promo__feature span { font-size: 0.66rem; }
  body.index-page .ehrc-promo__feat-icon { width: 32px; height: 32px; flex: 0 0 32px; }

  /* App + trust: no QR or mock-up on a phone */
  body.index-page .app-layout > img,
  body.index-page .app-side .qr-box,
  body.index-page .trust-panel__shield { display: none; }
  body.index-page .app-layout { display: block; margin-top: 10px; }
  body.index-page .app-side { display: flex; flex-direction: row; gap: 8px; width: 100%; }
  body.index-page .app-side .store-btn { flex: 1 1 0; margin: 0; border-radius: 10px; white-space: nowrap; }
  body.index-page .trust-panel__body ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; }
  body.index-page .trust-panel__body li { font-size: 0.78rem; margin: 0; }

  /* Footer: link groups two per row */
  body.index-page .legacy-footer { padding-top: 24px; padding-bottom: 16px; }
  body.index-page .legacy-footer .row > div:not(:first-child) { flex: 0 0 50%; max-width: 50%; }
  body.index-page .legacy-footer .footer-description { font-size: 0.82rem; line-height: 1.45; margin-bottom: 10px; }
  body.index-page .legacy-footer .footer-heading { font-size: 0.95rem; margin-bottom: 6px; }
  body.index-page .legacy-footer .footer-links li { margin-bottom: 4px; }
  body.index-page .legacy-footer .footer-links a { font-size: 0.78rem; }
}

/* Top doctors: auto-advancing carousel on phones and tablets (driven by js/index-doctor-carousel.js) */
@media (max-width: 991.98px) {
  body.index-page .doctor-grid {
    display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; scroll-padding-inline: 14px; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px 6px;
  }
  body.index-page .doctor-grid::-webkit-scrollbar { display: none; }
  body.index-page .doctor-grid .doctor-card { flex: 0 0 min(72%, 280px); scroll-snap-align: start; margin: 0; }
  body.index-page .doctor-grid .doctor-card img { height: 120px; object-fit: cover; }
  body.index-page .doctor-grid .doctor-copy { font-size: 0.85rem; }
  body.index-page .doctor-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
  body.index-page .doctor-dots button {
    width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: #cbd5e1;
    transition: width .25s ease, background-color .25s ease;
  }
  body.index-page .doctor-dots button.is-active { width: 18px; background: #2563eb; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  body.index-page .doctor-grid .doctor-card { flex-basis: calc(50% - 30px); }
  body.index-page .doctor-grid .doctor-card img { height: 160px; }
}
@media (min-width: 992px) {
  body.index-page .doctor-dots { display: none; }
}
