/* =============================================================================
 *  MediFind — main public stylesheet
 *  Theme: trust-first healthcare. Teal + soft mint + clean cards + slim shadows.
 * ============================================================================*/

:root {
  --mf-bg:        #f4fbf9;
  --mf-surface:   #ffffff;
  --mf-surface-2: #f7fafa;
  --mf-ink:       #0d2c3a;
  --mf-ink-soft:  #2a4a59;
  --mf-muted:     #5e7b88;
  --mf-line:      #d8e8e5;
  --mf-line-soft: #ecf3f2;
  --mf-brand:     #0f8d8a;
  --mf-brand-d:   #0a6663;
  --mf-brand-l:   #c7eeec;
  --mf-accent:    #1aaf6c;
  --mf-warn:      #c1592a;
  --mf-shadow:    0 14px 34px rgba(20, 54, 73, 0.07);
  --mf-shadow-sm: 0 6px 18px -10px rgba(20, 54, 73, 0.18);
  --mf-radius:    14px;
  --mf-radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--mf-ink);
  background: linear-gradient(180deg, #ffffff, #f4fbf9 220px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--mf-brand-d); text-decoration: none; }
a:hover { color: var(--mf-brand); }

img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: Merriweather, Manrope, serif; color: var(--mf-ink); margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.6rem); line-height: 1.15; }
h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); margin-bottom: .6rem; }
h3 { font-size: 1.1rem; }
p  { line-height: 1.6; color: var(--mf-ink-soft); margin: .35rem 0; }

/* ---------- Buttons & form basics ---------- */
.mf-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  background: linear-gradient(120deg, var(--mf-brand), var(--mf-accent));
  color: #fff; font-weight: 700; padding: .72rem 1.15rem; border-radius: 10px;
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 6px 18px -10px rgba(15, 141, 138, .55);
}
.mf-btn:hover { transform: translateY(-1px); color: #fff; }
.mf-btn--outline { background: #fff; color: var(--mf-brand-d); border: 1.5px solid var(--mf-brand); box-shadow: none; }
.mf-btn--outline:hover { background: var(--mf-brand); color: #fff; }
.mf-btn--ghost { background: transparent; color: var(--mf-brand-d); box-shadow: none; }
.mf-btn--warn { background: linear-gradient(120deg, #f97316, #ef4444); }
.mf-btn--block { width: 100%; justify-content: center; }
.mf-btn--sm { padding: .45rem .85rem; font-size: .85rem; }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=url], input[type=search], textarea, select {
  width: 100%; padding: .72rem .9rem; font: inherit;
  border: 1px solid var(--mf-line); border-radius: var(--mf-radius-sm);
  background: #fff; color: var(--mf-ink); transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--mf-brand);
  box-shadow: 0 0 0 3px rgba(15,141,138,.18);
}
label { display: block; font-size: .8rem; font-weight: 700; color: var(--mf-ink-soft); margin-bottom: .35rem; letter-spacing: .02em; }

/* ---------- Topbar ---------- */
.mf-topbar { position: sticky; top: 0; z-index: 46; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--mf-line); transition: transform .28s ease, box-shadow .28s ease; }
.mf-topbar__inner { max-width: 1240px; margin: 0 auto; padding: .85rem 1.25rem; display: flex; align-items: center; gap: 1rem; position: relative; }
.mf-brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.4rem; font-weight: 800; color: var(--mf-ink); }
.mf-brand i { color: var(--mf-brand); font-size: 1.5rem; }
.mf-brand b { color: var(--mf-brand); font-weight: 800; }
.mf-brand--light { color: #fff; } .mf-brand--light b { color: #c7eeec; }
.mf-nav { display: flex; gap: .25rem; margin-left: auto; }
.mf-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem; border-radius: 10px; color: var(--mf-ink-soft); font-weight: 600; }
.mf-nav a:hover { background: var(--mf-brand-l); color: var(--mf-brand-d); }
.mf-nav a i { font-size: .85rem; opacity: .75; }
.mf-topbar__actions { display: flex; align-items: center; gap: .4rem; margin-left: 1rem; }
.mf-topbar__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: var(--mf-ink-soft); background: var(--mf-surface-2); }
.mf-topbar__icon:hover { background: var(--mf-brand-l); color: var(--mf-brand-d); }
.mf-userchip { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem; border-radius: 10px; background: var(--mf-surface-2); color: var(--mf-ink); cursor: pointer; font-weight: 700; }
.mf-userchip i { color: var(--mf-brand); }
.mf-userchip__menu { position: absolute; top: calc(100% + 6px); right: 0; background: #fff; border: 1px solid var(--mf-line); border-radius: 12px; min-width: 220px; box-shadow: var(--mf-shadow); padding: 6px; opacity: 0; pointer-events: none; transform: translateY(4px); transition: .15s; z-index: 50; }
.mf-userchip:hover .mf-userchip__menu,
.mf-userchip.is-open .mf-userchip__menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mf-userchip__menu a { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border-radius: 8px; color: var(--mf-ink); font-weight: 600; font-size: .92rem; }
.mf-userchip__menu a:hover { background: var(--mf-surface-2); }
.mf-burger { display: none; background: transparent; border: 0; font-size: 1.4rem; color: var(--mf-ink); padding: .35rem .55rem; }

/* ---------- Hero ---------- */
.mf-hero { padding: 3rem 1.25rem 1.5rem; }
.mf-hero__inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.2rem; align-items: center; }
.mf-hero__eyebrow { display: inline-flex; align-items: center; gap: .4rem; background: var(--mf-brand-l); color: var(--mf-brand-d); padding: .35rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .9rem; }
.mf-hero__h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.1; margin-bottom: .9rem; }
.mf-hero__h1 span { color: var(--mf-brand); }
.mf-hero__lede { font-size: 1.05rem; color: var(--mf-ink-soft); max-width: 36rem; }
.mf-hero__cta { margin-top: 1.4rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.mf-hero__chip { display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--mf-line); padding: .35rem .65rem; border-radius: 999px; color: var(--mf-ink-soft); font-size: .8rem; font-weight: 600; }
.mf-hero__chip i { color: var(--mf-brand); }

/* Sticky search card */
.mf-searchcard { background: #fff; border: 1px solid var(--mf-line); border-radius: 18px; padding: 1.1rem; box-shadow: var(--mf-shadow); }
.mf-searchcard h3 { font-family: Manrope; font-size: 1.05rem; margin-bottom: .8rem; color: var(--mf-ink); }
.mf-searchcard h3 i { color: var(--mf-brand); margin-right: .35rem; }
.mf-search-tabs { display: flex; gap: .3rem; margin-bottom: .8rem; flex-wrap: wrap; }
.mf-search-tabs button { flex: 1; background: var(--mf-surface-2); border: 1px solid var(--mf-line); padding: .55rem .6rem; border-radius: 10px; color: var(--mf-ink-soft); font-weight: 700; font-size: .82rem; cursor: pointer; transition: .15s; }
.mf-search-tabs button.is-active { background: var(--mf-brand); color: #fff; border-color: var(--mf-brand); }
.mf-search-row { display: grid; gap: .55rem; }
.mf-search-row .mf-input { position: relative; }
.mf-search-row .mf-input i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mf-muted); font-size: .9rem; }
.mf-search-row .mf-input input, .mf-search-row .mf-input select { padding-left: 38px; }

/* ---------- Section container ---------- */
.mf-section { max-width: 1240px; margin: 0 auto; padding: 2.4rem 1.25rem; }
.mf-section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.mf-section__title { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.mf-section__sub { color: var(--mf-muted); margin-top: .15rem; }
.mf-section__more { color: var(--mf-brand-d); font-weight: 700; }

/* ---------- Specialization tiles ---------- */
.mf-specs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.mf-spec { background: #fff; border: 1px solid var(--mf-line); border-radius: var(--mf-radius); padding: 1rem; text-align: center; transition: .15s; box-shadow: var(--mf-shadow-sm); }
.mf-spec:hover { transform: translateY(-2px); border-color: var(--mf-brand); }
.mf-spec i { font-size: 1.6rem; color: var(--mf-brand); background: var(--mf-brand-l); width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; margin-bottom: .5rem; }
.mf-spec span { display: block; font-weight: 700; color: var(--mf-ink); font-size: .92rem; }

/* ---------- Cards (universal card layout) ---------- */
.mf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.mf-card { background: #fff; border: 1px solid var(--mf-line); border-radius: var(--mf-radius); overflow: hidden; box-shadow: var(--mf-shadow-sm); display: flex; flex-direction: column; transition: .15s; }
.mf-card:hover { transform: translateY(-2px); border-color: var(--mf-brand-l); }
.mf-card__media { position: relative; aspect-ratio: 1.4; background: var(--mf-surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mf-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mf-card__media .mf-badge { position: absolute; top: 10px; left: 10px; }
.mf-card__media .mf-fav { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.95); border: 0; padding: .45rem .55rem; border-radius: 999px; cursor: pointer; color: var(--mf-warn); }
.mf-card__body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.mf-card__title { font-family: Manrope; font-size: 1.05rem; font-weight: 800; color: var(--mf-ink); line-height: 1.25; margin: 0; }
.mf-card__sub  { color: var(--mf-muted); font-size: .85rem; }
.mf-card__meta { color: var(--mf-ink-soft); font-size: .88rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.mf-card__meta i { color: var(--mf-brand); margin-right: .25rem; }
.mf-card__price { font-weight: 800; font-size: 1.1rem; color: var(--mf-ink); }
.mf-card__price del { color: var(--mf-muted); font-weight: 500; font-size: .85rem; margin-left: .35rem; }
.mf-card__rating { display: inline-flex; align-items: center; gap: .35rem; background: #ecfdf5; color: #047857; padding: .15rem .55rem; border-radius: 6px; font-weight: 700; font-size: .82rem; }
.mf-card__actions { display: flex; gap: .4rem; padding: .6rem 1rem 1rem; border-top: 1px dashed var(--mf-line-soft); flex-wrap: wrap; }
.mf-card__actions .mf-btn { flex: 1; justify-content: center; }
.mf-card__actions .mf-btn--sm { padding: .55rem .7rem; }

/* Badges */
.mf-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.mf-badge--verified { background: #dcfce7; color: #166534; }
.mf-badge--featured { background: #fef3c7; color: #92400e; }
.mf-badge--premium  { background: #ede9fe; color: #5b21b6; }
.mf-badge--rx       { background: #fee2e2; color: #991b1b; }
.mf-badge--rent     { background: #e0f2fe; color: #075985; }
.mf-badge--free     { background: #dcfce7; color: #166534; }

/* Stars */
.stars { color: #f59e0b; font-size: .9rem; }

/* ---------- Filters bar (listing pages) ---------- */
.mf-filters { background: #fff; border: 1px solid var(--mf-line); border-radius: 14px; padding: 1rem; box-shadow: var(--mf-shadow-sm); margin-bottom: 1.5rem; }
.mf-filters__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr) auto; gap: .55rem; }
.mf-filters .mf-input { position: relative; }
.mf-filters .mf-input i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mf-muted); }
.mf-filters .mf-input input, .mf-filters .mf-input select { padding-left: 36px; }

.mf-list-empty { background: #fff; border: 1px dashed var(--mf-line); border-radius: var(--mf-radius); padding: 2.5rem; text-align: center; color: var(--mf-muted); }

/* ---------- Pagination ---------- */
.mf-pager { display: flex; justify-content: center; gap: .35rem; margin: 2rem 0; flex-wrap: wrap; }
.mf-pager a, .mf-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 .8rem; border: 1px solid var(--mf-line); border-radius: 8px; background: #fff; color: var(--mf-ink-soft); font-weight: 700; }
.mf-pager .is-active { background: var(--mf-brand); color: #fff; border-color: var(--mf-brand); }

/* ---------- Detail page ---------- */
.mf-detail { max-width: 1240px; margin: 0 auto; padding: 2rem 1.25rem; display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.mf-detail__card { background: #fff; border: 1px solid var(--mf-line); border-radius: 16px; padding: 1.5rem; box-shadow: var(--mf-shadow-sm); margin-bottom: 1.25rem; }
.mf-detail__head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.mf-detail__avatar { width: 130px; height: 130px; border-radius: 16px; border: 1px solid var(--mf-line); overflow: hidden; background: var(--mf-surface-2); flex: 0 0 auto; }
.mf-detail__avatar img { width: 100%; height: 100%; object-fit: cover; }
.mf-detail__info { flex: 1; min-width: 0; }
.mf-detail__title { font-family: Merriweather; font-size: clamp(1.25rem, 4vw, 1.7rem); line-height: 1.25; margin-bottom: .25rem; word-break: break-word; }
.mf-detail__subtitle { color: var(--mf-brand-d); font-weight: 700; }
.mf-detail__meta { color: var(--mf-ink-soft); display: flex; gap: 1rem; flex-wrap: wrap; margin: .6rem 0; }
.mf-detail__meta span { display: inline-flex; align-items: center; gap: .35rem; }
.mf-detail__meta i { color: var(--mf-brand); }
.mf-detail__price { font-size: 1.5rem; font-weight: 800; color: var(--mf-ink); }
.mf-detail__price del { color: var(--mf-muted); font-weight: 500; font-size: 1rem; margin-left: .5rem; }
.mf-detail__actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

/* Profile page media blocks */
.mf-detail__media {
  flex: 0 0 220px;
  width: 220px;
  max-width: 100%;
  background: #f7fafa;
  border: 1px solid #d8e8e5;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mf-detail__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  box-sizing: border-box;
  display: block;
}
.mf-detail__avatar--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e6f4f3, #fff);
  border: 1px solid #c5e8e4;
}
.mf-detail__avatar--icon i { font-size: 2.4rem; color: var(--mf-brand); }
.mf-detail__affil { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.mf-detail__affil-logo {
  width: 80px; height: 80px; border-radius: 12px; border: 1px solid #d8e8e5;
  object-fit: contain; background: #f7fafa; flex: 0 0 auto;
}
.mf-detail__affil-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.mf-detail__sub-meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.mf-detail__carousel {
  display: flex; overflow-x: auto; gap: 1.1rem; padding-bottom: .8rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.mf-detail__carousel-card {
  flex: 0 0 min(280px, 85vw); scroll-snap-align: start;
  background: #fff; border: 1px solid var(--mf-line); border-radius: var(--mf-radius);
  overflow: hidden; box-shadow: var(--mf-shadow-sm); display: flex; flex-direction: column;
}
.mf-detail__carousel-card__head {
  padding: .7rem .8rem; background: linear-gradient(135deg, #e6f4f3 0%, #ffffff 100%);
  display: flex; align-items: center; gap: .4rem; border-bottom: 1px dashed var(--mf-line-soft);
}
.mf-detail__carousel-card__body {
  padding: .85rem; flex: 1; display: flex; flex-direction: column; gap: .35rem;
}
.mf-detail__carousel-card__title {
  font-family: Manrope; font-weight: 800; font-size: .95rem; color: var(--mf-ink);
  line-height: 1.3; display: block; text-decoration: none;
}
.mf-detail__carousel-card__price {
  margin-top: auto; padding-top: .5rem; display: flex; align-items: baseline; gap: .4rem;
}

.mf-tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--mf-line); margin-bottom: 1rem; }
.mf-tabs button { background: transparent; border: 0; padding: .65rem 1rem; color: var(--mf-muted); font: inherit; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; }
.mf-tabs button.is-active { color: var(--mf-brand-d); border-color: var(--mf-brand); }
.mf-tab { display: none; }
.mf-tab.is-active { display: block; }

.mf-reviews .mf-review { border-top: 1px solid var(--mf-line-soft); padding: 1rem 0; }
.mf-reviews .mf-review:first-child { border-top: 0; }
.mf-review__meta { color: var(--mf-muted); font-size: .82rem; }

/* Sidebar booking — detail pages only (not listing filter panels) */
.mf-detail > .mf-side,
.mf-detail__side {
  position: sticky; top: 88px;
  background: transparent; border: 0; padding: 0; box-shadow: none;
  display: block;
}
.mf-bookcard { background: linear-gradient(160deg, #ffffff, #f1faf9); border: 1px solid var(--mf-brand-l); border-radius: 16px; padding: 1.25rem; box-shadow: var(--mf-shadow); }
.mf-bookcard h3 { font-family: Manrope; font-size: 1.05rem; margin-bottom: .6rem; }
.mf-bookcard label { margin-top: .55rem; }
.mf-bookcard small { color: var(--mf-muted); }
.mf-bookcard__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }
.mf-bookcard__price strong { font-size: clamp(1.35rem, 4vw, 1.6rem); color: var(--mf-brand-d); font-family: Manrope; }

/* ---------- Banner strip ---------- */
.mf-banners { max-width: 1240px; margin: 0 auto; padding: 1rem 1.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mf-banners a { background: linear-gradient(135deg, var(--mf-brand), var(--mf-accent)); color: #fff; padding: 1.1rem 1.2rem; border-radius: 14px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: .5rem; box-shadow: var(--mf-shadow-sm); }
.mf-banners a:nth-child(2) { background: linear-gradient(135deg, #0f8d8a, #2563eb); }
.mf-banners a:nth-child(3) { background: linear-gradient(135deg, #ef4444, #f97316); }
.mf-banners a i { font-size: 1.6rem; opacity: .9; }

/* ---------- Trust strip ---------- */
.mf-trust { background: var(--mf-surface-2); border-top: 1px solid var(--mf-line); border-bottom: 1px solid var(--mf-line); }
.mf-trust__inner { max-width: 1240px; margin: 0 auto; padding: 1.4rem 1.25rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.mf-trust__item { display: flex; gap: .85rem; align-items: center; }
.mf-trust__item i { font-size: 1.4rem; color: var(--mf-brand); background: var(--mf-brand-l); width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.mf-trust__item strong { display: block; font-size: 1rem; color: var(--mf-ink); }
.mf-trust__item small { color: var(--mf-muted); }

/* ---------- Feature grid ---------- */
.mf-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.mf-feature { background: #fff; border: 1px solid var(--mf-line); border-radius: 14px; padding: 1.1rem; box-shadow: var(--mf-shadow-sm); }
.mf-feature i { font-size: 1.3rem; color: var(--mf-brand); background: var(--mf-brand-l); width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .5rem; }
.mf-feature h3 { font-family: Manrope; font-size: 1rem; margin-bottom: .25rem; }
.mf-feature p { color: var(--mf-muted); font-size: .9rem; }

/* ---------- SEO link chips ---------- */
.mf-seo-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.mf-seo-chips a { background: #fff; border: 1px solid var(--mf-line); padding: .45rem .8rem; border-radius: 10px; color: var(--mf-ink); font-size: .85rem; font-weight: 600; }
.mf-seo-chips a:hover { background: var(--mf-brand-l); color: var(--mf-brand-d); }

/* ---------- Footer ---------- */
.mf-footer {
  background: linear-gradient(180deg, #0d2c3a 0%, #0a212c 100%);
  color: #c4d6df;
  margin-top: 3rem;
}
.mf-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.4rem 1.25rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 1.25rem;
  align-items: start;
}
.mf-footer__col--brand { grid-column: 1 / -1; }
.mf-footer__tagline { color: #9fb8c5; font-size: .92rem; line-height: 1.55; margin: .65rem 0 0; max-width: 36rem; }
.mf-footer__col h4 {
  color: #fff;
  margin: 0 0 .85rem;
  font-size: .95rem;
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: .02em;
}
.mf-footer__links { display: flex; flex-direction: column; gap: .15rem; }
.mf-footer__col a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #b8cdd8;
  padding: .28rem 0;
  font-size: .9rem;
  line-height: 1.35;
  transition: color .15s ease;
}
.mf-footer__col a i { color: #6fb6b4; width: 1.05em; text-align: center; flex-shrink: 0; font-size: .82rem; }
.mf-footer__col a:hover { color: #fff; }
.mf-social { margin-top: 1rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.mf-social a {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
  transition: background .15s ease, border-color .15s ease;
}
.mf-social a:hover { background: var(--mf-brand); border-color: var(--mf-brand); color: #fff; }
.mf-footer__legal {
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  padding: 1.1rem 1.25rem 1.25rem;
  color: #9fb8c5;
  font-size: .82rem;
  line-height: 1.6;
}
.mf-footer__copy { margin: 0 0 .55rem; color: #c4d6df; font-weight: 700; font-size: .88rem; }
.mf-footer__disclaimer { margin: 0 auto; max-width: 720px; }
.mf-footer__disclaimer a { color: #6fb6b4; text-decoration: underline; text-underline-offset: 2px; }
.mf-footer__disclaimer a:hover { color: #c7eeec; }

/* Desktop footer — balanced 5-column row */
@media (min-width: 900px) {
  .mf-footer__inner {
    grid-template-columns: minmax(260px, 1.35fr) repeat(4, minmax(0, 1fr));
    gap: 2.5rem 2rem;
    padding: 3rem 1.5rem 1.75rem;
  }
  .mf-footer__col--brand {
    grid-column: auto;
    padding-right: 1rem;
    border-right: 1px solid rgba(255,255,255,.08);
  }
  .mf-footer__col h4 {
    position: relative;
    padding-bottom: .65rem;
    margin-bottom: .95rem;
  }
  .mf-footer__col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: var(--mf-brand);
  }
  .mf-footer__col:not(.mf-footer__col--brand) {
    padding-top: .15rem;
  }
  .mf-footer__links { gap: .05rem; }
  .mf-footer__col a { padding: .32rem 0; }
  .mf-footer__legal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    padding: 1.15rem 1.5rem 1.35rem;
  }
  .mf-footer__copy { margin: 0; }
  .mf-footer__disclaimer { max-width: 860px; }
}

/* ---------- Floating WhatsApp ---------- */
.mf-fab { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #25d366; color: #fff; box-shadow: 0 14px 28px rgba(37,211,102,.42); z-index: 60; font-size: 1.6rem; }
.mf-fab:hover { color: #fff; transform: scale(1.05); }

/* ---------- Auth pages ---------- */
.mf-auth { max-width: 480px; margin: 2.5rem auto; background: #fff; border: 1px solid var(--mf-line); border-radius: 16px; padding: 2rem; box-shadow: var(--mf-shadow); }
.mf-auth h1 { font-family: Manrope; font-size: 1.5rem; margin-bottom: .5rem; }
.mf-auth__lede { color: var(--mf-muted); margin: 0 0 1.4rem; font-size: .95rem; }
.mf-auth p { color: var(--mf-muted); margin-bottom: 1rem; }
.mf-auth label { display: block; font-size: .85rem; font-weight: 700; color: var(--mf-ink); margin: .8rem 0 .3rem; }
.mf-auth input { width: 100%; padding: .7rem .85rem; border: 1px solid var(--mf-line); border-radius: 10px; background: #fff; font-size: .95rem; font-family: inherit; color: var(--mf-ink); outline: none; transition: .15s; box-sizing: border-box; }
.mf-auth input:focus { border-color: var(--mf-brand); box-shadow: 0 0 0 3px var(--mf-brand-l); }
.mf-auth__hint { display: block; color: var(--mf-muted); font-size: .78rem; margin-top: .3rem; line-height: 1.4; }
.mf-auth .mf-btn { width: 100%; justify-content: center; }
.mf-auth__alt { text-align: center; margin-top: 1.2rem; color: var(--mf-muted); }
.mf-auth__note { display: flex; gap: .6rem; align-items: flex-start; margin: 1.1rem 0 0; padding: .8rem 1rem; background: var(--mf-line-soft); border-radius: 10px; font-size: .85rem; color: var(--mf-ink-soft); line-height: 1.5; }
.mf-auth__note i { color: var(--mf-brand); margin-top: .15rem; flex-shrink: 0; }

.mf-side-note { margin-top: 1rem; padding: .7rem .85rem; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; color: #7c2d12; font-size: .8rem; line-height: 1.45; }
.mf-side-note strong { display: block; color: #9a3412; margin-bottom: .2rem; }
.mf-side-note p { color: #9a3412; margin: 0; font-size: .78rem; }
.mf-side-note i { margin-right: .25rem; }

/* =============================================================================
 *  Doctor profile — admin-managed sections (SEO content, FAQs, reviews)
 * ============================================================================*/
.mf-section-card { margin-top: 1rem; }
.mf-section-card__title { font-family: Manrope; font-size: 1.1rem; margin: 0 0 .8rem; display: flex; align-items: baseline; gap: .5rem; color: var(--mf-ink); }
.mf-section-card__title i { color: var(--mf-brand); font-size: 1rem; }

/* SEO "Read more" */
.mf-seo-card__body { font-size: .95rem; line-height: 1.7; color: var(--mf-ink-soft); }
.mf-rm__dots { color: var(--mf-muted); margin-left: .15rem; }
.mf-rm__btn { background: none; border: 0; color: var(--mf-brand-d); font-weight: 700; cursor: pointer; padding: .6rem 0 0; display: inline-flex; align-items: center; gap: .35rem; font-size: .92rem; font-family: inherit; }
.mf-rm__btn:hover { color: var(--mf-brand); }
.mf-rm__btn i { transition: transform .2s; }
.mf-rm__btn[aria-expanded="true"] i { transform: rotate(180deg); }
.mf-listing-intro { margin: 0 0 1.4rem; }

/* FAQ accordion (uses native <details>) */
.mf-faq { display: flex; flex-direction: column; gap: .55rem; }
.mf-faq__item { background: var(--mf-line-soft); border: 1px solid var(--mf-line); border-radius: 12px; padding: 0; transition: .15s; overflow: hidden; }
.mf-faq__item[open] { background: #fff; border-color: var(--mf-brand-l); box-shadow: var(--mf-shadow-sm); }
.mf-faq__q { cursor: pointer; list-style: none; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-weight: 700; color: var(--mf-ink); font-size: .96rem; }
.mf-faq__q::-webkit-details-marker { display: none; }
.mf-faq__chev { color: var(--mf-brand); transition: transform .2s; font-size: .85rem; }
.mf-faq__item[open] .mf-faq__chev { transform: rotate(180deg); }
.mf-faq__a { padding: 0 1rem 1rem; color: var(--mf-ink-soft); line-height: 1.6; font-size: .92rem; }

/* Customer reviews list polish */
.mf-review-list { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1rem; }
.mf-review { background: var(--mf-line-soft); border-left: 3px solid var(--mf-brand); border-radius: 8px; padding: .8rem 1rem; }
.mf-review__head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.mf-review__head strong { color: var(--mf-ink); font-size: .98rem; }
.mf-review__stars { color: #f59e0b; }
.mf-review__meta { color: var(--mf-muted); font-size: .78rem; margin-top: .15rem; }
.mf-review-form { margin-top: 1.2rem; border-top: 1px solid var(--mf-line); padding-top: 1rem; }
.mf-review-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mf-review-form input, .mf-review-form select, .mf-review-form textarea { width: 100%; padding: .6rem .8rem; border: 1px solid var(--mf-line); border-radius: 10px; font-family: inherit; font-size: .92rem; outline: none; box-sizing: border-box; }
.mf-review-form input:focus, .mf-review-form select:focus, .mf-review-form textarea:focus { border-color: var(--mf-brand); box-shadow: 0 0 0 3px var(--mf-brand-l); }
.mf-review-form textarea { min-height: 90px; resize: vertical; }

/* Admin doctor-edit: repeatable rows (FAQs) */
.mf-rows { display: flex; flex-direction: column; gap: .6rem; margin: .4rem 0 .8rem; }
.mf-rows__row { display: grid; grid-template-columns: 36px 1fr 36px; align-items: start; gap: .6rem; background: #f7fafa; border: 1px solid var(--mf-line); border-radius: 12px; padding: .6rem; }
.mf-rows__handle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--mf-brand-l); color: var(--mf-brand-d); font-weight: 800; font-family: Manrope; }
.mf-rows__fields { display: flex; flex-direction: column; gap: .35rem; }
.mf-rows__fields input, .mf-rows__fields textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--mf-line); border-radius: 8px; font-family: inherit; font-size: .9rem; outline: none; box-sizing: border-box; background: #fff; }
.mf-rows__fields input:focus, .mf-rows__fields textarea:focus { border-color: var(--mf-brand); box-shadow: 0 0 0 3px var(--mf-brand-l); }
.mf-rows__del { background: #fee2e2; color: #991b1b; border: 0; border-radius: 8px; cursor: pointer; height: 36px; padding: 0 .6rem; align-self: start; }
.mf-rows__del:hover { background: #fecaca; }

/* =============================================================================
 *  Practo-style appointment booking modal
 * ============================================================================*/
.mf-bookcard__fee { margin-top: .6rem; font-family: Manrope; font-size: 1.3rem; font-weight: 800; color: var(--mf-brand-d); }
.mf-bookcard__fee span { font-size: .8rem; font-weight: 600; color: var(--mf-muted); margin-left: .25rem; }
.mf-bookcard__legal { margin-top: .8rem; color: var(--mf-muted); font-size: .82rem; line-height: 1.4; }

.mf-bookm { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: mf-bookm-in .18s ease-out; }
.mf-bookm[hidden] { display: none; }
.mf-bookm__backdrop { position: absolute; inset: 0; background: rgba(7, 30, 38, .55); backdrop-filter: blur(2px); }
.mf-bookm__sheet { position: relative; background: #fff; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; border-radius: 18px; box-shadow: 0 30px 80px rgba(7, 30, 38, .35); padding: 1.4rem 1.4rem 1.6rem; }
.mf-bookm__x { position: absolute; top: .7rem; right: .8rem; background: var(--mf-line-soft); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--mf-ink); font-size: 1rem; }
.mf-bookm__x:hover { background: var(--mf-line); }

.mf-bookm__head { display: flex; gap: .9rem; align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--mf-line); margin-bottom: 1rem; }
.mf-bookm__avatar { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--mf-line-soft); border: 1px solid var(--mf-line); flex: 0 0 auto; }
.mf-bookm__icon { width: 56px; height: 56px; border-radius: 14px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--mf-brand-l); color: var(--mf-brand-d); font-size: 1.5rem; }
.mf-bookm__head--lab { padding-bottom: .75rem; }

/* Admin: per-SEO-page doctor curation rows ---------------------------------*/
.mf-curate-row { display: grid; grid-template-columns: 56px 1fr auto auto auto; gap: .8rem; align-items: center; padding: .65rem .8rem; background: #fff; border: 1px solid var(--mf-line); border-radius: 12px; margin-bottom: .5rem; transition: .15s; }
.mf-curate-row:hover { border-color: var(--mf-brand-l); box-shadow: 0 2px 8px rgba(7, 30, 38, .04); }
.mf-curate-row.is-pinned { background: #eafffd; border-color: #b8efe9; }
.mf-curate-row.is-hidden { background: #fef2f2; border-color: #fecaca; opacity: .85; }
.mf-curate-row__photo { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--mf-line-soft); }
.mf-curate-row__info { min-width: 0; }
.mf-curate-row__info strong { display: block; font-family: Manrope; font-weight: 700; color: var(--mf-ink); }
.mf-curate-row__opt { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .82rem; color: var(--mf-ink); cursor: pointer; min-width: 56px; }
.mf-curate-row__opt input[type="checkbox"] { transform: scale(1.1); accent-color: var(--mf-brand); cursor: pointer; }
.mf-curate-row__opt input[type="number"] { padding: .25rem .35rem; border: 1px solid var(--mf-line); border-radius: 6px; text-align: center; }
@media (max-width: 640px) {
  .mf-curate-row { grid-template-columns: 48px 1fr; row-gap: .4rem; }
  .mf-curate-row__opt { grid-column: span 1; flex-direction: row; min-width: 0; }
}
.mf-bookm__id { flex: 1; min-width: 0; }
.mf-bookm__name { font-family: Manrope; font-size: 1.15rem; font-weight: 800; color: var(--mf-ink); margin: 0; line-height: 1.25; }
.mf-bookm__sub { margin: .15rem 0 0; color: var(--mf-muted); font-size: .88rem; }
.mf-bookm__fee { margin-top: .35rem; font-family: Manrope; font-weight: 800; color: var(--mf-brand-d); font-size: 1.05rem; }
.mf-bookm__fee small { color: var(--mf-muted); font-weight: 500; font-size: .72rem; margin-left: .2rem; }

.mf-bookm__step { animation: mf-bookm-step .18s ease-out; }
.mf-bookm__steptitle { font-family: Manrope; font-size: 1rem; font-weight: 800; color: var(--mf-ink); margin: 0 0 .8rem; display: flex; align-items: center; gap: .55rem; }
.mf-bookm__num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mf-brand); color: #fff; font-size: .85rem; font-weight: 800; }

/* Date pills (next 7 days) */
.mf-bookm__dates { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem 0 .8rem; scroll-snap-type: x mandatory; }
.mf-bookm__dates::-webkit-scrollbar { height: 4px; }
.mf-bookm__dates::-webkit-scrollbar-thumb { background: var(--mf-line); border-radius: 4px; }
.mf-bookm__date { flex: 0 0 auto; min-width: 90px; padding: .6rem .7rem; background: var(--mf-line-soft); border: 1.5px solid transparent; border-radius: 12px; cursor: pointer; text-align: center; transition: .15s; scroll-snap-align: start; font-family: inherit; }
.mf-bookm__date:hover { background: #fff; border-color: var(--mf-brand-l); }
.mf-bookm__date[aria-selected="true"] { background: #fff; border-color: var(--mf-brand); box-shadow: 0 4px 12px rgba(15, 141, 138, .18); }
.mf-bookm__date[disabled] { opacity: .55; cursor: not-allowed; }
.mf-bookm__date-day { display: block; font-weight: 700; color: var(--mf-ink); font-size: .88rem; }
.mf-bookm__date-num { display: block; font-size: .75rem; color: var(--mf-muted); margin-top: .1rem; }
.mf-bookm__date-cnt { display: block; font-size: .68rem; margin-top: .25rem; padding: .12rem .35rem; border-radius: 999px; background: var(--mf-brand-l); color: var(--mf-brand-d); font-weight: 700; }
.mf-bookm__date-cnt--none { background: #fde2e2; color: #991b1b; }

/* Slot grid */
.mf-bookm__slots { padding-top: .4rem; }
.mf-bookm__slot-group { margin-top: .8rem; }
.mf-bookm__slot-group-title { font-family: Manrope; font-size: .82rem; font-weight: 700; color: var(--mf-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .45rem; display: flex; align-items: center; gap: .35rem; }
.mf-bookm__slot-group-title i { color: var(--mf-brand); }
.mf-bookm__slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .4rem; }
.mf-bookm__slot { padding: .5rem .3rem; background: #fff; border: 1.5px solid var(--mf-line); border-radius: 9px; cursor: pointer; font-weight: 600; font-family: inherit; color: var(--mf-ink); font-size: .88rem; transition: .12s; }
.mf-bookm__slot:hover { border-color: var(--mf-brand); color: var(--mf-brand-d); background: var(--mf-brand-l); }
.mf-bookm__slot[aria-pressed="true"] { background: var(--mf-brand); border-color: var(--mf-brand); color: #fff; }
.mf-bookm__noslots { padding: 1.4rem; background: var(--mf-line-soft); border-radius: 12px; text-align: center; color: var(--mf-muted); font-size: .9rem; }
.mf-bookm__noslots i { color: #f59e0b; font-size: 1.2rem; display: block; margin-bottom: .4rem; }
.mf-bookm__loading { padding: 1rem; color: var(--mf-muted); text-align: center; font-size: .9rem; }
.mf-bookm__hint { background: var(--mf-brand-l); color: var(--mf-brand-d); padding: .55rem .8rem; border-radius: 9px; font-size: .85rem; margin: .6rem 0 0; }

/* Step 2 form */
.mf-bookm__chosen { background: var(--mf-brand-l); border-left: 3px solid var(--mf-brand); border-radius: 8px; padding: .55rem .8rem; margin: 0 0 .8rem; color: var(--mf-ink); font-weight: 600; font-size: .92rem; }
.mf-bookm__chosen strong { color: var(--mf-brand-d); }
.mf-bookm__form input, .mf-bookm__form select, .mf-bookm__form textarea { width: 100%; padding: .55rem .75rem; border: 1px solid var(--mf-line); border-radius: 10px; font-family: inherit; font-size: .92rem; outline: none; box-sizing: border-box; }
.mf-bookm__form input:focus, .mf-bookm__form select:focus, .mf-bookm__form textarea:focus { border-color: var(--mf-brand); box-shadow: 0 0 0 3px var(--mf-brand-l); }
.mf-bookm__form label { font-weight: 600; font-size: .82rem; color: var(--mf-ink-soft); display: block; margin: 0 0 .25rem; }
.mf-bookm__form textarea { min-height: 70px; resize: vertical; }
.mf-bookm__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.mf-bookm__actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.mf-bookm__formerr { background: #fee2e2; color: #991b1b; padding: .55rem .8rem; border-radius: 9px; font-size: .87rem; margin-top: .8rem; }
.mf-bookm__legal { margin-top: .8rem; color: var(--mf-muted); font-size: .8rem; }

/* Success step */
.mf-bookm__done { text-align: center; padding: 1.5rem .5rem 1rem; }
.mf-bookm__doneicon { font-size: 3.2rem; color: var(--mf-brand); margin-bottom: .8rem; animation: mf-bookm-pop .35s ease-out; }
.mf-bookm__doneh { font-family: Manrope; font-size: 1.25rem; font-weight: 800; color: var(--mf-ink); margin: 0 0 .4rem; }
.mf-bookm__donep { color: var(--mf-ink-soft); margin: 0 0 1rem; line-height: 1.55; }

@keyframes mf-bookm-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes mf-bookm-step { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mf-bookm-pop  { from { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.1); } to { transform: scale(1); opacity: 1; } }

@media (max-width: 600px) {
  .mf-bookm { padding: 0; align-items: flex-end; }
  .mf-bookm__sheet { max-width: 100%; max-height: 96vh; border-radius: 18px 18px 0 0; padding: 1.1rem 1rem 1.3rem; }
  .mf-bookm__grid { grid-template-columns: 1fr; }
}
body.mf-bookm-open { overflow: hidden; }

/* Provider: weekly schedule grid */
.mf-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--mf-line); }
.mf-week__day { background: #fff; padding: .8rem; min-height: 130px; display: flex; flex-direction: column; gap: .4rem; }
.mf-week__day--empty { background: #f7fafa; }
.mf-week__name { font-family: Manrope; font-weight: 800; font-size: .82rem; color: var(--mf-ink); text-transform: uppercase; letter-spacing: .04em; padding-bottom: .3rem; border-bottom: 1px dashed var(--mf-line); margin-bottom: .25rem; }
.mf-week__off { color: var(--mf-muted); font-size: .8rem; font-style: italic; padding: .35rem 0; }
.mf-week__slot { background: var(--mf-brand-l); border-left: 3px solid var(--mf-brand); padding: .35rem .5rem; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: .35rem; font-size: .82rem; }
.mf-week__slot strong { font-family: Manrope; color: var(--mf-brand-d); font-size: .88rem; }
.mf-week__del { background: transparent; border: 0; color: #991b1b; cursor: pointer; padding: .15rem .35rem; border-radius: 4px; opacity: .65; transition: .15s; }
.mf-week__del:hover { opacity: 1; background: #fee2e2; }

@media (max-width: 900px) {
  .mf-week { grid-template-columns: repeat(2, 1fr); }
}

/* Admin doctor-edit: section order picker */
.mf-order { display: flex; flex-direction: column; gap: .35rem; padding: .8rem; background: #f7fafa; border: 1px solid var(--mf-line); border-radius: 12px; max-width: 360px; }
.mf-order__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.mf-order__name { font-weight: 700; color: var(--mf-ink); font-size: .92rem; }
.mf-order__row input { padding: .4rem .55rem; border: 1px solid var(--mf-line); border-radius: 8px; font-family: inherit; text-align: center; font-weight: 700; }
.mf-order__row input:focus { border-color: var(--mf-brand); outline: none; box-shadow: 0 0 0 3px var(--mf-brand-l); }

/* ---------- Flash messages ---------- */
.mf-flash { max-width: 1240px; margin: 1rem auto -.5rem; padding: .8rem 1rem; border-radius: 10px; }
.mf-flash--success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.mf-flash--error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.mf-flash--info    { background: #e0f2fe; border: 1px solid #7dd3fc; color: #075985; }

/* ---------- Tables ---------- */
.mf-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--mf-line); border-radius: 12px; overflow: hidden; }
.mf-table th, .mf-table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--mf-line-soft); font-size: .92rem; }
.mf-table th { background: var(--mf-surface-2); font-weight: 800; color: var(--mf-ink); }
.mf-table tr:last-child td { border-bottom: 0; }
.mf-table .mf-badge { font-size: .68rem; }

/* ---------- Dashboard shell ---------- */
.mf-dash { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.mf-dash__side { background: #fff; border-right: 1px solid var(--mf-line); padding: 1.25rem 1rem; }
.mf-dash__side h4 { font-size: .75rem; text-transform: uppercase; color: var(--mf-muted); letter-spacing: .05em; margin: 1rem 0 .35rem; }
.mf-dash__side a { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; color: var(--mf-ink-soft); border-radius: 8px; font-weight: 600; }
.mf-dash__side a:hover { background: var(--mf-surface-2); }
.mf-dash__side a.is-active { background: var(--mf-brand); color: #fff; }
.mf-dash__side a.is-active i { color: #fff; }
.mf-dash__side a i { color: var(--mf-brand); width: 18px; text-align: center; }
.mf-dash__main { padding: 1.5rem 1.5rem 4rem; max-width: 1180px; }
.mf-dash__head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .75rem; }
.mf-dash__title { font-family: Manrope; font-size: 1.35rem; font-weight: 800; }
.mf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.mf-stat { background: #fff; border: 1px solid var(--mf-line); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--mf-shadow-sm); }
.mf-stat__label { color: var(--mf-muted); font-size: .82rem; }
.mf-stat__value { font-size: 1.6rem; font-weight: 800; color: var(--mf-ink); }
.mf-stat__icon  { float: right; color: var(--mf-brand); font-size: 1.4rem; }

/* ---------- Mobile responsive ---------- */
@media (max-width: 1024px) {
  .mf-hero__inner { grid-template-columns: 1fr; }
  .mf-detail { grid-template-columns: 1fr; }
  .mf-detail > .mf-side,
  .mf-detail__side { position: static; }
  .mf-specs { grid-template-columns: repeat(4, 1fr); }
  .mf-filters__grid { grid-template-columns: 1fr 1fr; }
  .mf-dash { grid-template-columns: 1fr; }
  .mf-dash__side { display: none; }
  body.mf-menu-open .mf-dash__side { display: block; }
  .mf-banners { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mf-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--mf-line); padding: .6rem; z-index: 45; max-height: calc(100dvh - 100%); overflow-y: auto; box-shadow: var(--mf-shadow); }
  body.mf-menu-open .mf-nav { display: flex; }
  .mf-burger { display: inline-flex; }
  .mf-specs { grid-template-columns: repeat(3, 1fr); }
  .mf-filters__grid { grid-template-columns: 1fr; }
  .mf-trust__inner { grid-template-columns: 1fr 1fr; }
  .mf-topbar__actions .mf-btn { padding: .55rem .8rem; font-size: .85rem; }
  .mf-detail__avatar { width: 90px; height: 90px; }
}
@media (max-width: 480px) {
  .mf-specs { grid-template-columns: repeat(2, 1fr); }
  .mf-cards { grid-template-columns: 1fr; }
  .mf-footer__legal { padding: 1rem .9rem 1.1rem; font-size: .78rem; }
  .mf-userchip span { display: none; }
}

/* =============================================================================
 *  Listing layout — left profile rows + right sticky filter sidebar
 * ============================================================================*/
.mf-listing__head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.mf-listing__title { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: .25rem; }
.mf-listing__sort  { display: flex; align-items: center; gap: .6rem; }
.mf-listing__toggle { display: none; }
.mf-sort-form { display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--mf-line); border-radius: 10px; padding: .25rem .65rem; box-shadow: var(--mf-shadow-sm); }
.mf-sort-form label { color: var(--mf-muted); font-size: .9rem; }
.mf-sort-form select { border: 0; background: transparent; font-weight: 700; color: var(--mf-ink); padding: .5rem .25rem; min-width: 150px; outline: none; cursor: pointer; }

.mf-listing { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.mf-listing__main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.mf-listing__side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }

/* Profile / listing card — vertical layout: icon/photo on top, details below */
.mf-prow {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  overflow: hidden;
  box-shadow: var(--mf-shadow-sm);
  transition: .18s;
  padding: 1.25rem;
  gap: 1.1rem;
  height: 100%;
}
.mf-prow:hover { transform: translateY(-2px); border-color: var(--mf-brand-l); box-shadow: var(--mf-shadow); }

.mf-prow__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  width: 100%;
}

.mf-prow__media {
  position: relative;
  width: 100px;
  height: 100px;
  min-width: 100px;
  min-height: 100px;
  flex-shrink: 0;
  border-radius: 18px !important;
  overflow: hidden;
  background: var(--mf-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--mf-shadow-sm);
  border: 2px solid var(--mf-line-soft);
}
.mf-prow__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-prow__media .mf-badge { position: absolute; top: 6px; left: 6px; font-size: .65rem; padding: .15rem .35rem; z-index: 2; border-radius: 6px; }
.mf-prow__media .mf-badge--featured { top: auto; bottom: 6px; left: 6px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.mf-prow__media .mf-fav { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.95); border: 0; padding: .35rem .45rem; border-radius: 999px; cursor: pointer; color: var(--mf-warn); z-index: 2; font-size: 0.8rem; }
.mf-prow__media .mf-badge--rx { top: 6px; left: 6px; font-weight: 800; background: #dc2626; color: #fff; border-radius: 6px; }
.mf-prow__media .mf-badge--rent { top: 6px; left: 6px; font-weight: 800; background: var(--mf-brand); color: #fff; border-radius: 6px; }

.mf-prow__header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
}

.mf-prow__body {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-width: 0;
  flex: 1;
  padding: 0;
}
.mf-prow__head { display: flex; align-items: center; flex-direction: column; gap: .35rem; }
.mf-prow__name { font-family: Manrope; font-size: 1.15rem; font-weight: 800; color: var(--mf-ink); line-height: 1.25; text-decoration: none; text-align: center; }
.mf-prow__name:hover { color: var(--mf-brand); }
.mf-prow__qual { color: var(--mf-muted); font-size: .85rem; font-weight: 600; text-align: center; }
.mf-prow__sub { color: var(--mf-ink-soft); font-size: .9rem; line-height: 1.4; text-align: center; }
.mf-prow__sub strong { color: var(--mf-brand-d); }
.mf-dot { color: var(--mf-muted); margin: 0 .25rem; }

.mf-prow__meta { display: flex; flex-wrap: wrap; gap: .45rem .7rem; color: var(--mf-ink-soft); font-size: .85rem; align-items: center; justify-content: center; }
.mf-prow__meta i { color: var(--mf-brand); margin-right: .2rem; }
.mf-prow__rating { font-weight: 700; color: var(--mf-ink); }
.mf-prow__rating small { color: var(--mf-muted); font-weight: 500; }

.mf-prow__chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; justify-content: center; }
.mf-chip { background: var(--mf-line-soft); color: var(--mf-ink-soft); border-radius: 999px; padding: .25rem .65rem; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.mf-chip i { color: var(--mf-brand); font-size: .82rem; }
.mf-prow__bio { color: var(--mf-muted); font-size: .88rem; margin: .15rem 0 0; line-height: 1.5; text-align: center; }

.mf-prow__details-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.mf-prow__cta {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  align-items: stretch;
  border-left: 0;
  border-top: 1px dashed var(--mf-line);
  padding: .9rem 0 0;
  margin-top: 0;
  width: 100%;
}
.mf-prow__price { text-align: center; padding: .55rem .65rem; background: var(--mf-line-soft); border-radius: 10px; margin-bottom: .15rem; }
.mf-prow__price small { display: block; color: var(--mf-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.mf-prow__price strong { display: block; font-size: 1.2rem; color: var(--mf-brand-d); font-family: Manrope; }
.mf-prow__cta .mf-btn { width: 100%; justify-content: center; font-size: .88rem; min-height: 48px; }

/* Sidebar filter card — listing pages only */
.mf-listing .mf-side {
  background: #fff;
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  padding: 1.1rem;
  box-shadow: var(--mf-shadow-sm);
  display: flex; flex-direction: column; gap: 1rem;
}
.mf-side__top { display: flex; align-items: center; justify-content: space-between; padding-bottom: .7rem; border-bottom: 1px solid var(--mf-line-soft); }
.mf-side__title { font-family: Manrope; font-size: 1.05rem; margin: 0; color: var(--mf-ink); }
.mf-side__title i { color: var(--mf-brand); margin-right: .35rem; }
.mf-side__clear { font-size: .82rem; color: var(--mf-warn); font-weight: 700; }
.mf-side__clear:hover { color: #8b3a18; }
.mf-side__group { display: flex; flex-direction: column; gap: .4rem; }
.mf-side__group > label { font-size: .82rem; font-weight: 700; color: var(--mf-ink); text-transform: uppercase; letter-spacing: .03em; }
.mf-side .mf-input { position: relative; }
.mf-side .mf-input i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mf-muted); font-size: .9rem; }
.mf-side .mf-input input,
.mf-side .mf-input select { width: 100%; padding: .65rem .75rem .65rem 34px; border: 1px solid var(--mf-line); border-radius: 10px; background: #fff; color: var(--mf-ink); font-size: .9rem; font-family: inherit; outline: none; transition: .15s; }
.mf-side .mf-input input:focus,
.mf-side .mf-input select:focus { border-color: var(--mf-brand); box-shadow: 0 0 0 3px var(--mf-brand-l); }

.mf-radios { display: flex; flex-direction: column; gap: .3rem; }
.mf-checks  { display: flex; flex-direction: column; gap: .3rem; }
.mf-checks .mf-radio span i { color: var(--mf-brand); margin-right: .25rem; }

/* =============================================================================
 *  Lab tests listing (clinic-style 2-col, each test is one row)
 * ============================================================================*/
.mf-lab-trust { display: flex; flex-wrap: wrap; gap: .65rem .9rem; padding: .65rem .9rem; margin-bottom: 1rem; background: linear-gradient(90deg, #e6f4f3, #f7fafa); border: 1px solid #d8e8e5; border-radius: 12px; }
.mf-lab-trust span { font-size: .82rem; color: var(--mf-ink); font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.mf-lab-trust span i { color: var(--mf-brand); }

.mf-prow--lab .mf-prow__media--lab { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 1rem .6rem; background: linear-gradient(135deg, #e6f4f3 0%, #ffffff 100%); }
.mf-lab-icon { width: 64px; height: 64px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(15, 141, 138, .18); display: flex; align-items: center; justify-content: center; color: var(--mf-brand); font-size: 1.7rem; margin-bottom: .35rem; }

.mf-lab-mrp { display: flex; gap: .4rem; align-items: baseline; margin-top: .2rem; }
.mf-lab-mrp del { color: var(--mf-muted); font-size: .82rem; }
.mf-lab-save { font-size: .72rem; font-weight: 800; background: #fef3c7; color: #92400e; padding: .12rem .4rem; border-radius: 999px; }

.mf-lab-add { display: block; cursor: pointer; user-select: none; }
.mf-lab-add input { position: absolute; opacity: 0; pointer-events: none; }
.mf-lab-add__label { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .8rem; border-radius: 10px; border: 1.5px solid var(--mf-brand); color: var(--mf-brand-d); background: #fff; font-weight: 700; font-size: .9rem; transition: .15s; text-align: center; }
.mf-lab-add__label:hover { background: var(--mf-brand-l); }
.mf-lab-add__tick { display: none; }
.mf-lab-add input:checked + .mf-lab-add__label { background: var(--mf-brand); color: #fff; border-color: var(--mf-brand); }
.mf-lab-add input:checked + .mf-lab-add__label .mf-lab-add__plus { display: none; }
.mf-lab-add input:checked + .mf-lab-add__label .mf-lab-add__tick { display: inline-block; }

/* Booking summary card */
.mf-lab-bookform { margin-top: 1.4rem; }
.mf-lab-sum { background: var(--mf-line-soft); border: 1px dashed var(--mf-line); border-radius: 12px; padding: .8rem 1rem; }
.mf-lab-sum__empty { color: var(--mf-muted); font-size: .92rem; }
.mf-lab-sum__list { display: flex; flex-direction: column; gap: .3rem; }
.mf-lab-sum__row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; border-bottom: 1px dashed var(--mf-line); font-size: .92rem; }
.mf-lab-sum__row:last-child { border-bottom: 0; }
.mf-lab-sum__row strong { color: var(--mf-ink); font-weight: 700; }
.mf-lab-sum__row small { color: var(--mf-muted); }
.mf-lab-sum__remove { background: transparent; border: 0; color: #991b1b; cursor: pointer; padding: 0 .3rem; opacity: .6; }
.mf-lab-sum__remove:hover { opacity: 1; }
.mf-lab-sum__total { margin-top: .55rem; padding-top: .55rem; border-top: 1.5px solid var(--mf-line); display: flex; justify-content: space-between; align-items: baseline; font-family: Manrope; }
.mf-lab-sum__total strong { font-size: 1.15rem; color: var(--mf-brand-d); font-weight: 800; }

/* Sticky bottom cart bar */
.mf-labcart { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 900; max-width: 600px; width: calc(100% - 2rem); animation: mf-labcart-in .3s ease-out; }
.mf-labcart[hidden] { display: none; }
.mf-labcart__inner { display: flex; align-items: center; gap: .8rem; padding: .65rem .85rem; background: #0f8d8a; color: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(7, 30, 38, .35); }
.mf-labcart__info { display: flex; flex-direction: column; }
.mf-labcart__info strong { font-family: Manrope; font-weight: 800; }
.mf-labcart__info small { font-size: .75rem; opacity: .85; }
.mf-labcart__total { margin-left: auto; font-family: Manrope; font-weight: 800; font-size: 1.1rem; }
.mf-labcart .mf-btn { background: #fff; color: var(--mf-brand-d); box-shadow: none; }
.mf-labcart .mf-btn:hover { background: #f7fafa; }

@keyframes mf-labcart-in { from { transform: translate(-50%, 60px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Room for sticky cart bar + WhatsApp FAB on lab/diagnostic listing pages */
body.mf-labcart-open { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
body.mf-labcart-open .mf-fab { bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
body.mf-menu-open { overflow: hidden; }
body.mf-menu-open .mf-topbar { transform: none !important; }
body.mf-menu-open .mf-topbar::before {
  content: ''; position: fixed; inset: 0; background: rgba(7, 30, 38, .35); z-index: 35;
}
.mf-radio { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; border-radius: 8px; cursor: pointer; font-size: .9rem; color: var(--mf-ink-soft); transition: .12s; }
.mf-radio:hover { background: var(--mf-line-soft); }
.mf-radio input { accent-color: var(--mf-brand); margin: 0; }
.mf-radio input:checked + span { color: var(--mf-brand-d); font-weight: 700; }

.mf-side__range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .4rem; }
.mf-side__range input { padding: .6rem .75rem; border: 1px solid var(--mf-line); border-radius: 10px; font-size: .9rem; font-family: inherit; color: var(--mf-ink); outline: none; }
.mf-side__range input:focus { border-color: var(--mf-brand); box-shadow: 0 0 0 3px var(--mf-brand-l); }
.mf-side__range .mf-range-dash { color: var(--mf-muted); text-align: center; }

.mf-side__apply { width: 100%; justify-content: center; margin-top: .25rem; }

/* List/grid view toggle (listing pages) */
.mf-listing-view {
  display: inline-flex; border: 1px solid var(--mf-line); border-radius: 10px; overflow: hidden;
}
.mf-listing-view__btn {
  background: #fff; border: 0; padding: .5rem .65rem; color: var(--mf-muted);
  cursor: pointer; font-size: .9rem; line-height: 1;
}
.mf-listing-view__btn.is-active { background: var(--mf-brand); color: #fff; }
.mf-listing-view__btn:hover:not(.is-active) { background: var(--mf-surface-2); color: var(--mf-brand-d); }

/* Grid view — multi-column card layout */
.mf-listing--grid .mf-listing__main,
.mf-listing--grid .mf-listing__main > div {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.mf-listing--grid .mf-prow__media { height: 156px; min-height: 156px; }

/* Responsive: tablet — narrow the side */
@media (max-width: 1080px) {
  .mf-listing { grid-template-columns: minmax(0, 1fr) 280px; }
}

/* Responsive: tablet portrait — collapse cta under body */
@media (max-width: 900px) {
  .mf-listing { grid-template-columns: 1fr; }
  .mf-listing__side { position: static; max-height: none; display: none; }
  body.mf-side-open { overflow: hidden; }
  body.mf-side-open::before {
    content: ''; position: fixed; inset: 0; background: rgba(7, 30, 38, .4); z-index: 44;
  }
  body.mf-side-open .mf-listing__side {
    display: block; position: fixed; top: 0; right: 0; bottom: 0;
    width: min(100%, 340px); z-index: 45; overflow-y: auto;
    max-height: none; margin: 0; border-radius: 0;
    box-shadow: -10px 0 40px rgba(7, 30, 38, .18);
    padding-top: calc(.5rem + env(safe-area-inset-top, 0px));
  }
  .mf-listing__toggle { display: inline-flex; }
}

/* Responsive: mobile — compact vertical listing cards */
@media (max-width: 768px) {
  .mf-prow__price {
    text-align: left;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    padding: .45rem .7rem;
  }
}

@media (max-width: 640px) {
  .mf-prow__price strong { font-size: 1.1rem; }
}


/* =============================================================================
 *  Full-site mobile-responsive layer
 *  Catches inline fixed grids, wide tables, the topbar and detail/commerce
 *  shells that the section-specific rules above don't cover.
 * ============================================================================*/

/* Stop any stray wide element from creating a horizontal scrollbar.
   overflow-x: clip keeps position: sticky working (unlike hidden). */
html, body { overflow-x: clip; max-width: 100%; }
img, svg, video, iframe, table, pre, canvas { max-width: 100%; }
.mf-hero__inner > div,
.mf-searchcard,
.mf-section,
.mf-banners,
.mf-topbar__inner { min-width: 0; }

/* Dashboard sidebar (admin / provider / account): these shells have no burger,
   so instead of hiding the nav on mobile, turn it into a horizontal scroll bar
   that's always reachable. Overrides the earlier `display:none` rule. */
@media (max-width: 1024px) {
  .mf-dash { grid-template-columns: 1fr; }
  .mf-dash__side {
    display: flex; flex-direction: row; flex-wrap: nowrap;
    align-items: center; gap: .4rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: .6rem .8rem;
    border-right: 0; border-bottom: 1px solid var(--mf-line);
    position: sticky; top: 57px; background: #fff; z-index: 5;
  }
  body.mf-menu-open .mf-dash__side { display: flex; }
  .mf-dash__side h4 { display: none; }
  .mf-dash__side strong,
  .mf-dash__side p { display: none; }
  .mf-dash__side a { flex: 0 0 auto; white-space: nowrap; }
  .mf-dash__main { padding: 1.1rem 1rem 3rem; }
}

@media (max-width: 760px) {
  /* Collapse every FIXED inline grid (checkout/cart/forms/admin & provider rows)
     to a single column. Auto-fill / auto-fit card grids keep adapting on their own. */
  [style*="grid-template-columns"]:not([style*="auto-fill"]):not([style*="auto-fit"]),
  .mf-review-form__row {
    grid-template-columns: 1fr !important;
  }

  /* Two-column page shells */
  .mf-detail,
  .mf-listing { grid-template-columns: 1fr; }
  .mf-detail > .mf-side,
  .mf-detail__side,
  .mf-listing__side,
  .mf-bookcard,
  .mf-section-card { position: static; max-height: none; }

  /* Wide tables: let them scroll inside their container instead of breaking the page */
  .mf-section,
  .mf-dash__main { overflow-x: auto; }
  .mf-detail__card:has(.mf-table) { overflow-x: auto; }
  .mf-table { min-width: 540px; }

  /* Topbar fits small screens */
  .mf-topbar__inner { padding: .7rem .9rem; gap: .5rem; }
  .mf-brand { font-size: 1.2rem; }
  .mf-brand i { font-size: 1.3rem; }
  .mf-topbar__actions { margin-left: auto; gap: .3rem; }
  .mf-topbar__actions .mf-btn { padding: .5rem .7rem; font-size: .82rem; }
  .mf-topbar__icon { width: 36px; height: 36px; }

  /* Trim outer padding so content uses the full width */
  .mf-section { padding-left: 1rem; padding-right: 1rem; }
  .mf-hero { padding: 1.75rem 1rem 1.25rem; }
  .mf-listing__head { margin-bottom: 1rem; }
  .mf-listing__title { font-size: clamp(1.35rem, 5vw, 1.9rem); }
  .mf-lab-trust { gap: .45rem .65rem; padding: .55rem .75rem; }
  .mf-lab-trust span { font-size: .78rem; }
  .mf-detail { padding-left: 1rem; padding-right: 1rem; }

  /* Detail header stacks cleanly */
  .mf-detail { padding: 1.25rem 1rem 2rem; }
  .mf-detail__card { padding: 1rem; }
  .mf-detail__head { gap: .85rem; align-items: stretch; }
  .mf-detail__head > .mf-detail__avatar { align-self: center; }
  .mf-detail__meta { gap: .45rem .75rem; }
  .mf-detail__meta span { max-width: 100%; }
  .mf-detail__actions { width: 100%; gap: .45rem; }
  .mf-detail__actions .mf-btn { flex: 1 1 calc(50% - .25rem); min-width: 0; justify-content: center; font-size: .82rem; padding: .62rem .55rem; }

  /* Listing toolbar wraps on phones */
  .mf-listing__sort { flex-wrap: wrap; justify-content: flex-end; }
  .mf-sort-form { max-width: 100%; }
  .mf-sort-form select { min-width: 0; max-width: 100%; }

  /* Listing pages: fixed header hides on scroll down, returns on scroll up */
  body.mf-listing-page.mf-topbar-padded { padding-top: var(--mf-topbar-h, 58px); }
  body.mf-listing-page .mf-topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
  }
  body.mf-listing-page.mf-topbar-hidden .mf-topbar {
    transform: translateY(-100%);
    box-shadow: none;
  }

  /* Horizontal tab strips shouldn't overflow */
  .mf-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mf-tabs::-webkit-scrollbar { display: none; }
  .mf-tabs button { flex: 0 0 auto; }

  /* Home search category tabs: scroll sideways (5 tabs + icons overflow on phones) */
  .mf-search-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin-left: -.2rem; margin-right: -.2rem; padding: 0 .2rem;
  }
  .mf-search-tabs::-webkit-scrollbar { display: none; }
  .mf-search-tabs button { flex: 0 0 auto; white-space: nowrap; }

  /* Hero CTA buttons stack full-width; trust chips keep wrapping in a row */
  .mf-hero__cta .mf-btn { width: 100%; flex: 1 1 100%; justify-content: center; }
}

@media (max-width: 520px) {
  /* Free up topbar room: drop the secondary CTAs so the brand, cart, Login and
     the burger menu all stay on screen. "Free listing" lives on the login page;
     the wishlist is reachable from the account area and product hearts. */
  .mf-topbar__actions a[href="register.php"],
  .mf-topbar__actions a[href="wishlist.php"] { display: none; }
  .mf-topbar__actions { gap: .25rem; }
  .mf-topbar__actions .mf-btn { padding: .45rem .6rem; font-size: .8rem; }
  .mf-burger { flex: 0 0 auto; padding: .35rem .4rem; }

  .mf-hero__cta { width: 100%; }
  .mf-stats { grid-template-columns: 1fr; }
  .mf-detail__avatar { width: 84px; height: 84px; }
  .mf-section__head { align-items: flex-start; }
  .mf-labcart { width: calc(100% - 1.2rem); bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }

  /* Detail heads: drop fixed min-width columns */
  .mf-detail__head > [style*="min-width:240px"],
  .mf-detail__head > [style*="min-width: 240px"],
  .mf-detail__head > [style*="min-width:220px"],
  .mf-detail__head > [style*="min-width: 220px"],
  .mf-detail__info { flex: 1 1 100% !important; min-width: 0 !important; max-width: none !important; width: 100%; }

  .mf-detail__actions .mf-btn { flex: 1 1 100%; }
  .mf-bookcard__price { justify-content: center; text-align: center; }
  .mf-side__range { grid-template-columns: 1fr; }
  .mf-side__range .mf-range-dash { display: none; }
}

/* ---------- HTML sitemap ---------- */
.mf-sitemap { display: grid; gap: 1rem; }
.mf-sitemap__block { margin-bottom: 0; }
.mf-sitemap__heading { font-family: Manrope; font-size: 1.05rem; margin: 0 0 .75rem; color: var(--mf-ink); }
.mf-sitemap__heading small { font-weight: 500; color: var(--mf-muted); font-size: .85em; }
.mf-sitemap__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .35rem .9rem; }
.mf-sitemap__list a { color: var(--mf-brand-d); font-weight: 600; text-decoration: none; }
.mf-sitemap__list a:hover { text-decoration: underline; }
.mf-sitemap__list time { display: block; font-size: .75rem; color: var(--mf-muted); font-weight: 400; margin-top: .05rem; }

/* ---------- Contact page ---------- */
.mf-contact-bar { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; padding: .9rem 1.1rem; background: var(--mf-brand-l); border: 1px solid #b8e8e6; border-radius: var(--mf-radius); }
.mf-contact-bar a { display: inline-flex; align-items: center; gap: .45rem; color: var(--mf-brand-d); font-weight: 700; text-decoration: none; }
.mf-contact-bar a:hover { text-decoration: underline; }

/* ---------- Listing cards (all listing pages) ---------- */
.mf-listing-trustbar,
.mf-lab-trust,
.mf-hospital-trustbar {
  display: flex; flex-wrap: wrap; gap: .65rem 1rem;
  padding: .75rem 1rem; margin-bottom: 1rem;
  background: linear-gradient(90deg, #e6f4f3, #f7fafa);
  border: 1px solid #d8e8e5; border-radius: 12px;
}
.mf-listing-trustbar span,
.mf-lab-trust span,
.mf-hospital-trustbar span {
  font-size: .82rem; color: var(--mf-ink); font-weight: 700;
  display: inline-flex; align-items: center; gap: .35rem;
}
.mf-listing-trustbar span i,
.mf-lab-trust span i,
.mf-hospital-trustbar span i { color: var(--mf-brand); }

.mf-prow--listing { border-color: #d4ebe9; transition: .18s; }
.mf-prow--listing:hover { border-color: var(--mf-brand); box-shadow: 0 8px 28px rgba(15, 141, 138, .12); transform: translateY(-2px); }
.mf-prow--listing .mf-prow__head { flex-direction: column; align-items: flex-start; gap: .35rem; }
.mf-prow--listing .mf-prow__name { font-size: 1.08rem; }
.mf-prow--listing .mf-lcard__stats { margin: .25rem 0 .1rem; }
.mf-prow--listing .mf-lcard__provider { margin: 0 0 .1rem; }
.mf-prow--listing .mf-prow__meta { margin-top: .1rem; }
.mf-prow--ambulance { border-color: #fecaca; }
.mf-prow--ambulance:hover { border-color: #dc2626; box-shadow: 0 8px 28px rgba(220, 38, 38, .1); }

.mf-lcard__overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; gap: .3rem; padding: .45rem .5rem;
  background: linear-gradient(transparent, rgba(15, 45, 55, .82));
}
.mf-lcard__overlay span {
  font-size: .68rem; font-weight: 800; color: #fff;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: .18rem .45rem;
  display: inline-flex; align-items: center; gap: .25rem;
}

.mf-lcard__rating-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
  border-radius: 999px; padding: .2rem .55rem;
  font-size: .78rem; font-weight: 800;
}
.mf-lcard__rating-pill small { color: #059669; font-weight: 600; }

.mf-lcard__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem;
  margin: .35rem 0 .15rem;
}
.mf-lcard__stat {
  text-align: center; padding: .45rem .35rem;
  background: var(--mf-line-soft); border-radius: 10px;
  border: 1px solid var(--mf-line);
}
.mf-lcard__stat i { display: block; color: var(--mf-brand); font-size: .9rem; margin-bottom: .15rem; }
.mf-lcard__stat strong { display: block; font-family: Manrope; font-size: .92rem; color: var(--mf-ink); line-height: 1.15; word-break: break-word; }
.mf-lcard__stat small { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mf-muted); font-weight: 700; }
.mf-lcard__stat--accent { background: #ecfdf5; border-color: #a7f3d0; }
.mf-lcard__stat--accent i { color: #059669; }

.mf-lcard__map { color: var(--mf-brand-d); font-weight: 700; font-size: .85rem; text-decoration: none; }
.mf-lcard__map:hover { text-decoration: underline; }

.mf-lcard__chips .mf-chip--dept { background: #e6f4f3; color: var(--mf-brand-d); border: 1px solid #b8e8e6; }
.mf-chip--more { background: #fff; border: 1px dashed var(--mf-line); color: var(--mf-muted); }

.mf-lcard__trust {
  margin: .45rem 0 0; padding: .55rem .7rem;
  background: #f0fdf9; border: 1px solid #b8e8e6; border-radius: 10px;
  color: var(--mf-brand-d); font-size: .82rem; font-weight: 600; line-height: 1.45;
}
.mf-lcard__trust i { margin-right: .3rem; }

.mf-lcard__provider {
  color: var(--mf-brand-d); font-weight: 700; text-transform: uppercase;
  font-size: .78rem; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .35rem; margin: .1rem 0;
}

.mf-prow__cta--listing { gap: .45rem; }
.mf-prow__price--highlight {
  background: linear-gradient(135deg, #e6f4f3, #f0fdf9);
  border: 1px solid #b8e8e6;
}
.mf-prow__price--highlight strong { color: var(--mf-brand-d); }
.mf-prow__price--offer del { display: block; color: var(--mf-muted); font-size: .82rem; font-weight: 500; margin-top: .15rem; }

.mf-lcard__score {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .75rem; margin-bottom: .15rem;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf9);
  border: 1px solid #a7f3d0; border-radius: 12px;
}
.mf-lcard__score-num {
  font-family: Manrope; font-size: 1.8rem; font-weight: 800; color: #047857; line-height: 1;
}
.mf-lcard__score small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mf-muted); font-weight: 700; }
.mf-lcard__score strong { display: block; margin: .1rem 0; }
.mf-lcard__score span { font-size: .75rem; color: #059669; font-weight: 600; }

.mf-btn--cta {
  background: linear-gradient(135deg, #0f8d8a, #0a6663);
  color: #fff !important; font-weight: 800; padding: .7rem 1rem;
  box-shadow: 0 4px 14px rgba(15, 141, 138, .28); border: 0;
}
.mf-btn--cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.mf-btn--danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #fff !important; box-shadow: 0 4px 14px rgba(220, 38, 38, .25);
}

.mf-lcard__cta-note {
  margin: .15rem 0 0; text-align: center;
  font-size: .75rem; color: var(--mf-muted); font-weight: 600;
}
.mf-lcard__cta-note i { color: #f59e0b; margin-right: .2rem; }

/* Catalog (lab / diagnostic / checkup) cards — icon header on top */
.mf-prow__media--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e6f4f3 0%, #f7fbfb 55%, #ffffff 100%) !important;
  padding: 1rem;
}
.mf-lcard__icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #c5e8e4;
  box-shadow: 0 6px 18px rgba(15, 141, 138, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mf-brand);
  font-size: 2rem;
}
.mf-lcard__discount {
  position: absolute; top: 8px; left: 8px;
  font-size: .68rem; font-weight: 800; color: #fff;
  background: #dc2626; border-radius: 999px; padding: .2rem .45rem;
}
.mf-lcard__popular { top: auto !important; bottom: 8px !important; left: 8px !important; }
.mf-lcard__nabl { top: 8px !important; right: 8px !important; left: auto !important; font-size: .65rem !important; }
.mf-lcard__save {
  display: inline-block; font-size: .72rem; font-weight: 800;
  background: #fef3c7; color: #92400e; padding: .12rem .4rem; border-radius: 999px; margin-top: .2rem;
}
.mf-lab-add--cta .mf-lab-add__label--cta,
.mf-lab-add__label--cta {
  background: linear-gradient(135deg, #0f8d8a, #0a6663) !important;
  color: #fff !important; border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(15, 141, 138, .22);
  font-size: .92rem; padding: .65rem .9rem;
}
.mf-lab-add--cta input:checked + .mf-lab-add__label--cta,
.mf-lab-add input:checked + .mf-lab-add__label--cta {
  background: #047857 !important;
}

.mf-listing--grid .mf-lcard__stats { grid-template-columns: repeat(2, 1fr); }
.mf-listing--grid .mf-lcard__trust { font-size: .78rem; }

@media (max-width: 1080px) {
  .mf-lcard__stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mf-lcard__stats { grid-template-columns: repeat(4, 1fr); }
  .mf-listing-trustbar, .mf-lab-trust { flex-direction: column; gap: .45rem; }
}

@media (max-width: 480px) {
  .mf-lcard__stats { grid-template-columns: repeat(2, 1fr); }
}

/* Package profile — lab / diagnostic / checkup enquiry */
.mf-detail__card--flush { padding: 0; overflow: hidden; }
.mf-pkg-profile { padding: 1.25rem 1.35rem 1.35rem; }
.mf-pkg-profile--compact { padding: 1rem 1.1rem 1.1rem; }
.mf-pkg-profile__head h2 {
  font-family: Manrope; font-size: 1.2rem; margin: 0 0 .35rem;
  display: flex; align-items: center; gap: .45rem;
}
.mf-pkg-profile__head p { margin: 0; color: var(--mf-muted); font-size: .9rem; line-height: 1.5; }
.mf-pkg-profile__compact-title {
  font-family: Manrope; font-size: 1.05rem; margin: 0 0 .85rem;
  display: flex; align-items: center; gap: .4rem;
}
.mf-pkg-profile__tabs {
  display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .85rem;
}
.mf-pkg-profile__tab {
  border: 1px solid var(--mf-line); background: #fff; border-radius: 999px;
  padding: .45rem .85rem; font-size: .82rem; font-weight: 700; color: var(--mf-muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
}
.mf-pkg-profile__tab.is-active {
  background: linear-gradient(135deg, #e6f4f3, #fff);
  border-color: #7dd3c8; color: var(--mf-brand-d);
  box-shadow: 0 2px 8px rgba(15, 141, 138, .12);
}
.mf-pkg-profile__toolbar { display: flex; gap: .45rem; margin-bottom: .55rem; }
.mf-pkg-profile__list {
  display: flex; flex-direction: column; gap: .45rem;
  max-height: 340px; overflow: auto; padding-right: .15rem;
}
.mf-pkg-profile__item {
  display: grid; grid-template-columns: auto 1fr auto; gap: .65rem; align-items: center;
  border: 1px solid var(--mf-line-soft); border-radius: 12px; padding: .65rem .75rem;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.mf-pkg-profile__item:has(input:checked) {
  border-color: #7dd3c8; background: linear-gradient(135deg, #f0fdf9, #fff);
  box-shadow: 0 2px 10px rgba(15, 141, 138, .1);
}
.mf-pkg-profile__item input { width: 18px; height: 18px; accent-color: var(--mf-brand); }
.mf-pkg-profile__item-body { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.mf-pkg-profile__item-body strong { font-family: Manrope; font-size: .92rem; line-height: 1.3; }
.mf-pkg-profile__item-body small { color: var(--mf-muted); font-size: .76rem; }
.mf-pkg-profile__view { font-size: .74rem; font-weight: 700; color: var(--mf-brand); margin-top: .1rem; }
.mf-pkg-profile__price {
  font-family: Manrope; font-weight: 800; font-size: .92rem; color: var(--mf-ink); white-space: nowrap;
}
.mf-pkg-profile__empty { color: var(--mf-muted); font-size: .88rem; margin: 0; padding: .5rem 0; }
.mf-pkg-profile__enquiry {
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--mf-line-soft);
}
.mf-pkg-profile__enquiry h3 {
  font-family: Manrope; font-size: 1rem; margin: 0 0 .45rem;
  display: flex; align-items: center; gap: .35rem;
}
.mf-pkg-profile__selected {
  margin: 0 0 .75rem; font-size: .82rem; color: #0a6663; font-weight: 600;
  background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; padding: .55rem .7rem;
}
.mf-pkg-profile__fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: .65rem;
}
.mf-pkg-profile__fields label,
.mf-pkg-profile__enquiry > label { display: block; font-size: .78rem; font-weight: 700; color: var(--mf-muted); margin-bottom: .25rem; }
.mf-pkg-profile__fields input,
.mf-pkg-profile__enquiry textarea {
  width: 100%; border: 1px solid var(--mf-line); border-radius: 10px; padding: .55rem .65rem;
  font: inherit; background: #fff;
}
.mf-pkg-profile__enquiry textarea { margin-bottom: .75rem; resize: vertical; }
.mf-pkg-profile__more {
  text-align: center; margin: 0; padding: 0 1rem 1rem; font-size: .88rem; font-weight: 700;
}
.mf-pkg-profile__more a { color: var(--mf-brand-d); }

@media (max-width: 768px) {
  .mf-pkg-profile__fields { grid-template-columns: 1fr; }
  .mf-pkg-profile__list { max-height: 280px; }
}

/* Doctor listing & profile */
.mf-prow__media--doctor img { object-position: top center; }
.mf-prow--doctor .mf-prow__media { overflow: hidden; }
.mf-detail--doctor .mf-listing-trustbar { grid-column: 1 / -1; margin: 0 0 .85rem; }
.mf-detail__card--doctor { border-color: #c5e8e4; background: linear-gradient(180deg, #ffffff 0%, #f8fdfc 100%); }
.mf-detail__avatar--doctor { border-radius: 50% !important; border: 3px solid #b8e8e3; box-shadow: 0 8px 24px rgba(15, 141, 138, .15); }
.mf-detail__card--doctor .mf-lcard__stats { margin: .75rem 0; }
.mf-detail__price small { color: var(--mf-muted); font-weight: 600; font-size: .9rem; margin-left: .25rem; }
.mf-badge--video { font-size: .65rem; vertical-align: middle; background: #0f8d8a; color: #fff; border-radius: 999px; padding: .15rem .45rem; font-weight: 700; }
.mf-detail__side--doctor { display: flex; flex-direction: column; gap: 1rem; }
.mf-bookcard--enquiry { margin-bottom: 0; }
.mf-bookcard--book { margin-top: 0; }
.mf-bookcard__sub { margin: 0 0 .75rem; color: var(--mf-muted); font-size: .84rem; line-height: 1.45; }
.mf-enquiry-form label { display: block; margin-top: .55rem; font-size: .78rem; font-weight: 700; color: var(--mf-muted); }
.mf-enquiry-form input,
.mf-enquiry-form textarea {
  width: 100%; border: 1px solid var(--mf-line); border-radius: 10px; padding: .55rem .65rem;
  font: inherit; background: #fff; margin-top: .2rem;
}
.mf-enquiry-form textarea { resize: vertical; min-height: 72px; }
.mf-enquiry-form .mf-btn { margin-top: .75rem; }
.mf-detail__card--doctor .mf-lcard__trust { margin: .65rem 0 .25rem; }

/* ---------- Responsive layout utilities ---------- */
.mf-layout-2col {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.2rem; align-items: start;
}
.mf-form-grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem;
}
.mf-section--narrow { max-width: 980px; }

/* =============================================================================
 *  Site-wide mobile polish (all public pages)
 * ============================================================================ */
@media (max-width: 900px) {
  .mf-layout-2col { grid-template-columns: 1fr; }
  .mf-form-grid-2 { grid-template-columns: 1fr; }
  .mf-contact-bar { flex-direction: column; align-items: flex-start; gap: .55rem; }
  .mf-sitemap__list { grid-template-columns: 1fr; }
  .mf-detail__side--doctor { gap: .85rem; }
  .mf-pkg-profile__tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .15rem; }
  .mf-pkg-profile__tabs::-webkit-scrollbar { display: none; }
  .mf-pkg-profile__tab { flex: 0 0 auto; white-space: nowrap; }
  .mf-pkg-profile__item { grid-template-columns: auto minmax(0, 1fr); }
  .mf-pkg-profile__price { grid-column: 2; justify-self: start; margin-top: -.15rem; }
}

@media (max-width: 760px) {
  .mf-auth { margin: 1.25rem auto; padding: 1.35rem 1.1rem; border-radius: 14px; max-width: calc(100% - 1.5rem); }
  .mf-auth h1 { font-size: 1.3rem; }
  .mf-flash { margin-left: 1rem; margin-right: 1rem; border-radius: 10px; }
  .mf-section { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  .mf-section--narrow { padding-left: 1rem; padding-right: 1rem; }
  .mf-listing__head { align-items: flex-start; }
  .mf-listing__sort { width: 100%; justify-content: space-between; }
  .mf-listing-view { flex-shrink: 0; }
  .mf-prow__name { font-size: 1.05rem; }
  .mf-prow__cta .mf-btn { min-height: 44px; font-size: .88rem; }
  .mf-labcart__inner { flex-wrap: wrap; }
  .mf-labcart__total { margin-left: 0; }
  .mf-fab {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .mf-rows__row { grid-template-columns: 1fr; }
  .mf-rows__handle { display: none; }
  .mf-bookm__sheet { padding: 1.1rem 1rem 1.3rem; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .mf-listing--grid .mf-listing__main,
  .mf-listing--grid .mf-listing__main > div { grid-template-columns: 1fr !important; }
  .mf-prow--listing:hover { transform: none; }
  .mf-card:hover { transform: none; }
  .mf-spec:hover { transform: none; }
}

@media (max-width: 520px) {
  .mf-trust__inner { grid-template-columns: 1fr; }
  .mf-listing-trustbar span,
  .mf-lab-trust span { font-size: .76rem; }
  .mf-lcard__score { flex-direction: column; text-align: center; gap: .35rem; }
  .mf-lcard__score-num { font-size: 1.55rem; }
  .mf-detail__title { font-size: 1.2rem; }
  .mf-breadcrumb { font-size: .8rem !important; line-height: 1.45; }
  .mf-enquiry-form textarea { min-height: 88px; }
  .mf-pkg-profile { padding: .9rem .85rem 1rem; }
  .mf-pkg-profile__toolbar { flex-wrap: wrap; }
}

/* =============================================================================
 *  Profile pages — mobile responsive (doctor, hospital, clinic, lab, product…)
 * ============================================================================ */
@media (max-width: 900px) {
  .mf-detail { grid-template-columns: 1fr; gap: 1rem; }
  .mf-detail > .mf-side,
  .mf-detail__side { position: static; order: 2; }
  .mf-detail > div:first-of-type { order: 1; min-width: 0; }
  .mf-detail--doctor .mf-listing-trustbar {
    flex-direction: column; align-items: flex-start; gap: .4rem;
  }
}

@media (max-width: 768px) {
  .mf-detail { padding: 1.1rem .9rem 2rem; }
  .mf-detail__card { padding: 1rem; margin-bottom: 1rem; }
  .mf-detail__card--flush { padding: 0; }

  /* Stack avatar / icon / product image on top */
  .mf-detail__head {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .mf-detail__head > .mf-detail__info {
    width: 100%;
    text-align: left;
    min-width: 0;
  }
  .mf-detail__avatar {
    width: 100px;
    height: 100px;
    align-self: center;
  }
  .mf-detail__avatar--doctor {
    width: 110px;
    height: 110px;
  }
  .mf-detail__avatar--icon {
    width: 100%;
    max-width: 200px;
    height: 120px;
    border-radius: 14px;
  }
  .mf-detail__media {
    width: 100%;
    max-width: 280px;
    flex: 0 0 auto;
    align-self: center;
  }

  .mf-detail__title {
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
    line-height: 1.3;
  }
  .mf-detail__subtitle { font-size: .9rem; line-height: 1.45; }
  .mf-detail__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
  }
  .mf-detail__meta span,
  .mf-detail__meta a { max-width: 100%; }

  .mf-detail__card .mf-lcard__stats,
  .mf-detail--doctor .mf-lcard__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
  }
  .mf-detail__price { font-size: 1.25rem; }

  .mf-detail__actions {
    flex-direction: column;
    width: 100%;
    gap: .45rem;
  }
  .mf-detail__actions .mf-btn {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .mf-detail__affil { flex-direction: column; align-items: center; text-align: center; }
  .mf-detail__affil .mf-detail__info { text-align: center; }
  .mf-detail__affil-actions { justify-content: center; width: 100%; }
  .mf-detail__affil-actions .mf-btn { flex: 1 1 calc(50% - .25rem); min-width: 0; }

  .mf-detail__sub-meta { flex-direction: column; align-items: flex-start; gap: .65rem; }
  .mf-detail__sub-meta .mf-btn { width: 100%; justify-content: center; }

  .mf-section-card__title { font-size: 1rem; flex-wrap: wrap; }
  .mf-faq__q { font-size: .9rem; padding: .75rem .85rem; }
  .mf-review-form__row { grid-template-columns: 1fr; }

  .mf-detail .mf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem; }
  .mf-detail__carousel-card { flex-basis: min(260px, 88vw); }

  .mf-bookcard { margin-top: 0; }
  .mf-bookcard .mf-btn { min-height: 44px; }
  .mf-pkg-profile { padding: 1rem .9rem 1.1rem; }
  .mf-pkg-profile__item { grid-template-columns: auto minmax(0, 1fr); }
  .mf-pkg-profile__price { grid-column: 2; justify-self: start; margin-top: -.1rem; }
}

@media (max-width: 520px) {
  .mf-detail { padding: 1rem .75rem 1.75rem; }
  .mf-detail__card { padding: .85rem; border-radius: 12px; }
  .mf-detail__avatar { width: 88px; height: 88px; }
  .mf-detail__avatar--icon { height: 108px; max-width: none; }
  .mf-detail__media { max-width: none; width: 100%; }
  .mf-detail__title { font-size: 1.12rem; }
  .mf-detail__card .mf-lcard__stats { grid-template-columns: 1fr 1fr; }
  .mf-detail .mf-cards { grid-template-columns: 1fr !important; }
  .mf-detail__affil-actions .mf-btn { flex: 1 1 100%; }
  .mf-lcard__trust { font-size: .78rem; padding: .5rem .6rem; }
  .mf-lcard__score { flex-direction: column; text-align: center; gap: .35rem; }
  .mf-pkg-profile__tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mf-pkg-profile__tab { flex: 0 0 auto; white-space: nowrap; }

  .mf-section--profile { padding-left: .75rem; padding-right: .75rem; }
  .mf-section--profile .mf-listing-trustbar { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .mf-section--profile .mf-breadcrumb { font-size: .8rem; line-height: 1.45; }
}

@media (min-width: 769px) {
  /* Listing cards in default list view on desktop */
  .mf-listing:not(.mf-listing--grid) .mf-prow {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
  }
  
  .mf-listing:not(.mf-listing--grid) .mf-prow__header {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 1.5rem;
    border-bottom: 1px solid var(--mf-line-soft);
    padding-bottom: 1.1rem;
    width: 100%;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__media {
    width: 90px;
    height: 90px;
    min-width: 90px;
    min-height: 90px;
    border-radius: 16px !important;
    margin: 0;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__header-info {
    align-items: flex-start;
    text-align: left;
    flex: 1;
    gap: 0.25rem;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__head {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    justify-content: flex-start;
  }
  
  .mf-listing:not(.mf-listing--grid) .mf-prow__name {
    font-size: 1.3rem;
    text-align: left;
  }
  
  .mf-listing:not(.mf-listing--grid) .mf-prow__qual {
    text-align: left;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__sub {
    text-align: left;
    font-size: 0.95rem;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__details-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2rem;
    align-items: start;
    width: 100%;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__body {
    gap: 0.95rem;
    text-align: left;
    padding: 0;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__meta {
    justify-content: flex-start;
    font-size: 0.88rem;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__chips {
    justify-content: flex-start;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__bio {
    text-align: left;
  }

  .mf-listing:not(.mf-listing--grid) .mf-prow__cta {
    border-top: 0;
    border-left: 1px dashed var(--mf-line);
    padding: 0 0 0 1.5rem;
    gap: 0.55rem;
    width: auto;
  }
  
  .mf-listing:not(.mf-listing--grid) .mf-prow__cta .mf-btn {
    min-height: 40px;
    font-size: 0.85rem;
  }

  /* Desktop Grid overrides for cards */
  .mf-listing--grid .mf-prow {
    padding: 1.25rem;
    gap: 1rem;
  }
  .mf-listing--grid .mf-prow__header {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .mf-listing--grid .mf-prow__head {
    flex-direction: column;
    align-items: center;
  }
  .mf-listing--grid .mf-prow__cta {
    border-top: 1px dashed var(--mf-line);
    padding: 0.9rem 0 0;
  }
}


