/* ============================================================
   BINROCK PDP — assets/css/pdp.css
   Only loaded on single product pages (is_product).
   ============================================================ */

/* ── Kill Astra's built-in sticky ATC — we use our own ── */
div.ast-sticky-add-to-cart,
.ast-sticky-add-to-cart {
	display: none !important;
}

/* ── Suppress WC add-to-cart notice on product pages ── */
.single-product .woocommerce-message,
.single-product .woocommerce-notices-wrapper .woocommerce-message {
	display: none !important;
}

/* ── Hide Code Snippets Trustpilot badge inside WC form (keep our inline badge below the button) ── */
.brx-pdp-atc-inner form .br-tp-badge {
	display: none !important;
}

/* ── Kill Astra container padding & white background on PDP ── */
.single-product #primary.content-area,
.single-product #primary {
	padding: 0 !important;
}
.single-product .ast-woocommerce-container {
	padding: 0 !important;
	background: transparent !important;
	max-width: none !important;
	box-shadow: none !important;
}

/* ── Force white page background on PDP ── */
body.single-product,
body.single-product .site-content,
body.single-product #content {
	background-color: #ffffff !important;
}

/* ── Reset Astra/WC layout on the product wrapper ── */
.woocommerce div.product.brx-pdp-wrap,
.woocommerce-page div.product.brx-pdp-wrap {
	display: block;
	padding: 0;
}

/* ── Outer padding/margin ── */
.brx-pdp-wrap {
	padding: 20px 0 60px;
}

@media (min-width: 768px) {
	.brx-pdp-wrap {
		padding: 0; /* full-viewport PDP — no outer padding */
	}
}

/* ═══════════════════════════════════════════════════════════
   3-COLUMN GRID — desktop ≥ 768 px
   Areas:  info    | gallery | atc
           accord  | gallery | atc
   ══════════════════════════════════════════════════════════= */
@media (min-width: 768px) {
	.brx-pdp {
		display: grid;
		grid-template-columns: 22% 46% 32%;
		grid-template-areas:
			"info    gallery  atc"
			"accord  gallery  atc";
		grid-template-rows: auto 1fr;
		column-gap: 32px;
		align-items: start;
		max-width: 1280px;
		margin: 0 auto;
		padding: 0 40px;
		/* Fixed viewport height: only the gallery column scrolls */
		height: calc(100vh - var(--br-topbar-h, 33px) - 64px - 44px);
		overflow: hidden;
	}

	.brx-pdp-info       { grid-area: info;    align-self: start; }
	.brx-pdp-gallery    { grid-area: gallery; align-self: stretch; }
	.brx-pdp-atc        { grid-area: atc;     align-self: stretch; }
	.brx-pdp-accordions { grid-area: accord;  align-self: start; overflow-y: auto; }
}

/* ── Mobile: flex column with custom order ── */
@media (max-width: 767px) {
	.brx-pdp {
		display: flex;
		flex-direction: column;
	}
	.brx-pdp-gallery    { order: 1; }
	.brx-pdp-info       { order: 2; padding: 16px 20px 0; }
	.brx-pdp-atc        { order: 3; padding: 0 20px; }
	.brx-pdp-accordions { order: 4; padding: 0 20px; }
}

/* ═══════════════════════════════════════════════════════════
   INFO COLUMN — breadcrumb · title · price
   ══════════════════════════════════════════════════════════= */
.brx-pdp-info .woocommerce-breadcrumb {
	font-size: 11px;
	letter-spacing: 0.08em;
	color: var(--binrock-muted);
	margin-bottom: 16px;
}

.brx-pdp-info .woocommerce-breadcrumb a {
	color: var(--binrock-muted);
	text-decoration: none;
}

.brx-pdp-info .woocommerce-breadcrumb a:hover {
	color: var(--binrock-navy);
}

.brx-pdp-title {
	font-family: 'DM Sans', sans-serif;
	font-size: 22px;
	font-weight: 300;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--binrock-navy);
	line-height: 1.25;
	margin: 0 0 12px;
}

@media (min-width: 768px) {
	.brx-pdp-title { font-size: 26px; }
}

.brx-pdp-price .price,
.brx-pdp-price .woocommerce-Price-amount {
	font-family: 'DM Sans', sans-serif;
	font-size: 18px;
	font-weight: 400;
	color: var(--binrock-navy);
	letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════
   GALLERY — vertical thumbs (desktop) / swipe (mobile)
   ══════════════════════════════════════════════════════════= */
.brx-gallery {
	display: grid;
	grid-template-columns: 68px 1fr;
	gap: 8px;
	align-items: start;
}

/* Thumbs: left vertical column */
.brx-gallery-thumbs {
	display: flex;
	flex-direction: column;
	gap: 6px;
	overflow-y: auto;
	max-height: 600px;
	scrollbar-width: thin;
	scrollbar-color: rgba(15,27,45,.2) transparent;
}

.brx-gallery-thumbs::-webkit-scrollbar { width: 3px; }
.brx-gallery-thumbs::-webkit-scrollbar-thumb { background: rgba(15,27,45,.2); }

.brx-thumb {
	display: block;
	background: #e8e4dc;
	border: 2px solid transparent;
	padding: 0;
	cursor: pointer;
	aspect-ratio: 4/5;
	overflow: hidden;
	flex-shrink: 0;
	transition: border-color 150ms ease;
}

.brx-thumb.is-active {
	border-color: var(--binrock-navy);
}

.brx-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Stage: main image */
.brx-gallery-stage {
	position: relative;
	background: #e8e4dc;
	aspect-ratio: 4/5;
	overflow: hidden;
}

.brx-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 200ms ease;
	pointer-events: none;
}

.brx-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

.brx-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Dots (mobile) */
.brx-gallery-dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	z-index: 2;
}

.brx-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(15,27,45,.25);
	transition: background 150ms ease;
}

.brx-dot.is-active {
	background: var(--binrock-navy);
}

/* ── Desktop: no thumbs, all images stacked vertically ── */
@media (min-width: 768px) {
	.brx-gallery-thumbs {
		display: none;
	}
	.brx-gallery {
		display: block;
	}
	.brx-gallery-stage {
		aspect-ratio: unset;
		overflow: visible;
		background: transparent;
		position: static;
	}
	.brx-slide {
		position: relative !important;
		inset: auto !important;
		opacity: 1 !important;
		pointer-events: auto !important;
		background: #e8e4dc;
		aspect-ratio: 4/5;
		margin-bottom: 8px;
	}
	.brx-slide:last-child {
		margin-bottom: 0;
	}
	.brx-gallery-dots {
		display: none;
	}
}

/* ── Mobile: full-width swipe, hide thumbs ── */
@media (max-width: 767px) {
	.brx-gallery {
		display: block;
	}

	.brx-gallery-thumbs {
		display: none;
	}

	.brx-gallery-stage {
		width: 100%;
		aspect-ratio: 4/5;
		border-radius: 0;
		touch-action: pan-y;
	}

	/* Slide transitions via JS translateX */
	.brx-slide {
		transition: transform 280ms ease, opacity 280ms ease;
	}
}

/* ═══════════════════════════════════════════════════════════
   ATC COLUMN — size pills · stock · button
   ══════════════════════════════════════════════════════════= */

/* Desktop: ATC fills its grid row and scrolls internally if content overflows */
@media (min-width: 768px) {
	.brx-pdp-atc {
		position: static;
		overflow-y: auto;
		padding-top: 24px;
		padding-right: 35px;
		scrollbar-width: none;
	}
	.brx-pdp-atc::-webkit-scrollbar { display: none; }

	/* Gallery: the only column that scrolls */
	.brx-pdp-gallery {
		overflow-y: auto;
		scrollbar-width: none;
	}
	.brx-pdp-gallery::-webkit-scrollbar { display: none; }

	/* Pills — compact on desktop */
	.brx-pdp-atc .brx-pills-wrap { margin-bottom: 14px; }
	.brx-pdp-atc .brx-pills-label { font-size: 10px; margin-bottom: 8px; }
	.brx-pdp-atc .brx-pills { gap: 6px; }
	.brx-pdp-atc .brx-pill {
		flex: 0 0 auto;
		min-width: 0;
		width: calc(25% - 5px); /* 4 pills per row */
		height: 30px;
		font-size: 10px;
		padding: 0 4px;
	}
}

/* Reset WC default styles inside the column */
.brx-pdp-atc .woocommerce-variation-price,
.brx-pdp-atc .quantity,
.brx-pdp-atc .variations,
.brx-pdp-atc .reset_variations,
.brx-pdp-atc .woocommerce-variation-availability p { /* shown via custom stock indicator */
	display: none !important;
}

/* Keep the add-to-cart wrap visible and full-width */
.brx-pdp-atc .woocommerce-variation-add-to-cart,
.brx-pdp-atc .cart:not(.variations_form) {
	display: block;
	width: 100%;
}

/* Stock indicator (custom span inserted by JS) */
.brx-stock-indicator {
	font-family: 'DM Sans', sans-serif;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--binrock-muted);
	margin-bottom: 12px;
}

.brx-stock-indicator.is-low {
	color: #b45309;
}

/* ── Pills wrap (injected by JS) ── */
.brx-pills-wrap {
	margin-bottom: 20px;
}

.brx-pills-label {
	font-family: 'DM Sans', sans-serif;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--binrock-muted);
	margin: 0 0 10px;
}

.brx-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.brx-pill {
	flex: 1;           /* stretch to fill available width */
	min-width: 48px;
	height: 44px;
	padding: 0 8px;
	background: transparent;
	border: 1px solid rgba(15,27,45,.25);
	color: var(--binrock-navy);
	font-family: 'DM Sans', sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.brx-pill:hover:not(.is-oos):not(.is-active) {
	border-color: var(--binrock-navy);
	background: rgba(15,27,45,.04);
}

.brx-pill.is-active {
	background: var(--binrock-navy);
	border-color: var(--binrock-navy);
	color: var(--binrock-cream);
}

.brx-pill.is-oos {
	opacity: .35;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
	cursor: not-allowed;
}

/* ── ATC Button ── */
.brx-pdp-atc .single_add_to_cart_button.button,
.brx-pdp-atc .single_add_to_cart_button.button.alt,
.brx-pdp-atc .single_add_to_cart_button.button.wc-variation-selection-needed {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	width: 100% !important;
	box-sizing: border-box;
	height: 46px;
	padding: 0 16px;
	background: var(--binrock-navy) !important;
	color: var(--binrock-cream) !important;
	border: none !important;
	border-radius: 0 !important;
	font-family: 'DM Sans', sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 200ms ease;
	margin-top: 4px;
}

.brx-pdp-atc .single_add_to_cart_button.button:hover,
.brx-pdp-atc .single_add_to_cart_button.button.alt:hover {
	background: var(--binrock-accent) !important;
	color: var(--binrock-cream) !important;
}

.brx-pdp-atc .single_add_to_cart_button.button:disabled,
.brx-pdp-atc .single_add_to_cart_button.button.alt:disabled {
	opacity: .45;
	cursor: not-allowed;
}

.brx-btn-price {
	font-size: 14px;
	font-weight: 400;
	opacity: .9;
}

.brx-btn-price .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

/* ATC button: full-width on all screen sizes */
@media (max-width: 767px) {
	.brx-pdp-atc .single_add_to_cart_button.button {
		margin-bottom: 4px;
	}
}

/* ═══════════════════════════════════════════════════════════
   ACCORDIONS
   ══════════════════════════════════════════════════════════= */
.brx-pdp-accordions {
	margin-top: 24px;
}

.brx-accord {
	border-top: 1px solid rgba(15,27,45,.12);
}

.brx-accord:last-child {
	border-bottom: 1px solid rgba(15,27,45,.12);
}

.brx-accord-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	font-family: 'DM Sans', sans-serif;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--binrock-navy);
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.brx-accord-trigger::-webkit-details-marker { display: none; }

/* Chevron via pseudo-element */
.brx-accord-trigger::after {
	content: '+';
	font-size: 18px;
	font-weight: 300;
	color: var(--binrock-navy);
	flex-shrink: 0;
	margin-left: 12px;
	transition: transform 200ms ease;
	line-height: 1;
}

.brx-accord[open] .brx-accord-trigger::after {
	content: '–';
}

.brx-accord-panel {
	padding: 0 0 18px;
	font-family: 'DM Sans', sans-serif;
	font-size: 13px;
	font-weight: 300;
	color: var(--binrock-text);
	line-height: 1.6;
}

.brx-accord-panel p {
	margin: 0 0 8px;
}

.brx-accord-panel p:last-child { margin-bottom: 0; }

/* ── Size table inside accordion ── */
.brx-size-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	margin-top: 4px;
}

.brx-size-table th {
	font-weight: 500;
	letter-spacing: 0.06em;
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid rgba(15,27,45,.15);
	color: var(--binrock-muted);
}

.brx-size-table td {
	padding: 6px 8px;
	border-bottom: 1px solid rgba(15,27,45,.07);
	color: var(--binrock-navy);
}

.brx-size-table tr:last-child td { border-bottom: none; }

.brx-size-table--height { margin-top: 12px; }

/* ═══════════════════════════════════════════════════════════
   MOBILE STICKY BAR — auto-shown by IntersectionObserver
   ══════════════════════════════════════════════════════════= */
.brx-sticky-bar {
	display: none; /* hidden on desktop */
}

@media (max-width: 767px) {
	.brx-sticky-bar {
		display: block;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 9990;
		background: transparent;
		padding: 0 0 env(safe-area-inset-bottom);
		transform: translateY(110%);
		transition: transform 280ms ease;
	}

	.brx-sticky-bar.is-visible {
		transform: translateY(0);
	}
}

/* Full-width button — inverted: cream background, navy text */
.brx-sticky-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 46px;
	padding: 0 16px;
	background: var(--binrock-cream);
	color: var(--binrock-navy);
	border: none;
	border-radius: 0;
	font-family: 'DM Sans', sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 200ms ease;
	-webkit-tap-highlight-color: transparent;
}

.brx-sticky-btn:hover,
.brx-sticky-btn:active {
	background: rgba(245,240,232,.85);
}

.brx-sticky-btn-label {
	pointer-events: none;
}

/* Price inside the sticky button */
.brx-sticky-price {
	font-size: 14px;
	font-weight: 400;
	opacity: .85;
	pointer-events: none;
}

.brx-sticky-price .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

/* ── Push qlwapp button above the sticky bar on mobile ── */
@media (max-width: 767px) {
	.single-product .qlwapp__container--bottom-right,
	.single-product .qlwapp__container--middle-right {
		bottom: 56px !important;
	}
}

/* ═══════════════════════════════════════════════════════════
   AFTER-SUMMARY ZONE (tabs, related, upsells)
   ══════════════════════════════════════════════════════════= */
.brx-pdp-wrap .woocommerce-tabs {
	margin-top: 48px;
}

.brx-pdp-wrap .related.products,
.brx-pdp-wrap .up-sells.upsells {
	margin-top: 48px;
	padding: 0 20px;
}

@media (min-width: 768px) {
	.brx-pdp-wrap .related.products,
	.brx-pdp-wrap .up-sells.upsells {
		padding: 0 40px;
		max-width: 1280px;
		margin-left: auto;
		margin-right: auto;
	}
}

/* ═══════════════════════════════════════════════════════════
   "TE PODRÍA GUSTAR" — same-category related products
   ══════════════════════════════════════════════════════════= */
.brx-related {
	margin-top: 56px;
	padding: 0 20px 0;
}

@media (min-width: 768px) {
	.brx-related {
		padding: 0 40px 0;
		max-width: 1280px;
		margin-left: auto;
		margin-right: auto;
	}
}

/* ── header row: title + arrows ── */
.brx-related-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.brx-related-title {
	font-family: 'DM Sans', sans-serif;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--binrock-navy);
	margin: 0;
}

/* ── prev/next arrow buttons ── */
.brx-related-arrows {
	display: none; /* shown ≥768px */
	gap: 4px;
}

@media (min-width: 768px) {
	.brx-related-arrows { display: flex; }
}

.brx-rc-btn {
	width:  36px;
	height: 36px;
	border: 1px solid rgba(15,27,45,.18);
	background: transparent;
	color: var(--binrock-navy);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 160ms ease, opacity 160ms ease;
}

.brx-rc-btn:hover { background: rgba(15,27,45,.06); }

.brx-rc-btn:disabled {
	opacity: .3;
	cursor: default;
}

/* ── carousel track: clips overflowing cards ── */
.brx-related-track {
	overflow: hidden;
}

/* ── scrollable grid — !important overrides Astra's .woocommerce ul.products ── */
.brx-related-grid {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 12px;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow-x: auto !important;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	scroll-behavior: smooth;
}

.brx-related-grid::-webkit-scrollbar { display: none; }

/* ── each card: 2 visible on mobile, 4 on desktop ── */
.brx-related-grid > li {
	flex: 0 0 calc(50% - 6px) !important;
	width: auto !important;
	scroll-snap-align: start;
	min-width: 0;
}

@media (min-width: 768px) {
	.brx-related-grid {
		gap: 20px;
	}
	.brx-related-grid > li {
		flex: 0 0 calc(25% - 15px) !important; /* 4 cards, 3 × 20px gaps */
	}
}

/* ═══════════════════════════════════════════════════════════
   ATC BUTTON — right-side icon + price group
   ══════════════════════════════════════════════════════════= */
.brx-btn-right {
	display: flex;
	align-items: center;
	gap: 8px;
	pointer-events: none;
	flex-shrink: 0;
}

.brx-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: .75;
}

.brx-btn-icon svg {
	display: block;
}

/* ── Trustpilot badge inside ATC column — smaller, readable ── */
.brx-pdp-atc-inner .br-tp-badge {
	padding: 6px 10px;
	gap: 6px;
	border-radius: 4px;
}
.brx-pdp-atc-inner .br-tp-badge .br-score {
	font-size: 13px;
}
.brx-pdp-atc-inner .br-tp-badge .br-count {
	font-size: 11px;
	opacity: .8;
}
.brx-pdp-atc-inner .br-tp-badge svg {
	width: 14px;
	height: 14px;
}

/* ── Trustpilot carousel — force DM Sans to match front page ── */
.br-tp-wrap,
.br-tp-wrap .br-big,
.br-tp-wrap .br-lbl,
.br-tp-wrap .br-tp-author,
.br-tp-wrap .br-tp-meta,
.br-tp-wrap .br-tp-title,
.br-tp-wrap .br-tp-text {
	font-family: 'DM Sans', sans-serif;
}

/* ═══════════════════════════════════════════════════════════
   MISC — breadcrumb separator, wc notices
   ══════════════════════════════════════════════════════════= */
.brx-pdp-wrap .woocommerce-notices-wrapper {
	padding: 0 20px;
}

@media (min-width: 768px) {
	.brx-pdp-wrap .woocommerce-notices-wrapper {
		padding: 0 40px;
		max-width: 1280px;
		margin: 0 auto;
	}
}

/* ── Size guide modal (desktop) ── */
.brx-sg-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 9999;
	align-items: center;
	justify-content: center;
}
.brx-sg-overlay.is-open { display: flex; }

.brx-sg-modal {
	position: relative;
	background: #fff;
	border-radius: 4px;
	padding: 20px;
	max-width: 520px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
}
.brx-sg-modal img { width: 100%; height: auto; display: block; }

.brx-sg-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #0f1b2d;
	padding: 0;
}

@media (min-width: 768px) {
	[data-size-guide] .brx-accord-panel { display: none !important; }
}
