/* ==========================================================================
   SITE FEATURES – lead banner, header actions, sticky footer, WhatsApp,
   country selector, inquiry pop-up, product carousels (Website Requirements v2.4)
   All colours come from the design tokens in custom.css.
   ========================================================================== */
:root {
  --lead-banner-h: 0px;
  --sticky-footer-h: 0px;
  --whatsapp-green: #25D366;
  --whatsapp-green-dark: #1DA851;
}

/* ---------- Lead banner (§2) ---------- */
.lead-banner {
  position: relative;
  background: var(--pharma-gradient-primary);
  color: #fff;
  padding: 0.45rem 0;
  font-size: 0.85rem;
}
.lead-banner-text { font-weight: 600; }
.lead-banner-form .single-entry-input { min-width: 240px; }
.lead-banner-form .form-control,
.lead-banner-form .country-code-btn {
  height: 34px;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.4);
}
.lead-banner-form .input-group .country-code-btn { border-radius: 999px 0 0 999px; }
.lead-banner-form .input-group .form-control { border-radius: 0 999px 999px 0; }
.lead-banner-form .btn-light { border-radius: 999px; height: 34px; }
.lead-banner .fp-form-feedback:empty { display: none; }
@media (max-width: 575.98px) {
  .lead-banner-text { width: 100%; text-align: center; font-size: 0.78rem; }
  .lead-banner-form { width: 100%; }
  .lead-banner-form .single-entry-input { flex: 1 1 auto; min-width: 0; }
}

/* ---------- Header logo ---------- */
.site-logo { height: 46px; width: auto; max-width: 220px; object-fit: contain; }
.site-logo-footer { height: 56px; }
@media (max-width: 767.98px) { .site-logo { height: 36px; max-width: 160px; } }
.btn-whatsapp {
  background: var(--whatsapp-green);
  color: #fff !important;
  border: 1px solid var(--whatsapp-green);
  font-weight: 600;
  border-radius: 999px;
}
.btn-whatsapp:hover { background: var(--whatsapp-green-dark); border-color: var(--whatsapp-green-dark); color: #fff; }

/* Site-wide flash */
.site-flash { position: fixed; top: calc(var(--header-h, 76px) + 16px); right: 16px; left: 16px; z-index: 1045; max-width: 480px; margin-left: auto; }

/* ---------- Single-entry input + country selector (§2.2) ---------- */
.single-entry-input { position: relative; }
.country-code-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: #fff; border: 1px solid #dee2e6; color: var(--pharma-heading);
  font-size: 0.85rem; padding: 0 0.6rem; white-space: nowrap;
}
.country-code-btn .country-flag { font-size: 1.05rem; line-height: 1; }
.single-entry-input[data-mode="email"] .country-code-btn { display: none; }
.single-entry-input[data-mode="email"] .input-group .form-control { border-radius: var(--bs-border-radius) !important; }
.country-dropdown {
  position: absolute; z-index: 1060; top: 100%; left: 0; margin-top: 4px;
  width: 300px; max-width: 90vw; background: #fff; border: 1px solid var(--pharma-border);
  border-radius: 12px; padding: 0.6rem; color: var(--pharma-heading);
}
.country-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.country-list li { padding: 0.35rem 0.5rem; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; font-size: 0.85rem; }
.country-list li:hover, .country-list li.active { background: var(--pharma-bg-light); }
.country-list li .dial { color: var(--pharma-muted); }
.fp-hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }
.fp-form-feedback.text-danger { color: #dc3545 !important; }
.fp-form-feedback.text-success { color: #198754 !important; }
.fp-form-feedback:empty { display: none; }

/* ---------- Sticky mobile footer (§5.1) ---------- */
.sticky-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
  display: flex; justify-content: space-around; align-items: stretch;
  background: #fff; border-top: 1px solid var(--pharma-border);
  box-shadow: 0 -6px 20px rgba(0, 70, 131, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.sticky-footer a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0.45rem 0.25rem; text-decoration: none; color: var(--pharma-body);
  font-size: 0.68rem; font-weight: 600; gap: 2px;
}
.sticky-footer a i { font-size: 1.25rem; line-height: 1; }
.sticky-footer a.active, .sticky-footer a:hover { color: var(--pharma-primary); }
.sticky-footer a.sticky-whatsapp { color: var(--whatsapp-green-dark); }
@media (max-width: 991.98px) {
  body { padding-bottom: calc(var(--sticky-footer-h) + env(safe-area-inset-bottom)); }
  .callback-fab { bottom: calc(var(--sticky-footer-h) + 16px); }
  .footer-pharma { padding-bottom: 1rem; }
}

/* ---------- Floating WhatsApp (desktop, §15.1) ---------- */
.whatsapp-float {
  position: fixed; right: 28px; bottom: 28px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--whatsapp-green); color: #fff; font-size: 1.7rem; z-index: 1030;
  align-items: center; justify-content: center; box-shadow: var(--pharma-shadow-lg);
  transition: transform .2s ease;
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; }

/* ---------- Product cards & carousels (§4.3, §18.3) ---------- */
.product-cell-spec { font-size: 0.78rem; }
.product-carousel { position: relative; }
.product-carousel-track {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
@media (max-width: 1199.98px) { .product-carousel-track { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991.98px) {
  .product-carousel-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.75rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 8%;
  }
  .product-carousel-track::-webkit-scrollbar { display: none; }
  .product-carousel-slide { flex: 0 0 84%; scroll-snap-align: center; }
}
.product-carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 0.75rem; }
.product-carousel-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--pharma-border); transition: background .2s; }
.product-carousel-dots span.active { background: var(--pharma-primary); }
.product-carousel.is-desktop-scroll .product-carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.product-carousel.is-desktop-scroll .product-carousel-slide { flex: 0 0 calc(25% - 0.75rem); scroll-snap-align: start; }

/* ---------- Hero / campaign banner (§3) ---------- */
.campaign-hero { position: relative; overflow: hidden; }
.campaign-slider { position: relative; }
.campaign-slide { display: none; }
.campaign-slide.active { display: block; }
.campaign-slide-inner { min-height: 420px; display: flex; align-items: center; }
.campaign-media img { width: 100%; height: auto; border-radius: 20px; box-shadow: var(--pharma-shadow-lg); }
.campaign-media video { width: 100%; border-radius: 20px; }
.campaign-offer { display: inline-block; background: #fff; color: var(--pharma-primary); font-weight: 800; padding: 0.35rem 0.9rem; border-radius: 999px; box-shadow: var(--pharma-shadow-sm); }
.campaign-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,0.9); color: var(--pharma-primary); box-shadow: var(--pharma-shadow-md); }
.campaign-nav.prev { left: 12px; } .campaign-nav.next { right: 12px; }
.campaign-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 3; }
.campaign-dots button { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); padding: 0; }
.campaign-dots button.active { background: #fff; }
.banner-product-slider { position: relative; }
.banner-product-slide { display: none; }
.banner-product-slide.active { display: block; }

/* ---------- Product page (§17) ---------- */
.product-gallery-sticky { position: sticky; top: calc(var(--lead-banner-h) + 100px); }
.product-gallery-main { background: var(--pharma-bg-alt); border-radius: 20px; display: flex; align-items: center; justify-content: center; min-height: 360px; overflow: hidden; position: relative; }
.product-gallery-main img { max-height: 420px; width: auto; max-width: 100%; object-fit: contain; cursor: zoom-in; transition: transform .3s; }
.product-gallery-main.zoomed img { transform: scale(1.8); cursor: zoom-out; }
.product-gallery-main iframe, .product-gallery-main video { width: 100%; aspect-ratio: 16/9; border: 0; }
.product-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; }
.product-thumbs button { flex: 0 0 72px; height: 72px; border-radius: 12px; border: 2px solid transparent; background: var(--pharma-bg-alt); padding: 4px; overflow: hidden; }
.product-thumbs button.active { border-color: var(--pharma-primary); }
.product-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.product-thumbs .video-thumb { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--pharma-primary); }
@media (max-width: 991.98px) {
  .product-gallery-sticky { position: static; }
  .product-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.5rem; scrollbar-width: none; }
  .product-gallery-track > * { flex: 0 0 100%; scroll-snap-align: center; }
}
.sticky-inquiry-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--sticky-footer-h) + env(safe-area-inset-bottom)); z-index: 1034;
  background: #fff; border-top: 1px solid var(--pharma-border); box-shadow: 0 -6px 20px rgba(0,70,131,.08);
  padding: 0.6rem 0; transform: translateY(110%); transition: transform .25s ease;
}
.sticky-inquiry-bar.show { transform: translateY(0); }
body.has-sticky-inquiry { padding-bottom: calc(var(--sticky-footer-h) + 70px + env(safe-area-inset-bottom)); }
.spec-table th { width: 38%; background: var(--pharma-bg-alt); color: var(--pharma-muted); font-weight: 600; }
.doc-list a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--pharma-border); border-radius: 12px; text-decoration: none; color: var(--pharma-heading); margin-bottom: .5rem; }
.doc-list a:hover { border-color: var(--pharma-primary); }

/* ---------- Footer accordions on mobile (§6.2) ---------- */
@media (max-width: 767.98px) {
  .footer-accordion-toggle { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
  .footer-col .footer-links.collapse:not(.show) { display: none; }
}
@media (min-width: 768px) {
  .footer-col .footer-links.collapse { display: block !important; }
}

/* ---------- Inquiry steps ---------- */
.inquiry-progress .progress-bar { background: var(--pharma-gradient-primary); }

/* ---------- Blog / content helpers ---------- */
.toc-box { background: var(--pharma-bg-alt); border-radius: 16px; padding: 1rem 1.25rem; }
.toc-box ol { margin: 0; padding-left: 1.2rem; }
.toc-box li { margin-bottom: .25rem; }
.key-takeaways { border-left: 4px solid var(--pharma-primary); background: var(--pharma-bg-alt); padding: 1rem 1.25rem; border-radius: 0 12px 12px 0; }
.post-content img { max-width: 100%; height: auto; border-radius: 12px; }
.post-content h2, .post-content h3 { margin-top: 1.75rem; }
.author-box { display: flex; gap: 1rem; align-items: center; background: var(--pharma-bg-alt); border-radius: 16px; padding: 1rem; }
.author-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.sidebar-sticky { position: sticky; top: calc(var(--lead-banner-h) + 100px); }
