/* Compact hospital detail — mobile width / overflow lock */

html.hospital-detail-root,
html.hospital-detail-root body,
body.page-hospital-detail {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: clip;
}

body.page-hospital-detail,
body.page-hospital-detail main,
body.page-hospital-detail .hospital-detail-page,
body.page-hospital-detail .hospital-detail-shell,
body.page-hospital-detail .hxc {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.page-hospital-detail *,
body.page-hospital-detail *::before,
body.page-hospital-detail *::after {
  box-sizing: border-box;
}

.hospital-detail-shell {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  padding-inline: 0;
}

@media (min-width: 390px) {
  .hospital-detail-shell { --hxc-pad: 14px; }
}

.hp-back-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid #d7e2ec;
  border-radius: 999px;
  background: #eef5fb;
  color: #0b4f8a;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.hp-back-btn .icon { width: 20px; height: 20px; }
body.page-hospital-detail .hp-header,
body.page-hospital-detail .mobile-action-bar,
body.page-hospital-detail .hp-mab {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
}
body.page-hospital-detail .hp-header__inner {
  gap: 6px;
  padding-inline: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
body.page-hospital-detail .hp-brand { min-width: 0; flex: 1 1 auto; }
body.page-hospital-detail .hp-brand__tag,
body.page-hospital-detail .hp-lang { display: none !important; }
body.page-hospital-detail .hp-brand__name {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
body.page-hospital-detail .hp-header__actions { gap: 4px; flex: 0 0 auto; min-width: 0; }
body.page-hospital-detail .hp-mab__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
body.page-hospital-detail .hp-mab__btn {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 380px) {
  body.page-hospital-detail .hp-brand__name { display: none; }
  body.page-hospital-detail .hp-brand__logo { width: auto; height: 36px; max-width: 140px; }
}
@media (min-width: 900px) {
  body.page-hospital-detail .hp-lang { display: block !important; }
}
[dir="rtl"] .hp-back-btn .icon { transform: scaleX(-1); }

.hxc {
  --hxc-blue: #0b4f8a;
  --hxc-blue-deep: #083a66;
  --hxc-soft: #eef4fa;
  --hxc-line: #dce6ef;
  --hxc-ink: #132338;
  --hxc-muted: #5a6b7c;
  --hxc-radius: 16px;
  --hxc-pad: 12px;
  background: #f5f8fb;
  color: var(--hxc-ink);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  font-family: "Plus Jakarta Sans", "Noto Sans Arabic", system-ui, sans-serif;
  box-sizing: border-box;
}
.hxc *, .hxc *::before, .hxc *::after { box-sizing: border-box; }
.hxc section,
.hxc .hxc-hero,
.hxc .hxc-hero__body,
.hxc .hxc-hero__cta,
.hxc .hxc-panel,
.hxc .hxc-review,
.hxc .hxc-tabs,
.hxc .hxc-tabs__panels,
.hxc .hxc-tabs__nav,
.hxc .hxc-facts,
.hxc .hxc-facts__track,
.hxc .hxc-related,
.hxc .hxc-related__track,
.hxc .hxc-slider {
  min-width: 0;
  max-width: 100%;
}
.hxc img,
.hxc video,
.hxc iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.hxc h1, .hxc h2, .hxc h3,
.hxc p, .hxc li, .hxc span, .hxc strong, .hxc a, .hxc button,
.hxc-hero__title, .hxc-summary, .hxc-fact__value, .hxc-badge {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}
.hxc h1, .hxc h2, .hxc h3,
.hxc-hero__title {
  font-family: "Plus Jakarta Sans", "Noto Sans Arabic", system-ui, sans-serif !important;
  font-weight: 800;
}

/* HERO — full width; never shrink from aspect-ratio + max-height */
.hxc-hero {
  background: #fff;
  border-bottom: 1px solid var(--hxc-line);
  width: 100%;
  max-width: 100%;
}
.hxc-hero__media {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: clamp(160px, 46vw, 200px);
  aspect-ratio: auto;
  overflow: hidden;
  background: #0b1b2e;
}
.hxc-hero__media img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.hxc-hero__fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0b4f8a, #1a6fb0);
}
.hxc-hero__shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(7, 20, 38, .35));
  pointer-events: none;
}
.hxc-hero__body {
  padding: 8px var(--hxc-pad) 10px;
  width: 100%;
  max-width: 100%;
}
.hxc-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.hxc-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}
.hxc-badge.is-dir { background: #f1f5f9; color: #475569; border-color: #d8e0e8; }
.hxc-badge.is-partner { background: #e8f7ee; color: #146c3b; border-color: #b9e3c8; }
.hxc-badge.is-acc { background: #e8f0fb; color: var(--hxc-blue); border-color: #c5d7ef; }
.hxc-hero__title {
  margin: 0;
  font-size: clamp(22px, 5.6vw, 26px);
  line-height: 1.2;
  letter-spacing: -.02em;
}
.hxc-hero__loc {
  margin: 4px 0 0;
  color: var(--hxc-muted);
  font-size: 13px;
  line-height: 1.35;
}
.hxc-hero__cta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
}
.hxc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.hxc-btn--primary { background: var(--hxc-blue); color: #fff; }
.hxc-btn--ghost { background: #fff; color: var(--hxc-ink); border-color: var(--hxc-line); }
.hxc-btn--link { background: var(--hxc-soft); color: var(--hxc-blue); }
.hxc-btn--block { width: 100%; }

/* FACTS — fit viewport; no fixed card widths */
.hxc-facts {
  padding: 10px var(--hxc-pad) 4px;
  width: 100%;
}
.hxc-facts__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding: 0;
}
.hxc-fact {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--hxc-line);
  border-radius: 14px;
  padding: 8px 8px 9px;
  min-height: 72px;
  display: grid;
  gap: 2px;
  align-content: start;
  box-shadow: 0 4px 12px rgba(15, 35, 56, .04);
}
.hxc-fact__icon { font-size: 14px; line-height: 1; }
.hxc-fact__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--hxc-muted);
}
.hxc-fact__value {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* TABS — horizontal scroll only inside nav */
.hxc-tabs {
  padding: 4px 0 8px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.hxc-tabs__nav {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  padding: 0 var(--hxc-pad) 8px;
  position: sticky;
  top: 56px;
  z-index: 40;
  background: rgba(245, 248, 251, .96);
  backdrop-filter: blur(8px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hxc-tabs__nav::-webkit-scrollbar { display: none; }
.hxc-tabs__btn {
  flex: 0 0 auto;
  max-width: calc(100vw - 48px);
  border: 1px solid var(--hxc-line);
  background: #fff;
  color: var(--hxc-muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.hxc-tabs__btn.is-active {
  background: var(--hxc-blue);
  border-color: var(--hxc-blue);
  color: #fff;
}
.hxc-tabs__panels {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.hxc-panel {
  margin: 0 var(--hxc-pad);
  width: auto;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--hxc-line);
  border-radius: var(--hxc-radius);
  padding: 14px;
  overflow-wrap: anywhere;
}
.hxc-panel[hidden] { display: none !important; }
.hxc-panel > * { min-width: 0; max-width: 100%; }
.hxc-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #33465c;
  overflow-wrap: anywhere;
}
.hxc-more { margin-top: 8px; }
.hxc-more summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--hxc-blue);
}
.hxc-more p, .hxc-why {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #405468;
  white-space: pre-line;
}
.hxc-more h3 {
  margin: 10px 0 4px;
  font-size: 14px;
}
.hxc-highlights {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.hxc-highlights li {
  background: var(--hxc-soft);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
}

.hxc-video {
  margin-top: 12px;
  border: 1px solid var(--hxc-line);
  border-radius: 14px;
  overflow: hidden;
}
.hxc-video__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0b1b2e;
}
.hxc-video__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hxc-video__play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: #c62828;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.hxc-video__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
}
.hxc-video__meta strong { font-size: 13px; }
.hxc-video__meta a { font-size: 12px; font-weight: 700; color: var(--hxc-blue); }

.hxc-gallery__main {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #dbe5ef;
}
.hxc-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hxc-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.hxc-gallery__thumbs a {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #dbe5ef;
}
.hxc-gallery__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hxc-gallery__all {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.hxc-gallery__all a {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #dbe5ef;
}
.hxc-gallery__all img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hxc-slider {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hxc-slider::-webkit-scrollbar { display: none; }
.hxc-slide-card, .hxc-doc-card {
  flex: 0 0 72%;
  width: 72%;
  max-width: 72%;
  min-width: 0;
  scroll-snap-align: start;
  border: 1px solid var(--hxc-line);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}
.hxc-slide-card h3, .hxc-doc-card strong {
  margin: 0 0 6px;
  font-size: 14px;
}
.hxc-doc-card {
  display: grid;
  gap: 4px;
}
.hxc-doc-card img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}
.hxc-doc-card span { font-size: 12px; color: var(--hxc-muted); }

.hxc-svc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.hxc-svc {
  border: 1px solid var(--hxc-line);
  border-radius: 12px;
  padding: 10px 8px;
  display: grid;
  gap: 4px;
  background: #fff;
}
.hxc-svc span { color: var(--hxc-blue); font-size: 11px; }
.hxc-svc strong { font-size: 12px; line-height: 1.3; }
.hxc-sub { margin: 12px 0 6px; font-size: 14px; }
.hxc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hxc-chips span {
  background: var(--hxc-soft);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 600;
}

.hxc-verify { display: grid; gap: 8px; font-size: 13px; }
.hxc-acc {
  border: 1px solid var(--hxc-line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 3px;
}
.hxc-acc a { color: var(--hxc-blue); font-weight: 700; font-size: 12px; }
.hxc-addr { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.hxc-note, .hxc-micro, .hxc-empty {
  margin: 0;
  font-size: 12px;
  color: var(--hxc-muted);
  line-height: 1.45;
}
.hxc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.hxc-links a {
  border: 1px solid var(--hxc-line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hxc-blue-deep);
  text-decoration: none;
}
.hxc-textbtn {
  display: inline-flex;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--hxc-blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

/* REVIEW CTA */
.hxc-review {
  margin: 10px var(--hxc-pad) 8px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--hxc-line);
  border-radius: var(--hxc-radius);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
  align-items: center;
  overflow: hidden;
}
@media (max-width: 380px) {
  .hxc-review {
    grid-template-columns: minmax(0, 1fr) 88px;
  }
  .hxc-review__actions { grid-template-columns: minmax(0, 1fr); }
}
.hxc-review h2 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.25;
}
.hxc-review p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--hxc-muted);
  line-height: 1.4;
}
.hxc-review__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.hxc-review__copy,
.hxc-review__photo { min-width: 0; max-width: 100%; }
.hxc-review__photo {
  border-radius: 14px;
  overflow: hidden;
  background: var(--hxc-soft);
  aspect-ratio: 3 / 4;
  max-height: 140px;
  align-self: stretch;
}
.hxc-review__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hxc-related {
  padding: 4px var(--hxc-pad) 12px;
  width: 100%;
  max-width: 100%;
}
.hxc-related h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.hxc-related__track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.hxc-related__card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--hxc-line);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.hxc-related__card img {
  width: 100%;
  height: 78px;
  object-fit: cover;
}
.hxc-related__card span {
  display: block;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* BOTTOM SHEET */
.hxc-sheet[hidden] { display: none !important; }
.hxc-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
}
.hxc-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 16, 28, .55);
}
.hxc-sheet__panel {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  max-height: min(88vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
.hxc-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.hxc-sheet__head h2 { margin: 0; font-size: 16px; }
.hxc-sheet__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  font-size: 22px;
  cursor: pointer;
}
.hxc-form { display: grid; gap: 8px; }
.hxc-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.hxc-form input,
.hxc-form select,
.hxc-form textarea {
  width: 100%;
  border: 1px solid var(--hxc-line);
  border-radius: 11px;
  padding: 10px;
  font: inherit;
}
.hxc-check {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500 !important;
}
.hxc-check input { width: auto; margin-top: 2px; }
.hxc-honeypot {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
}

/* Lightbox */
.hxc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(5, 12, 24, .94);
  display: grid;
  place-items: center;
  padding: 12px;
}
.hxc-lightbox[hidden] { display: none !important; }
.hxc-lightbox img {
  max-width: 96vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
}
.hxc-lightbox__close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  cursor: pointer;
}
body.hxc-sheet-open,
body.hxc-lightbox-open { overflow: hidden; }

@media (min-width: 768px) {
  .hospital-detail-shell,
  .hxc {
    max-width: 1180px;
    margin-inline: auto;
    padding-bottom: 24px;
    border-inline: 1px solid var(--hxc-line);
    min-height: 100vh;
  }
  .hxc-hero__media { height: 280px; }
  .hxc-facts__track {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .hxc-tabs__nav { top: 64px; }
  .hxc-review { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .hxc-related__track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hxc-sheet__panel {
    inset-inline: 50%;
    transform: translateX(-50%);
    width: min(560px, 92vw);
    max-width: min(560px, 92vw);
    bottom: 24px;
    border-radius: 18px;
    max-height: 80vh;
  }
  [dir="rtl"] .hxc-sheet__panel { transform: translateX(50%); }
}

@media (max-width: 767px) {
  body.page-hospital-detail,
  .hospital-detail-page,
  .hospital-detail-shell,
  .hxc {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .hxc-hero__cta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hxc-gallery__thumbs,
  .hxc-gallery__all {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .hxc-hero__cta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hxc-hero__cta .hxc-btn--link { grid-column: 1 / -1; }
  .hxc-facts__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hxc-review { grid-template-columns: minmax(0, 1fr); }
  .hxc-review__photo { max-height: 120px; aspect-ratio: 16 / 7; }
}
