/*
 * accessory.css
 * Recreation of Figma node 76:16010 ("Dental Accessories") on top of the
 * shared .ft-* foundation (css/new/foundation.css). Tokens, box-sizing, the
 * shell, base section rhythm, heading trio (.ft-heading/.ft-eyebrow/.ft-title/
 * .ft-accent) and buttons come from the foundation; this sheet keeps ONLY the
 * genuine accessories deltas (body.acc-page-scoped) plus the page's unique
 * hero / card / banner / video compositions (.acc-*).
 *
 * Figma tokens (via --ft-*):
 *   Blue_Main #2DA7FA · Blue_Subtle #EDF7FF · Text #333536 · Muted #737A82
 *   BG/Default #F6F6F6 · Card #FDFDFD
 *   Title/Display 36/44 · Title/Title 24/30 · H3 14 · Body/Lead 16/22
 *   Body/Body-B 14 · Body/Body-sm 12 · Label/Button 16
 */

/* Foundation caps the shell at 1480px; this page's Figma frame caps content at
 * 1320px (1920 − 2×300 gutters). body.acc-page is unique to this page, and the
 * extra specificity keeps this cap winning inside foundation's own media
 * queries (e.g. its ≤380px --ft-shell re-declaration). */
body.acc-page .ft-main {
	--ft-shell: min(1320px, 100% - 80px);
}

/* Hero sits on a wider 18.75% gutter than the sections (Figma: hero copy x=360,
 * sections x=300), exactly like the homepage hero (.ft-section--hero .ft-shell).
 * Holds the 1200px design block at every desktop width — fluid below it, frozen
 * above — so the media column doesn't collapse on smaller desktops or drift
 * apart from the copy at 4K. Applied from 991px up; below that it stacks. */
@media (min-width: 991px) {
	.acc-section--hero .ft-shell {
		width: min(100% - 48px, 1200px);
		max-width: none;
	}
}

/* ---- Sections ---- */
/* Padding (80px 0) comes from .ft-section; this page only adds the hash-scroll
 * offset (header mega-menu deep-links: #articulator, #screws, ...). */
body.acc-page .ft-section {
	scroll-margin-top: calc(var(--shop-header-height, 96px) + 12px);
}

.acc-section--hero {
	background: #f6f6f6;
	padding: 56px 0 64px;
}

.acc-section--articulator,
.acc-section--screws {
	background: #fdfdfd;
}

.acc-section--bench,
.acc-section--plates,
.acc-section--adapters {
	background: #f6f6f6;
}

.acc-section--banner {
	background: #fcfcfc;
}

.acc-section--sim {
	background: var(--ft-blue-subtle);
}

/* ---- Section headings ---- */
/* Grid + 8px gap come from .ft-heading; the eyebrow/title/accent trio matches
 * the foundation exactly. This page only spaces the heading off its grid. */
.acc-head {
	margin-bottom: 32px;
}

.acc-head--center {
	justify-items: center;
	text-align: center;
}

/* ---- Buttons / links ---- */
/* .ft-btn/.ft-btn--primary match the old .acc-btn exactly (text-decoration is
 * reset globally in core.css); the only delta is the 15px arrow icon
 * (foundation: 16px). */
body.acc-page .ft-btn i {
	font-size: 15px;
}

.acc-cart {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ft-blue);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.acc-cart i {
	font-size: 14px;
}

/* ---- Hero ---- */
.acc-hero {
	display: grid;
	grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
	gap: 48px;
	align-items: center;
}

.acc-hero__copy {
	display: grid;
	gap: 24px;
	max-width: 480px; /* Figma node 76:14199 copy column = 480px */
}

.acc-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	padding: 8px 14px;
	background: #fdfdfd;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(39, 55, 75, 0.08);
	font-size: 14px;
	font-weight: 600;
}

.acc-hero__badge i {
	font-size: 15px;
	color: var(--ft-blue);
}

.acc-hero__badge-icon {
	width: 16px;
	height: 16px;
	color: var(--ft-blue);
	flex: none;
}

.acc-hero__title {
	margin: 0;
	font-size: 36px;
	line-height: 44px;
	font-weight: 700;
}

.acc-hero__desc {
	margin: 0;
	font-size: 16px;
	line-height: 22px;
	font-weight: 500;
	color: var(--ft-muted);
}

.acc-hero__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Hero cluster wrapper. Mobile (stacked) value: fills the single column, capped.
 * The desktop sizing is in the min-width:991px block below — confining the
 * cluster to the narrow media column (672px) made it render ~40% smaller than the
 * Figma hero (node 76:14185: the cluster + manikin head fill the right half), so
 * desktop sizes it relative to the viewport and lets it overflow its column. */
.acc-hero__media-stack {
	position: relative;
	width: 100%;
	max-width: 672px;
}

.acc-hero__media-stack img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

/* Desktop: size the cluster to the Figma proportion (~49vw → the manikin head
 * lands at ~16% of the viewport, matching node 76:14185) instead of the media
 * column. flex:none keeps the flex row from shrinking it back to the column;
 * left-aligning (flex-start) makes it start after the copy and overflow toward
 * the right edge, exactly as the design overhangs the content gutter. Frozen at
 * its 1920 size (49vw @1920 = 941px) past 1920 — the hero shell caps at 1200px
 * there, so a still-growing vw image would outscale the fixed copy column.
 * The 100vw-600px cap keeps the cluster off the right edge in the ~991–1082px
 * band where the fixed copy column pushes its start too far right. */
@media (min-width: 991px) {
	.acc-hero__media {
		justify-content: flex-start;
		overflow: visible;
	}
	.acc-hero__media-stack {
		width: min(49vw, 941px);
		max-width: calc(100vw - 600px);
		flex: none;
	}
}

/* ---- Generic product card grids (Articulator / Screws / Adapters) ---- */
.acc-grid {
	display: grid;
	gap: 16px;
}

.acc-grid--4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.acc-grid--5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.acc-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px 22px;
	border-radius: 16px;
}

.acc-card--blue {
	background: var(--ft-blue-subtle);
}

.acc-card--white {
	background: #ffffff;
	box-shadow: 0 12px 32px rgba(20, 33, 50, 0.06);
}

.acc-card__title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--ft-text);
}

.acc-card__desc {
	margin: 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.45;
	color: var(--ft-muted);
}

.acc-card__img {
	display: flex;
	align-items: center;
	justify-content: center;
}

.acc-card__img img {
	display: block;
	max-width: 100%;
	object-fit: contain;
}

/* Variant: title + desc on top, product in the middle, cart pinned bottom */
.acc-card--toptext .acc-card__text {
	display: grid;
	gap: 8px;
}

.acc-card--toptext .acc-card__img {
	flex: 1 1 auto;
	min-height: 170px;
	padding: 12px 0;
}

.acc-card--toptext .acc-card__img img {
	max-height: 200px;
}

.acc-card--toptext .acc-cart {
	margin-top: 8px;
	align-self: center;
}

/* Variant: product on top, centered text, cart pinned bottom */
.acc-card--centered {
	align-items: center;
	text-align: center;
}

.acc-card--centered .acc-card__img {
	width: 100%;
	min-height: 170px;
	margin-bottom: 8px;
}

.acc-card--centered .acc-card__img img {
	max-height: 180px;
}

.acc-card--centered .acc-cart {
	margin-top: auto;
	padding-top: 8px;
}

/* ---- Bench Mounts ---- */
.acc-bench {
	display: grid;
	grid-template-columns: 1fr 1fr 0.56fr;
	gap: 16px;
	align-items: stretch;
}

.acc-bcard {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 28px 32px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(20, 33, 50, 0.06);
}

.acc-bcard__text {
	display: grid;
	gap: 10px;
	flex: 1 1 auto;
}

.acc-bcard__img {
	flex: 0 0 38%;
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	background: var(--ft-blue-subtle);
	border-radius: 12px;
	padding: 16px;
}

.acc-bcard__img img {
	display: block;
	max-width: 100%;
	max-height: 168px;
	object-fit: contain;
}

/* Figma 76:14120 — card #fdfdfd r16 with the poster inset 12px (rounded 8px)
 * and a centred caption below; not edge-to-edge. */
.acc-video {
	margin: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 14px;
	padding: 12px;
	background: #fdfdfd;
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(20, 33, 50, 0.06);
}

.acc-video img {
	display: block;
	width: 100%;
}

/* Bench Mount Instruction — Figma: 14px Montserrat SemiBold, #333536, centred. */
.acc-video figcaption {
	padding: 0 8px 4px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
	color: #333536;
}

/* Clickable video poster with a centered play button, matching the ModuPro
 * resources cards. */
.acc-video__thumb {
	position: relative;
	display: block;
	line-height: 0;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
}

.acc-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 46px;
	height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(45, 167, 250, .92);
	color: #fff;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	box-shadow: 0 6px 16px rgba(45, 167, 250, .4);
}

/* ---- CheckMate banners ---- */
.acc-banner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
	gap: 48px;
	align-items: center;
	/* Keep the card + product as a tight, centred group rather than spread to
	 * the shell edges (matches the Figma layout, which sits ~1100/1920 wide). */
	max-width: 1060px;
	margin-inline: auto;
}

.acc-banner__card {
	display: grid;
	gap: 16px;
	padding: 40px;
	background: #f3f5f9;
	border-radius: 16px;
}

.acc-banner__card .acc-card__desc {
	font-size: 14px;
	line-height: 1.5;
}

.acc-banner__card .acc-cart {
	margin-top: 8px;
}

.acc-banner__media {
	display: flex;
	align-items: center;
	justify-content: center;
}

.acc-banner__media img {
	display: block;
	width: 100%;
	max-width: 420px;
	height: auto;
	object-fit: contain;
}

/* Image-left / card-right variant — the tools cluster reads larger than the
 * single CheckMate product, so give its (left) media column the larger share.
 * Per the Figma layout the tools image hugs the left edge and sits well clear
 * of the card, so widen the column gap and left-align the media. */
.acc-banner--reverse {
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
	gap: 100px;
	max-width: 1140px;
}

.acc-banner--reverse .acc-banner__media {
	justify-content: flex-start;
}

.acc-banner--reverse .acc-banner__media img {
	max-width: 540px;
}

/* CheckMate One: card | product | video, the video in its own narrow column
 * like the Mount Instruction card in the bench row above. */
.acc-banner--video {
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr) minmax(0, 0.56fr);
	gap: 32px;
	max-width: 1240px;
}

/* ---- Simulation Accessories ---- */
.acc-sim {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.acc-simcard {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 280px;
	padding: 24px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(20, 33, 50, 0.06);
	overflow: hidden;
}

.acc-simcard__dot {
	position: absolute;
	top: 24px;
	left: 24px;
	width: 24px;
	height: 24px;
	border-radius: 999px;
	background: var(--ft-blue);
	z-index: 1;
}

/* Image sits in the top-right in normal flow; the body's margin-top:auto pins
 * the copy to the bottom of the card. Because the image is in flow (not
 * absolutely positioned) the text can never slide underneath it, no matter how
 * long the description runs. Image kept compact to match the design. */
.acc-simcard__img {
	align-self: flex-end;
	width: 56%;
	max-width: 210px;
	height: 170px; /* Figma sim products read large (≈138–173 tall); 150 still too small */
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
}

.acc-simcard__img img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.acc-simcard__body {
	margin-top: auto;
	display: grid;
	gap: 8px;
}

/* Wide Clear Face card — copy on the left, a large product image anchored to
 * the bottom-right (per the design). The image is absolutely positioned so it
 * can read large without pushing the copy around. */
.acc-simcard--wide {
	grid-column: span 2;
	min-height: 280px;
}

/* Figma: the Clear Face image box is 200×273, on the right edge of the wide card
 * and vertically centred (was filling the full card height — far too big). */
.acc-simcard--wide .acc-simcard__img {
	position: absolute;
	top: 50%;
	right: 48px;
	transform: translateY(-50%);
	width: 200px;
	max-width: 200px;
	height: 273px;
	align-items: center;
	justify-content: center;
}

.acc-simcard--wide .acc-simcard__body {
	margin-top: auto;
	max-width: 48%;
}

/* ---- ModuPRO Plates ---- */
.acc-plates {
	display: grid;
	grid-template-columns: 1fr 1.7fr;
	gap: 16px;
	align-items: stretch;
}

.acc-pcard {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(20, 33, 50, 0.06);
}

.acc-pcard__img {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ft-blue-subtle);
	border-radius: 12px;
	padding: 24px;
	min-height: 190px;
}

.acc-pcard__img img {
	display: block;
	max-width: 100%;
	max-height: 185px;
	object-fit: contain;
}

.acc-pcard__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
}

.acc-pcard__body .acc-card__desc {
	font-size: 13px;
}

/* Pin the cart to the bottom of the body so it lines up across both plate cards
 * regardless of differing description / image heights. */
.acc-pcard__body .acc-cart {
	margin-top: auto;
	padding-top: 8px;
}

/* The DH & Calibration strip render already includes its own blue panel, so
 * let it fill the image block edge-to-edge instead of nesting a second panel. */
.acc-pcard--wide .acc-pcard__img {
	padding: 0;
	background: transparent;
	min-height: 0;
	overflow: hidden;
}

.acc-pcard--wide .acc-pcard__img img {
	width: 100%;
	max-height: none;
	height: auto;
	border-radius: 12px;
}

/* ============================================================
 * Responsive — CSS-only reflow, same convention as modupro / charlie /
 * licensure: a tablet step → a uniform 2-col phone band (450px+) →
 * 1-col below 450px. Min target width 325px. Hero stacks copy-first.
 * ============================================================ */
@media (max-width: 1100px) {
	.acc-grid--5 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 990px) {
	/* Pre-migration cascade: the generic `.acc-section { padding: 64px 0 }` here
	 * beat the hero's base 56/64 padding by source order, so EVERY section —
	 * hero included — rendered 64px top and bottom at ≤990. Foundation's ≤990
	 * .ft-section step loads before this sheet and would lose to the hero base
	 * rule above; the body scope restates the original computed values (and its
	 * higher specificity keeps foundation's ≤680px 48px step from applying —
	 * this page steps to 48px at 600, not 680). */
	body.acc-page .ft-section {
		padding: 64px 0;
	}

	/* Hero stacks: copy first (DOM order), image below — matches Figma mobile. */
	.acc-hero {
		grid-template-columns: 1fr;
		gap: 32px;
		text-align: center;
		justify-items: center;
	}

	.acc-hero__copy {
		max-width: none;
		justify-items: center;
	}

	/* All product grids collapse to one uniform 2-col layout (convention). */
	.acc-grid--4,
	.acc-grid--5,
	.acc-sim {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Bench cards stack full-width (like charlie's Titan cards + the Figma mobile
	 * single-card carousel) rather than two cramped side-by-side cards. */
	.acc-bench {
		grid-template-columns: 1fr;
	}

	/* Full-width card like the two stacked bench cards (not a lone narrow box);
	 * the poster is capped + centred inside. */
	.acc-video {
		max-width: none;
	}
	.acc-video__thumb {
		max-width: 460px;
		margin-inline: auto;
	}

	/* Clear Face stops spanning + drops its absolute image so all five sim cards
	 * are uniform same-size 2-col cards (avoids the span-2 auto-placement gap). */
	.acc-simcard--wide {
		grid-column: auto;
	}

	.acc-simcard--wide .acc-simcard__img {
		position: static;
		top: auto;
		right: auto;
		transform: none;
		align-self: flex-end;
		width: 56%;
		max-width: 210px;
		height: 170px;
		align-items: flex-start;
		justify-content: flex-end;
	}

	.acc-simcard--wide .acc-simcard__body {
		max-width: none;
	}

	/* Banners + plates stack (card text first, product below). */
	.acc-banner,
	.acc-banner--reverse,
	.acc-banner--video {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.acc-banner--reverse .acc-banner__media {
		order: 2;
	}

	.acc-plates {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	/* Body-scoped to out-cascade the ≤990 body-scoped 64px rule above (same
	 * specificity, later in source). */
	body.acc-page .ft-section {
		padding: 48px 0;
	}

	body.acc-page .acc-section--hero {
		padding: 40px 0 48px;
	}

	/* Bench card → image on top, text below. */
	.acc-bcard {
		flex-direction: column;
		align-items: stretch;
		text-align: left;
	}

	.acc-bcard__img {
		flex-basis: auto;
		order: -1;
	}

	.acc-video {
		max-width: none;
	}
}

/* Below 450 → single column (convention); narrow the gutter to 16px each side. */
@media (max-width: 449px) {
	.acc-grid--4,
	.acc-grid--5,
	.acc-sim {
		grid-template-columns: 1fr;
	}

	.acc-simcard,
	.acc-simcard--wide {
		min-height: 0;
	}

	.acc-simcard__img,
	.acc-simcard--wide .acc-simcard__img {
		position: static;
		width: 100%;
		max-width: none;
		height: 150px;
		justify-content: center;
		margin: 8px 0 16px;
	}

	.acc-simcard__dot {
		display: none;
	}

	.acc-simcard__body,
	.acc-simcard--wide .acc-simcard__body {
		max-width: none;
	}

	/* Also outranks foundation's ≤380px 40px-gutter re-declaration. */
	body.acc-page .ft-main {
		--ft-shell: min(1320px, 100% - 32px);
	}
}
