/* =========================
   Base tweaks
========================= */
:root{
  --pc-primary:#0AA8A7;
  --snap-offset: 150px; /* JS will overwrite exactly */

  /* NEW: header + ribbon vars (JS updates these to real heights) */
  --nav-h: 64px;        /* CHANGED: sticky offset for ribbons */
  --ribbon2-h: 52px;    /* NEW: used for scroll landing below Ribbon 2 */
}

.nav-links-inline a {
  display: inline;
  padding: 0 5px;
}

.hero .overlay{
  position:absolute; inset:0;
  background:linear-gradient(180deg,rgba(0,0,0,.35),rgba(0,0,0,.35));
}
.carousel-caption{ bottom:14%; }
.rupee-chip{
  display:inline-flex; align-items:center; gap:.35rem;
  background:rgba(2,2,2,.45); color:#fff;
  padding:.25rem .55rem; border-radius:999px; font-weight:700;
}

/* Make sure [hidden] truly hides any ribbon to avoid flashes */
#ribbonA[hidden], #ribbonB[hidden], #ribbonC[hidden] { display: none !important; }

/* =========================
   HERO (banner) sizing
========================= */
.hero{ max-height:72vh; overflow:hidden; }
.hero .carousel-item img{
  width:100%;
  height:clamp(380px,55vh,620px);
  object-fit:cover;           /* fills nicely without distortion */
  object-position:center;
}

/* =========================
   Ribbons
========================= */
.shell{ border-bottom:1px solid #edf3f3; }

/* keep sticky ribbons above cards */
.svc-gheader{
  top: var(--nav-h);   /* CHANGED: was 66px; now driven by CSS var */
  z-index:1020;
  position: sticky;    /* NEW: ensure sticky behavior */
  background:#fff;     /* NEW: prevents transparency when stuck */
}

/* When the Services ribbon (#ribbonB) is shown, it “freezes” under header */
#ribbonB.svc-gheader{
  top: var(--nav-h);   /* CHANGED: align exactly under header */
  border-bottom:1px solid rgba(0,0,0,.06); /* NEW: subtle division line */
}

.svc-ribbon{
  display:flex; align-items:center; gap:24px;
  flex-wrap:nowrap; white-space:nowrap; overflow-x:auto;
  padding:10px 0;
}
.svc-ribbon::-webkit-scrollbar{ height:6px; }
.svc-ribbon::-webkit-scrollbar-thumb{ background:#d7e6e6; border-radius:999px; }
.svc-ribbon .rsep{ flex:1 1 auto; }
.rlink{
  position:relative; font-weight:700; color:#5a6872;
  text-decoration:none; padding:12px 2px;
}
.rlink:hover,.rlink.active{ color:#0e2b3a; }
.rlink.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-8px; height:3px; border-radius:3px;
  background:linear-gradient(90deg,#15c3b1,#0AA8A7);
}
@media (max-width:576px){ .svc-ribbon{ gap:18px; } }

/* =========================
   Local section headers & tabs
========================= */
.svc-group{ padding-top:28px; }
.svc-header-local{
  display:flex; justify-content:space-between; align-items:flex-end; gap:16px;
  border-bottom:1px solid #edf3f3; padding-bottom:10px; margin-bottom:14px;
  position:sticky; top: calc(var(--nav-h) + var(--ribbon2-h) + 12px); /* CHANGED */
  background:#fff; z-index:3;
}
.svc-eyebrow{ font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:#77939a; }
.svc-title{ font-weight:800; color:#0e2b3a; margin:0; }
.svc-tabs{ gap:.5rem; }
.svc-tab{
  background:#f2f8f8; border:1px solid #e1efef; padding:.5rem .8rem;
  border-radius:999px; font-weight:600; color:#436169;
}
.svc-tab.active{ background:#def5f4; border-color:#bfe9e7; color:#0e2b3a; }

/* =========================
   Vertical cards
========================= */
/* relative so absolute-positioned inactive slides anchor correctly */
.svc-vstack{ display:flex; flex-direction:column; gap:26px; position:relative; }

.svc-vcard{
  background:#fff; border-radius:18px; border:1px solid #eaf2f2;
  box-shadow:0 18px 40px rgba(16,24,40,.10); overflow:hidden;
  will-change: transform, opacity;
  scroll-margin-top: var(--snap-offset); /* land under sticky ribbons */
}

/* --- Service image sizing (normalized “fit”) --- */
.vimg{
  width:100%;
  height:auto;
  aspect-ratio:16/9;       /* consistent look across cards */
  max-height:520px;        /* hard cap on very tall screens */
  object-fit:cover;
  display:block;
}
.vimg.placeholder{
  display:grid; place-items:center;
  height:auto; aspect-ratio:16/9;          /* matches .vimg */
  background:repeating-linear-gradient(45deg,#e7f3f3,#e7f3f3 10px,#f6fbfb 10px,#f6fbfb 20px);
  color:#5a6872; font-weight:600;
}

/* Optional utility: letterbox instead of crop for a specific image */
.img-contain{ object-fit:contain !important; background:#f7fbfb; }

.vbody{ padding:18px 20px 20px; }
.svc-meta{ display:flex; align-items:center; gap:.5rem; }
.date-chip{ background:#eef7f7; border:1px solid #d8eeee; padding:.15rem .5rem; border-radius:6px; font-size:.8rem; }
.svc-tag{ color:#1d837f; font-weight:700; font-size:.8rem; }

/* =========================
   Popup-like visual effect
========================= */
.svc-vcard.pop{
  opacity:.35;
  transform:translateY(16px) scale(.98);
  transition:opacity .35s ease, transform .35s ease, box-shadow .35s ease, filter .35s ease;
  filter:saturate(.9);
}
.svc-vcard.pop.in{
  opacity:1;
  transform:translateY(0) scale(1);
  box-shadow:0 24px 60px rgba(16,24,40,.18);
  filter:saturate(1);
}

/* =========================
   How it works icons
========================= */
.step-icon{
  width:42px; height:42px; display:grid; place-items:center;
  border-radius:12px; background:#e9f7f6; font-size:20px;
}

/* =========================
   CTA
========================= */
.cta{ background:linear-gradient(135deg,#0AA8A7 0%, #13c2a8 100%); color:#fff; border-radius:22px; }

/* =========================
   Popup banner (kept; your original style)
========================= */
/* === FORCE IMAGE-ONLY POPUP (no backdrop, no white box) === */
.flash-popup{
  position: fixed !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  background: transparent !important;     /* no dark/white background */
  z-index: 2000 !important;
}

.flash-content{
  position: relative !important;
  width: auto !important;                 /* size driven by image */
  max-height: none !important;
  background: transparent !important;     /* kill white card */
  border: 0 !important;
  box-shadow: none !important;            /* remove card shadow */
  border-radius: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

#popupImage{
  display: block !important;
  width: min(92vw, 520px) !important;     /* adjust max width if you want */
  max-height: 80vh !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 12px !important;         /* optional rounded image */
  background: transparent !important;
}

.flash-close{
  position: absolute !important;
  top: 8px !important;
  right: 10px !important;
  width: 36px !important;
  height: 36px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,.65) !important;
  color: #fff !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 2 !important;
}

[hidden]{ display: none !important; }

@keyframes flash-popin{ from{ transform:translateY(12px); opacity:0 } to{ transform:none; opacity:1 } }

/* =========================
   Ribbon B centering
========================= */
.svc-ribbon.ribbon-center{ justify-content:center; }
@media (max-width:768px){
  .svc-ribbon.ribbon-center{ justify-content:flex-start; }
}

/* =========================
   State helpers
========================= */
body.in-services #ribbonA{ display:none !important; }

/* =========================
   Layout guards (keep cards stable)
========================= */
/* prevent layout jump if inactive slides are absolute */
#services .svc-vcard{ min-height: 340px; }

/* How it works readability */
#how .step { line-height: 1.6; }
#how .step h6 { font-size: 1rem; margin-bottom: .2rem; }
#how .step p { font-size: .95rem; color:#4d5b63; }
#how .step-icon{
  width:40px; height:40px; font-size:18px;
  background:#e6f6f5; border:1px solid #d7efee;
}

/* Soft page-break spacer (between How and Services) */
.section-break { padding: 18px 0 8px; }
.section-break .break-line{
  height: 1px;
  background: linear-gradient(90deg, rgba(10,168,167,.15), rgba(10,168,167,.45), rgba(10,168,167,.15));
  border-radius: 999px;
}

/* =========================
   HERO utilities (kept from your additions)
========================= */
:root{
  --banner-h:70vh;
}
.hero-banner{ position:relative; width:100%; height:var(--banner-h); overflow:hidden; }
.hero-banner .banner-img{ width:100%; height:100%; object-fit:cover; object-position:center; display:block; }
.hero-banner .overlay{ position:absolute; inset:0; background:rgba(0,0,0,.4); }
.banner-text{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; flex-direction:column; padding:1rem; color:#fff; }

/* ====== IMPORTANT ======
   Removed duplicate `.flash-popup` overlay rules that appeared later
   in your file and conflicted with the "Popup banner" section above.
   (Keeping just one definition avoids fighting styles.)
========================= */

@media (max-width:576px){
  :root{ --banner-h:58vh; }
}

/* =========================
   NEW: Scroll landing below frozen bars
   (applies to services sections and any ID you use inside Services)
========================= */
.svc-section,
[id^="care-"],
#home-delivery, #home-lab, #home-wallet{
  scroll-margin-top: calc(var(--nav-h) + var(--ribbon2-h) + 12px);
}

/* Popup */
.flash-popup{
  position:fixed; inset:0; display:grid; place-items:center;
  background:rgba(0,0,0,.55); z-index:2000;
}
.flash-content{
  position:relative; width:min(92vw,520px); max-height:80vh;
  background:#fff; border-radius:12px; overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}
#popupImage{ display:block; width:100%; height:auto; max-height:80vh; object-fit:contain; }
.flash-close{
  position:absolute; top:8px; right:10px; width:36px; height:36px;
  border:0; border-radius:50%; background:rgba(0,0,0,.6);
  color:#fff; font-size:22px; line-height:1; cursor:pointer; z-index:2;
}
[hidden]{ display:none !important; }

.pw-toggle.active { color: var(--pc-primary,#0AA8A7); }
