/* BCC PDP — mobile-first, industrial navy + amber palette */

:root {
	--bcc-navy: #0F2540;
	--bcc-navy-light: #1B3A60;
	--bcc-amber: #C28A2C;
	--bcc-amber-dark: #9C6E1F;
	--bcc-cream: #F7F1E3;
	--bcc-ink: #0B1A2E;
	--bcc-grey: #5C6675;
	--bcc-grey-light: #E5E7EB;
	--bcc-success: #2D7A4A;
	--bcc-radius: 6px;
	--bcc-shadow-sm: 0 1px 3px rgba(15,37,64,0.08);
	--bcc-shadow-md: 0 4px 12px rgba(15,37,64,0.12);
	--bcc-whatsapp: #25D366;
}

.pdp { display: block; color: var(--bcc-ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.pdp h1, .pdp h2, .pdp h3 { color: var(--bcc-navy); margin: 0 0 .5em; line-height: 1.2; }
.pdp h1 { font-size: 1.6rem; }
.pdp h2 { font-size: 1.25rem; margin-top: 1.5rem; }
.pdp h3 { font-size: 1.05rem; }
.pdp p { line-height: 1.55; margin: 0 0 1em; }

/* Buttons */
.btn { display: inline-block; padding: .75rem 1.25rem; border-radius: var(--bcc-radius); font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; line-height: 1.1; text-align: center; }
.btn--primary { background: var(--bcc-amber); color: var(--bcc-ink); }
.btn--primary:hover { background: var(--bcc-amber-dark); color: #fff; }
.btn--secondary { background: transparent; color: var(--bcc-navy); border: 2px solid var(--bcc-navy); }
.btn--secondary:hover { background: var(--bcc-navy); color: #fff; }
.btn--whatsapp { background: var(--bcc-whatsapp); color: #fff; }
.btn--whatsapp:hover { background: #1da851; color: #fff; }

/* Layout shell */
.pdp__hero { padding: 24px 16px; background: var(--bcc-cream); }
.pdp__trust { padding: 12px 16px; background: var(--bcc-navy); color: #fff; }
.pdp__body { display: grid; gap: 24px; padding: 24px 16px; max-width: 1280px; margin: 0 auto; }
.pdp__rail { display: contents; }

@media (min-width: 768px) {
	.pdp h1 { font-size: 2.2rem; }
	.pdp__hero { padding: 48px 40px; min-height: 480px; }
	.pdp__body { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; padding: 32px 40px; }
	.pdp__rail { display: block; position: sticky; top: 24px; }
}

/* Hero */
.pdp-hero { display: grid; gap: 24px; max-width: 1280px; margin: 0 auto; }
.pdp-hero__media img, .pdp-hero__placeholder { width: 100%; aspect-ratio: 1/1; max-height: 360px; object-fit: cover; background: #fff; border-radius: var(--bcc-radius); }
.pdp-hero__placeholder { background: linear-gradient(135deg, var(--bcc-grey-light), #fff); }
.pdp-chip { display: inline-block; background: var(--bcc-amber); color: var(--bcc-ink); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 3px; letter-spacing: .05em; }
.pdp-hero__summary { color: var(--bcc-grey); font-size: 1rem; }
.pdp-hero__ctas { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
@media (min-width: 768px) {
	.pdp-hero { grid-template-columns: 1fr 1fr; align-items: center; }
	.pdp-hero__ctas { flex-direction: row; }
}

/* Trust strip */
.trust-strip { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: center; max-width: 1280px; margin: 0 auto; font-size: .9rem; }
.trust-strip li::before { content: "✓ "; color: var(--bcc-amber); font-weight: 700; }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--bcc-shadow-sm); border-radius: var(--bcc-radius); overflow: hidden; }
.spec-table th, .spec-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--bcc-grey-light); font-size: .95rem; }
.spec-table th { background: var(--bcc-cream); color: var(--bcc-navy); font-weight: 600; width: 40%; }

/* Pricing calculator */
.quote-calc { background: #fff; padding: 20px; border-radius: var(--bcc-radius); box-shadow: var(--bcc-shadow-md); border-top: 4px solid var(--bcc-amber); }
.quote-calc h2 { margin-top: 0; font-size: 1.1rem; }
.quote-calc__anchor { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: -4px -4px 14px; background: linear-gradient(180deg, rgba(194,138,44,0.08) 0%, rgba(194,138,44,0.02) 100%); border-radius: 8px; border: 1px solid rgba(194,138,44,0.25); }
.quote-calc__anchor-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6B4920; }
.quote-calc__anchor-price { font-size: 1.35rem; font-weight: 800; color: #16243a; line-height: 1.1; }
.quote-calc__anchor-fineprint { font-size: 11px; color: #6B7C8D; font-style: italic; line-height: 1.4; margin-top: 2px; }
.quote-calc__label { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin: 10px 0 4px; }
.quote-calc__range { width: 100%; }
.quote-calc__pallets { font-weight: 700; color: var(--bcc-amber-dark); font-size: 1.2rem; }
.quote-calc__region { width: 100%; padding: 8px; border: 1px solid var(--bcc-grey-light); border-radius: var(--bcc-radius); margin-top: 4px; }
.quote-calc__fit, .quote-calc__delivery { font-size: .9rem; color: var(--bcc-grey); margin: 8px 0; }
.quote-calc__cta { width: 100%; margin-top: 12px; }

/* Delivery panel */
.delivery-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.delivery-panel dt { font-weight: 700; color: var(--bcc-navy); }
.delivery-panel dd { margin: 0; }

/* Cert carousel */
.cert-carousel__track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.cert-card { flex: 0 0 140px; padding: 16px; background: var(--bcc-cream); border-radius: var(--bcc-radius); text-decoration: none; color: var(--bcc-navy); text-align: center; scroll-snap-align: start; border: 1px solid var(--bcc-grey-light); }
.cert-card__name { display: block; font-weight: 700; }
.cert-card__pdf { display: block; margin-top: 4px; font-size: .75rem; color: var(--bcc-grey); }

/* Use cases */
.use-case-grid__cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
.use-card { background: #fff; padding: 16px; border-radius: var(--bcc-radius); box-shadow: var(--bcc-shadow-sm); }
.use-card h3 { font-size: 1rem; margin-bottom: 6px; }
.use-card a { color: var(--bcc-amber-dark); font-weight: 600; text-decoration: none; }
@media (min-width: 768px) { .use-case-grid__cards { grid-template-columns: repeat(3, 1fr); } }

/* Compat matrix */
.compat-matrix table { width: 100%; border-collapse: collapse; }
.compat-matrix th, .compat-matrix td { padding: 10px; border: 1px solid var(--bcc-grey-light); text-align: left; }
.compat-matrix th { background: var(--bcc-cream); }

/* Container fit */
.container-fit__grid { width: 100%; max-width: 360px; height: auto; }
.container-fit__grid rect { fill: var(--bcc-grey-light); stroke: var(--bcc-navy); stroke-width: 1; }
.container-fit__grid rect.is-filled { fill: var(--bcc-amber); }
.container-fit__caption { font-weight: 600; color: var(--bcc-navy); margin-top: 8px; }

/* Safety */
.safety-panel { background: #fff8e6; border-left: 4px solid var(--bcc-amber); padding: 16px; border-radius: var(--bcc-radius); }
.safety-list { padding-left: 1.2em; }
.safety-list li { margin-bottom: 4px; }

/* Reviews */
.reviews { background: #fff; padding: 20px; border-radius: var(--bcc-radius); box-shadow: var(--bcc-shadow-sm); }
.reviews__empty { padding: 16px; background: var(--bcc-cream); border-radius: var(--bcc-radius); text-align: center; }
.reviews__empty strong { display: block; font-size: 1.1rem; color: var(--bcc-navy); margin-bottom: 4px; }

/* FAQ */
.faq details { background: #fff; padding: 12px 16px; border-radius: var(--bcc-radius); margin-bottom: 8px; box-shadow: var(--bcc-shadow-sm); border-left: 3px solid var(--bcc-amber); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--bcc-navy); }
.faq summary::-webkit-details-marker { color: var(--bcc-amber); }

/* Related */
.related-products__grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.related-card { display: block; padding: 16px; background: #fff; border-radius: var(--bcc-radius); text-decoration: none; color: var(--bcc-navy); box-shadow: var(--bcc-shadow-sm); }
.related-card strong { display: block; margin-bottom: 4px; }
.related-card small { color: var(--bcc-grey); }
@media (min-width: 768px) { .related-products__grid { grid-template-columns: repeat(3, 1fr); } }

/* Internal links */
.pdp-links { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; background: var(--bcc-cream); border-radius: var(--bcc-radius); }
.pdp-links a { color: var(--bcc-navy); font-weight: 600; }

/* Final CTA */
.final-cta { text-align: center; padding: 32px 16px; background: var(--bcc-navy); color: #fff; border-radius: var(--bcc-radius); margin-top: 24px; }
.final-cta h2 { color: #fff; }
.final-cta .btn { margin: 6px; }
.final-cta .btn--secondary { color: #fff; border-color: #fff; }
.final-cta .btn--secondary:hover { background: #fff; color: var(--bcc-navy); }

/* RFQ drawer */
.bcc-rfq-drawer { position: fixed; bottom: 0; right: 0; left: 0; background: #fff; box-shadow: 0 -4px 24px rgba(0,0,0,0.15); padding: 16px; transform: translateY(100%); transition: transform .25s ease; z-index: 9999; max-height: 60vh; overflow-y: auto; }
.bcc-rfq-drawer.is-open { transform: translateY(0); }
.bcc-rfq-drawer h3 { margin-top: 0; }
.bcc-rfq-drawer__list { list-style: none; padding: 0; margin: 0 0 12px; }
.bcc-rfq-drawer__list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--bcc-grey-light); }
.bcc-rfq-drawer__list button { background: transparent; border: 0; color: var(--bcc-grey); cursor: pointer; }
.bcc-rfq-toggle { position: fixed; bottom: 16px; right: 16px; background: var(--bcc-amber); color: var(--bcc-ink); border-radius: 50%; width: 56px; height: 56px; box-shadow: var(--bcc-shadow-md); border: 0; cursor: pointer; font-weight: 700; z-index: 9998; }
.bcc-rfq-toggle__badge { position: absolute; top: -4px; right: -4px; background: var(--bcc-navy); color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: .75rem; display: flex; align-items: center; justify-content: center; }

@media (min-width: 768px) {
	.bcc-rfq-drawer { left: auto; width: 380px; max-height: 70vh; border-radius: var(--bcc-radius) 0 0 0; }
}

/* ============================================================
   MOBILE FIXES (<=767px) — May 28 sweep
   Tables get horizontal-scroll with swipe affordance.
   Layout tightens, fonts step down, CTAs go full-width.
   ============================================================ */
@media (max-width: 767px) {
	/* Tighter section padding so cards aren't squashed against edges */
	.pdp__body { padding: 16px 12px; gap: 18px; }
	.pdp__hero { padding: 20px 14px; }
	.pdp__trust { padding: 10px 14px; }
	.pdp h1 { font-size: 1.35rem; line-height: 1.25; }
	.pdp h2 { font-size: 1.1rem; margin-top: 1.1rem; }
	.pdp h3 { font-size: 1rem; }
	.pdp p { font-size: .95rem; }

	/* Spec table & compatibility matrix — horizontally scrollable
	   with sticky swipe indicator at the bottom */
	.spec-table-wrap,
	.compat-matrix {
		width: 100%; max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		border-radius: var(--bcc-radius);
		border: 1px solid var(--bcc-grey-light);
		position: relative;
		background:
			linear-gradient(to right, #fff, #fff) left center / 20px 100% no-repeat,
			linear-gradient(to right, rgba(15,37,64,.12), rgba(15,37,64,0)) left center / 12px 100% no-repeat,
			linear-gradient(to left,  rgba(15,37,64,.12), rgba(15,37,64,0)) right center / 12px 100% no-repeat,
			#fff;
		background-attachment: local, scroll, scroll, local;
	}
	.spec-table-wrap::after,
	.compat-matrix::after {
		content: '\2190 swipe \2192';
		display: block; text-align: center;
		font-size: .72rem; color: #7a8aa3;
		padding: .3rem 0; background: #f5f7fa;
		border-top: 1px solid #e1e6ee;
		font-style: italic;
		position: sticky; bottom: 0;
	}
	.spec-table,
	.compat-matrix table {
		min-width: 480px;
		font-size: .85rem;
		box-shadow: none;
		border-radius: 0;
	}
	.spec-table th, .spec-table td,
	.compat-matrix th, .compat-matrix td {
		padding: 8px 10px;
		word-break: normal;
	}
	.spec-table th { width: auto; min-width: 130px; white-space: nowrap; }

	/* Delivery panel: long region values can overflow the auto/1fr grid
	   on small screens. Stack vertically and keep dt as label above dd. */
	.delivery-panel dl { grid-template-columns: 1fr; gap: 2px 0; }
	.delivery-panel dt { margin-top: 10px; }
	.delivery-panel dt:first-of-type { margin-top: 0; }

	/* Quote calculator — fit 320px viewports */
	.quote-calc { padding: 16px 14px; }
	.quote-calc h2 { font-size: 1rem; }
	.quote-calc__anchor { padding: 10px 12px; margin: -2px -2px 12px; }
	.quote-calc__anchor-price { font-size: 1.2rem; }

	/* Trust strip — tighter wrap */
	.trust-strip { gap: 6px 14px; font-size: .82rem; }

	/* Hero image height cap so it doesn't dominate the fold */
	.pdp-hero__media img,
	.pdp-hero__placeholder { max-height: 280px; }

	/* CTAs go full-width on mobile */
	.pdp-hero__ctas .btn { width: 100%; }

	/* Final CTA */
	.final-cta { padding: 24px 14px; }
	.final-cta .btn { width: 100%; margin: 4px 0; }

	/* Internal-link pile */
	.pdp-links { gap: 8px 14px; padding: 14px; font-size: .9rem; }

	/* Cert carousel: smaller cards on narrow screens */
	.cert-card { flex: 0 0 120px; padding: 12px; }

	/* RFQ floating toggle: lift above potential WhatsApp FAB stack */
	.bcc-rfq-toggle { bottom: 80px; }

	/* Safety + reviews boxes — tighten inner padding */
	.safety-panel,
	.reviews { padding: 14px; }
	.reviews__empty { padding: 12px; }

	/* FAQ details — smaller summary text */
	.faq details { padding: 10px 12px; }
	.faq summary { font-size: .95rem; }
}

/* ============================================================
   HARD MOBILE OVERFLOW GUARDRAILS (<=767px)
   Forces every PDP element to respect viewport width.
   Catches long URLs, unbroken strings, edge-anchored content.
   ============================================================ */
@media (max-width: 767px) {
	/* PDP root + every direct child constrained */
	.pdp, .pdp__hero, .pdp__trust, .pdp__body,
	.pdp__main, .pdp__rail {
		max-width: 100vw;
		overflow-x: hidden;
		box-sizing: border-box;
	}
	/* Block-level content respects width + breaks long words/URLs */
	.pdp section,
	.pdp article,
	.pdp aside,
	.pdp div,
	.pdp p,
	.pdp li,
	.pdp dd,
	.pdp dt {
		max-width: 100%;
		overflow-wrap: break-word;
		word-wrap: break-word;
		-ms-word-break: break-all;
		word-break: break-word;
		hyphens: auto;
	}
	.pdp a { word-break: break-word; }
	/* Images + videos can never exceed viewport */
	.pdp img,
	.pdp svg,
	.pdp video,
	.pdp iframe {
		max-width: 100%;
		height: auto;
	}
	/* Pre / code blocks scroll instead of overflow */
	.pdp pre, .pdp code {
		max-width: 100%;
		overflow-x: auto;
		white-space: pre-wrap;
		word-break: break-word;
	}
	/* Range slider sometimes pokes past container on iOS */
	.quote-calc__range {
		max-width: 100%;
		box-sizing: border-box;
	}
	/* Cert carousel — its track has overflow-x but the section itself
	   needs to clip too so the right-edge isn't lifting */
	.cert-carousel { max-width: 100%; overflow-x: hidden; }
	/* Related-products & use-cases grids */
	.related-products__grid,
	.use-case-grid__cards {
		max-width: 100%;
		width: 100%;
	}
	/* Final CTA padding wasn't covering corners */
	.final-cta { margin-left: 0; margin-right: 0; }
}

/* Belt-and-braces: make sure the HTML root itself doesn't allow
   horizontal scroll caused by any errant child on narrow viewports. */
@media (max-width: 767px) {
	html, body { overflow-x: hidden; }
}

/* Extra-tight guardrail (<=380px viewports — older / budget phones) */
@media (max-width: 380px) {
	.pdp h1 { font-size: 1.2rem; }
	.pdp h2 { font-size: 1.02rem; }
	.spec-table,
	.compat-matrix table { font-size: .8rem; min-width: 420px; }
	.spec-table th, .spec-table td,
	.compat-matrix th, .compat-matrix td { padding: 7px 8px; }
	.quote-calc { padding: 14px 12px; }
	.quote-calc__anchor-price { font-size: 1.1rem; }
	.btn { padding: .7rem 1rem; font-size: .95rem; }
}
