/* ==========================================================================
   DermPRO — responsive fixes (loaded AFTER main.css so these overrides win)
   Target breakpoints:
     - 1200px : narrow desktop / small laptop
     - 1024px : landscape tablet
     - 820px  : portrait tablet
     - 640px  : large phone
     - 420px  : small phone
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Global guards — prevent runaway horizontal scroll and runaway widths
   -------------------------------------------------------------------------- */
/* overflow-x only on body — html must stay scrollable so position:sticky
   on .site-header keeps working. */
body { overflow-x: hidden; }
img, video, iframe, svg { max-width: 100%; }
.container, .container.narrow, .container-narrow { padding-left: var(--gutter); padding-right: var(--gutter); }

/* --------------------------------------------------------------------------
   1. Tighter container padding below desktop so content breathes properly.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	:root { --gutter: 24px; }
}
@media (max-width: 820px) {
	:root { --gutter: 20px; }
	.container, .container.narrow, .container-narrow { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 560px) {
	:root { --gutter: 16px; }
	.container, .container.narrow, .container-narrow { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 420px) {
	.container, .container.narrow, .container-narrow { padding-left: 14px; padding-right: 14px; }
}

/* --------------------------------------------------------------------------
   2. Buttons — allow wrapping on narrow screens so CTAs don't overflow.
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
	.btn { white-space: normal; padding: 12px 20px; font-size: 13.5px; line-height: 1.3; }
	.btn-lg { padding: 14px 24px; font-size: 14px; }
}
@media (max-width: 420px) {
	.hero-cta,
	.page-hero-cta,
	.page-hero-c-cta,
	.lg-hero-cta,
	.lc-hero-cta,
	.pr-hero-cta,
	.subp-blog-cta { gap: 10px; }
	.hero-cta .btn,
	.page-hero-cta .btn,
	.page-hero-c-cta .btn,
	.lg-hero-cta .btn,
	.lc-hero-cta .btn,
	.pr-hero-cta .btn { flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   3. Header + mobile nav.

      Approach: a fixed-position drawer below the header, scrolls independently
      of the page. CTAs stay hidden on mobile (matches original design). Submenu
      expansion is toggled by `.is-open`, which main.js adds on first tap.

      Why `!important` on a few rules: main.css hard-codes the mobile breakpoint
      at 820px with equal specificity. These overrides have to beat it.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.nav-list { gap: 22px; }
	.nav-list a { font-size: 13.5px; }
}
@media (max-width: 820px) {
	.site-header { position: sticky; top: 0; z-index: 60; }
	.nav-inner { height: 68px; gap: 12px; }
	.brand { font-size: 18px; letter-spacing: .15em; }
	.brand-img { height: 20px; }

	/* Hamburger — always visible, always clickable. */
	.nav-toggle { display: flex !important; padding: 10px; margin-left: auto; }
	.nav-toggle span { width: 24px; }

	/* CTAs stay hidden on mobile (matches original intent). */
	.nav-cta { display: none !important; }

	/* Drawer: fixed-position so it scrolls on its own; z-index above sticky
	   header so submenus and taps can't be hidden under subsequent content. */
	.primary-nav { display: none; }
	.site-header.nav-open .primary-nav {
		display: block !important;
		position: fixed !important;
		top: 68px; left: 0; right: 0;
		max-height: calc(100vh - 68px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: var(--cream);
		padding: 10px 20px 24px;
		box-shadow: 0 12px 24px -16px rgba(0,0,0,.3);
		z-index: 59;
	}

	/* Drawer link list: full-width, stacked, with subtle separators. */
	.site-header.nav-open .nav-list {
		display: flex !important;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}
	.site-header.nav-open .nav-list > li { width: 100%; }
	.site-header.nav-open .nav-list > li > a {
		display: block;
		padding: 14px 4px;
		font-size: 16px;
		font-weight: 600;
		color: var(--ink);
		border-bottom: 1px solid rgba(20,30,60,.06);
	}
	.site-header.nav-open .nav-list > li:last-child > a { border-bottom: 0; }

	/* Submenu: hidden by default, revealed by main.js adding .is-open on
	   first tap of the parent link. (Also hard-reset the desktop positioning
	   so items can't leak off-screen.) */
	.site-header .nav-list .sub-menu {
		position: static !important;
		transform: none !important;
		box-shadow: none;
		border: 0;
		background: transparent;
		min-width: 0;
		max-width: none !important;
		padding: 4px 0 14px 14px;
		display: none !important;
		opacity: 1;
		visibility: visible;
	}
	.site-header .nav-list .menu-item-has-children.is-open > .sub-menu {
		display: flex !important;
	}
	.site-header .nav-list .sub-menu a {
		padding: 10px 6px;
		font-size: 14.5px;
	}
	.site-header .nav-list .sub-menu .menu-item-title { font-size: 14.5px; }
	.site-header .nav-list .sub-menu .menu-item-desc { font-size: 12.5px; }

	/* Rotate the caret when expanded so the state is obvious. */
	.site-header.nav-open .nav-list .menu-item-has-children > a::after {
		transition: transform .18s ease;
	}
	.site-header.nav-open .nav-list .menu-item-has-children.is-open > a::after {
		transform: rotate(225deg) translateY(2px);
	}
}
@media (max-width: 420px) {
	.brand { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   4. Section padding — step down for tablet/phone, not just 560px.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) { .section { padding: 60px 0; } }
@media (max-width: 820px)  { .section { padding: 48px 0; } }
@media (max-width: 560px)  { .section { padding: 40px 0; } }

/* --------------------------------------------------------------------------
   5. Unified typography scaling for the 55px "accent" titles that appear
      across subpages. Original rules only cover some pages / some bps.
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
	.section-title, .section-title .accent,
	.hero-title, .hero-title .accent,
	.statement-title, .statement-title .accent,
	.platform-title, .platform-title .accent,
	.subp-flywheel-head h2, .subp-flywheel-head h2 .accent,
	.subp-pillars-title, .subp-pillars-title .accent,
	.subp-evol-title, .subp-evol-title .accent,
	.subp-adloop-title, .subp-adloop-title .accent,
	.subp-plying-title, .subp-plying-title .accent,
	.lg-pricing-title, .lg-pricing-title .accent,
	.lg-teal-title, .lg-teal-title .accent,
	.page-hero-title, .page-hero-title .accent,
	.page-hero-c-title, .page-hero-c-title .accent {
		font-size: 44px; line-height: 50px; letter-spacing: -2.2px;
	}
}
@media (max-width: 820px) {
	.section-title, .section-title .accent,
	.hero-title, .hero-title .accent,
	.statement-title, .statement-title .accent,
	.platform-title, .platform-title .accent,
	.subp-flywheel-head h2, .subp-flywheel-head h2 .accent,
	.subp-pillars-title, .subp-pillars-title .accent,
	.subp-evol-title, .subp-evol-title .accent,
	.subp-adloop-title, .subp-adloop-title .accent,
	.subp-plying-title, .subp-plying-title .accent,
	.lg-pricing-title, .lg-pricing-title .accent,
	.lg-teal-title, .lg-teal-title .accent,
	.page-hero-title, .page-hero-title .accent,
	.page-hero-c-title, .page-hero-c-title .accent,
	.cta-title {
		font-size: 34px; line-height: 40px; letter-spacing: -1.7px;
	}
}
@media (max-width: 560px) {
	.section-title, .section-title .accent,
	.hero-title, .hero-title .accent,
	.statement-title, .statement-title .accent,
	.platform-title, .platform-title .accent,
	.subp-flywheel-head h2, .subp-flywheel-head h2 .accent,
	.subp-pillars-title, .subp-pillars-title .accent,
	.subp-evol-title, .subp-evol-title .accent,
	.subp-adloop-title, .subp-adloop-title .accent,
	.subp-plying-title, .subp-plying-title .accent,
	.lg-pricing-title, .lg-pricing-title .accent,
	.lg-teal-title, .lg-teal-title .accent,
	.page-hero-title, .page-hero-title .accent,
	.page-hero-c-title, .page-hero-c-title .accent,
	.cta-title {
		font-size: 28px; line-height: 34px; letter-spacing: -1.4px;
	}
	.section-lead { font-size: 18px; line-height: 26px; }
}

/* --------------------------------------------------------------------------
   6. Hero cards — fluid padding + readable sub-text at every size.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.hero-card { padding: 52px 32px 28px; }
	.page-hero-card { padding: 46px 36px; }
	.page-hero-c-card { padding: 46px 36px; }
}
@media (max-width: 820px) {
	.hero-card { padding: 44px 24px 24px; }
	.hero-sub { font-size: 14.5px; max-width: 100%; }
	.page-hero-card { padding: 36px 24px; }
	.page-hero-c-card { padding: 40px 20px; }
}
@media (max-width: 560px) {
	.hero-card, .statement-panel, .platform-panel { padding: 32px 18px; border-radius: 20px; }
	.page-hero-card, .page-hero-c-card { padding: 30px 18px; border-radius: 20px; }
	.hero-sub { font-size: 14px; }
	.statement-para, .platform-sub, .page-hero-sub, .page-hero-c-sub { font-size: 14.5px; line-height: 1.55; }
}

/* --------------------------------------------------------------------------
   7. Homepage loop panel — vertical cards with clean spacing on mobile.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.loop-panel { padding: 24px 20px 26px; margin-top: 32px; }
	.loop-steps { gap: 14px; }
	.loop-card { min-height: 0; padding: 20px 18px; }
	.loop-card h3 { font-size: 24px; line-height: 26px; }
	.loop-arrow { padding: 0; justify-content: center; }
	.loop-title { font-size: 17px; line-height: 24px; margin-bottom: 16px; }
}

/* --------------------------------------------------------------------------
   8. Stats rows — consistent 2-col at tablet, 1-col at phone.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.stats { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
	.stat { padding: 0 16px; }
	.stat + .stat::before { display: none; }
	.stat-value { font-size: 32px; line-height: 42px; }
	.lc-stats-grid, .pr-stats, .lg-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 560px) {
	.stats { grid-template-columns: 1fr; }
	.lc-stats-grid, .pr-stats, .lg-stats-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   9. Audience tabs — wrap gracefully and shrink the tab buttons.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.aud-tabs { padding: 4px; gap: 4px; }
	.aud-tab { width: calc(50% - 4px); font-size: 9.5px; letter-spacing: 1.8px; }
	.aud-panel.is-active { grid-template-columns: 1fr; gap: 24px; }
	.aud-panel-text { width: 100%; padding: 24px; max-height: none; }
	.aud-panel-media img { height: auto; min-height: 220px; }
}
@media (max-width: 420px) {
	.aud-tab { width: 100%; }
}

/* --------------------------------------------------------------------------
   10. Solutions / integrations / "why" sliders.
       Cards get too narrow at phone widths — widen a touch and let the user
       scroll comfortably.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.sol-grid, .int-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
	.sol-grid, .int-grid { grid-template-columns: 1fr; }
	.int-grid--2 { gap: 16px; }
	.int-grid--2 .int-card { max-width: 100%; flex: 1 1 100%; }
}
@media (max-width: 820px) {
	.why-card { flex-basis: 320px; max-width: 320px; height: 400px; }
}
@media (max-width: 560px) {
	.why-card { flex-basis: 82%; max-width: 82%; height: 380px; }
	.why-body { left: 12px; right: 12px; bottom: 12px; padding: 20px; }
}

/* --------------------------------------------------------------------------
   11. Statement panel — stack cleanly and keep text readable.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.statement-panel { padding: 44px 26px; }
	.statement-inner { gap: 24px; }
	.statement-right h3 { font-size: 16px; line-height: 22px; }
	.statement-right p, .statement-bold { font-size: 16px; line-height: 22px; }
}

/* --------------------------------------------------------------------------
   12. Final CTA — the 112px vertical padding is huge on phones.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) { .cta-final { padding: 88px var(--gutter); } }
@media (max-width: 820px)  { .cta-final { padding: 72px 20px; } }
@media (max-width: 560px)  { .cta-final { padding: 56px 16px; } .cta-sub { font-size: 14px; } }

/* --------------------------------------------------------------------------
   13. Footer — stop the newsletter input from overflowing on narrow phones;
       stack the bottom row items cleanly.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.site-footer { padding: 48px 0 28px; }
	.footer-top { padding-bottom: 32px; gap: 28px; }
	.footer-logo { font-size: 20px; }
	.footer-brand .footer-contact { margin-top: 36px; }
}
@media (max-width: 560px) {
	.news-form { width: 100%; }
	.footer-contact .fc-row { flex-direction: column; gap: 14px; }
	.footer-bottom { padding-top: 8px; }
	.footer-bottom .copyright { font-size: 13px; padding-bottom: 14px; }
	.footer-note { font-size: 12.5px; line-height: 20px; }
}

/* --------------------------------------------------------------------------
   14. Subpage sections — reduce min-heights on mobile so cards don't leave
       large empty regions, and prevent horizontal scrollbars on panels.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.int-card { min-height: 280px; }
	.subp-feat-card { min-height: 0; padding: 24px 22px; }
	.subp-adloop-card { min-height: 0; }
	.lc-inbox-card { min-height: 0; }
	.lc-stage { height: auto; min-height: 180px; }
	.lg-start-card-item { min-height: 0; }
	.pr-why-card { min-height: 0; }
	.pr-how-card { padding: 22px; }
	.subp-pillars-panel, .subp-evol-panel, .subp-flywheel-panel,
	.subp-abst-panel, .lg-teal-panel, .lg-pricing-panel,
	.pr-how-panel, .pr-anly-panel, .pr-com-panel { padding: 40px 22px; }
}

/* --------------------------------------------------------------------------
   15. Tables that live in overflow:auto wrappers — make the horizontal
       scrollbar discoverable and ensure the inner table has a sensible
       min-width so columns don't collapse to unreadable widths.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.subp-table-wrap, .subp-sku-wrap { -webkit-overflow-scrolling: touch; padding: 8px 16px; }
	.subp-tbl, .subp-sku-tbl { min-width: 560px; }
	.subp-table-panel { padding: 24px 16px; border-radius: 20px; }
	.subp-sku-card { padding: 32px 16px; border-radius: 24px; }
}

/* --------------------------------------------------------------------------
   16. ROI calculator — tighten the result card and keep slider labels
       on one row with the value.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.subp-calc-row { padding: 18px 20px; }
	.subp-calc-result { padding: 28px 24px 24px; }
	.subp-calc-result-value { font-size: 40px; line-height: 44px; }
	.subp-calc-breakdown-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
	.subp-calc-breakdown-cards { grid-template-columns: 1fr; }
	.subp-calc-slider-line { flex-wrap: wrap; }
	.subp-calc-range { flex: 1 1 100%; order: 2; }
	.subp-calc-val { order: 1; align-self: flex-end; }
}

/* --------------------------------------------------------------------------
   17. Case-studies meta row — stack labels/values vertically on phones.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.subp-cs-meta { padding: 16px 20px; gap: 12px; }
	.subp-cs-meta-item { padding: 10px 0; min-width: 0; width: 100%; }
	.subp-cs-meta-logo { padding: 0 0 10px 0; border-bottom: 1px solid var(--line-soft); width: 100%; }
	.subp-cs-block { padding: 24px 20px; border-radius: 20px; }
	.subp-cs-quote { padding: 22px 20px; border-radius: 0 0 20px 20px; }
}

/* --------------------------------------------------------------------------
   18. Patient-reactivation page — ICD map, dermatology dual, why-leak grid.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.pr-icdmap { grid-template-columns: 1fr; }
	.pr-icdmap-rail { flex-direction: row; flex-wrap: wrap; gap: 8px; }
	.pr-dx { flex: 1 1 calc(50% - 4px); padding: 14px 16px; }
	.pr-dxpanel { padding: 24px 20px; min-height: 0; }
	.pr-reminder-media img { max-width: 100%; }
}
@media (max-width: 560px) {
	.pr-dx { flex: 1 1 100%; }
	.pr-rstep { gap: 12px; }
	.pr-rstep-body strong { font-size: 17px; line-height: 22px; }
	.pr-why-card { grid-template-columns: 1fr; }
	.pr-why-body { padding: 22px 20px; }
	.pr-why-media img { max-width: 160px; margin: 0 auto; }
	.pr-anly-metrics { grid-template-columns: 1fr; }
	.pr-anly-bars li { grid-template-columns: 1fr; }
	.pr-anly-chart-title { font-size: 24px; line-height: 28px; }
	.pr-com-stats { flex-direction: column; gap: 18px; }
}

/* --------------------------------------------------------------------------
   19. Laser-growth page — glance card, pricing plans, bundle bar.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.lg-glance { padding: 20px; }
	.lg-glance-grid { grid-template-columns: 1fr; }
	.lg-glance-cell { min-height: 0; padding: 18px; }
	.lg-pricing-panel { padding: 40px 22px; }
	.lg-plans { gap: 14px; }
	.lg-plan { padding: 26px 22px; }
	.lg-bundle { grid-template-columns: 1fr; padding: 24px; }
	.lg-bundle-cta { width: 100%; }
	.lg-bar-foot { font-size: 7px; letter-spacing: 1.5px; }
}
@media (max-width: 560px) {
	.lg-bundle-body h3 { font-size: 32px; line-height: 36px; }
	.lg-bundle-value { font-size: 32px; line-height: 36px; }
	.lg-bundle-cta { width: 100%; max-width: 100%; }
}

/* --------------------------------------------------------------------------
   20. Lead-capture page — hero media, stage cards.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.lc-hero-media img { max-height: 320px; }
	.lc-stages { gap: 14px; }
	.lc-stage { width: 100%; max-width: 420px; flex: 0 0 100%; height: auto; min-height: 170px; }
	.lc-compare-card { padding: 24px 22px; }
}

/* --------------------------------------------------------------------------
   21. Contact page — iframe form sizing and card padding.
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
	.ct-wrap { padding: 24px 0 60px; }
	.ct-grid { gap: 36px; }
}
@media (max-width: 560px) {
	.ct-card { padding: 24px 16px; }
	.ct-form-wrap { padding: 14px; min-height: 0; }
	.ct-form-wrap iframe { min-height: 620px; }
	.ct-talk-h { font-size: 26px; line-height: 30px; }
}

/* --------------------------------------------------------------------------
   22. Blog & insights grid + featured hero.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.subp-blog-head { padding: 40px 0 22px; }
	.subp-blog-head h1 { font-size: 34px; line-height: 40px; }
	.subp-blog-feat-card { padding: 28px 24px; height: 360px; }
	.subp-blog-feat-top h3 { font-size: 22px; line-height: 1.25; }
	.subp-blog-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}
@media (max-width: 560px) {
	.subp-blog-grid { grid-template-columns: 1fr; }
	.subp-blog-feat-card { height: 320px; padding: 24px 20px; }
	.subp-blog-feat-top h3 { font-size: 20px; }
}

/* --------------------------------------------------------------------------
   23. Grids that keep 2 columns at the ≤820 breakpoint and would be too
       cramped on actual phones (<=560) — drop to a single column.
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
	.subp-did-grid,
	.subp-flywheel-cards,
	.subp-build-cards,
	.subp-feat-cards,
	.subp-ill-grid,
	.subp-evol-grid,
	.subp-onb-grid,
	.subp-plying-grid { grid-template-columns: 1fr; }
	.pr-stats { grid-template-columns: 1fr; }
	.pr-derm-dual { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   24. Dropdown navigation — the "menu-item-desc" subtitle wraps awkwardly on
       narrow dropdowns; constrain the dropdown width and let text wrap.
   -------------------------------------------------------------------------- */
@media (min-width: 821px) {
	.nav-list .sub-menu { max-width: min(360px, calc(100vw - 48px)); }
}

/* --------------------------------------------------------------------------
   25. Images that use `aspect-ratio` — relax on mobile so they don't force
       huge empty regions, and clamp max-height.
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
	.page-hero-media img { aspect-ratio: auto; max-height: 320px; }
	.lg-glance { aspect-ratio: auto; max-width: 100%; }
	.aud-panel-media img { height: auto; }
}

/* --------------------------------------------------------------------------
   26. Badge pill sometimes wraps mid-text on tight widths — allow wrapping.
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
	.badge { white-space: normal; text-align: left; line-height: 1.3; }
}
