/* WooCommerce's own core rule is ".woocommerce .woocommerce-breadcrumb"
   (2 classes). This selector uses 3 real classes already present on the
   element/ancestor (body.woocommerce is added by WooCommerce itself) to
   outrank it on genuine specificity — no !important needed. */
/* ---------- Gallery + Info ---------- */

.cp-pdp__main {
	padding-top: 36px;
	padding-bottom: 100px;
	display: grid;
	grid-template-columns: 0.95fr 1.05fr;
	gap: 70px;
	align-items: flex-start;
}

.cp-pdp__gallery {
	position: sticky;
	top: 110px;
}

.cp-pdp__main-image {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: var(--cp-radius-lg);
	overflow: hidden;
	background: radial-gradient(ellipse at 50% 78%, rgba(18, 59, 42, 0.55), rgba(10, 10, 10, 0.95));
	border: 1px solid var(--cp-border);
}

.cp-pdp__main-image-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cp-pdp__image-placeholder {
	width: 100%;
	height: 100%;
}

.cp-pdp__purity-badge {
	position: absolute;
	top: 18px;
	left: 18px;
	z-index: 1;
	background: rgba(4, 18, 10, 0.75);
	border: 1px solid var(--cp-accent-border);
	color: var(--cp-accent);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	padding: 6px 13px;
	border-radius: var(--cp-radius-pill);
	backdrop-filter: blur(6px);
}

.cp-pdp__thumbs {
	display: flex;
	gap: 14px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.cp-pdp__thumb {
	width: 88px;
	height: 88px;
	flex-shrink: 0;
	padding: 0;
	border-radius: var(--cp-radius-md);
	overflow: hidden;
	background: var(--cp-surface);
	border: 1px solid var(--cp-border);
	cursor: pointer;
	transition: border-color 0.25s ease;
}

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

.cp-pdp__thumb:hover,
.cp-pdp__thumb:focus-visible {
	border-color: var(--cp-accent-border);
}

.cp-pdp__thumb.is-active {
	border-color: var(--cp-accent);
}

.cp-pdp__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--cp-accent-border);
	border-radius: var(--cp-radius-pill);
	padding: 7px 16px;
	font-size: 11.5px;
	letter-spacing: 0.16em;
	color: var(--cp-accent);
	font-weight: 600;
	margin-bottom: 22px;
	background: rgba(88, 211, 107, 0.05);
}

.cp-pdp__badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cp-accent-bright);
	box-shadow: 0 0 8px var(--cp-accent-bright);
	flex-shrink: 0;
}

.cp-pdp__title {
	font-family: var(--cp-font-heading);
	font-weight: 600;
	font-size: clamp(30px, 3vw, 42px);
	line-height: 1.1;
	margin: 0 0 10px;
	letter-spacing: -0.02em;
}

.cp-pdp__meta {
	color: var(--cp-text-dim);
	font-size: 14.5px;
	margin-bottom: 22px;
}

.cp-pdp__price-row {
	display: flex;
	align-items: baseline;
	gap: 14px;
	margin-bottom: 26px;
	flex-wrap: wrap;
}

.cp-pdp__price {
	font-family: var(--cp-font-heading);
	font-weight: 600;
	font-size: 32px;
}

.cp-pdp__price .price {
	display: inline-flex;
	align-items: baseline;
	gap: 12px;
}

.cp-pdp__price del {
	color: var(--cp-text-faint);
	font-size: 0.5em;
	font-weight: 400;
	opacity: 1;
}

.cp-pdp__price ins {
	text-decoration: none;
}

.cp-pdp__save {
	color: var(--cp-accent);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
}

.cp-pdp__description {
	color: var(--cp-text-muted);
	font-size: 15.5px;
	line-height: 1.75;
	max-width: 520px;
	margin: 0 0 30px;
}

.cp-pdp__description p:last-child {
	margin-bottom: 0;
}

.cp-pdp__stats {
	display: flex;
	gap: 34px;
	margin-bottom: 32px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--cp-border);
	flex-wrap: wrap;
}

.cp-pdp__stat-value {
	font-family: var(--cp-font-heading);
	font-weight: 600;
	font-size: 18px;
}

.cp-pdp__stat-label {
	font-size: 11.5px;
	color: var(--cp-text-dim);
	letter-spacing: 0.06em;
	margin-top: 4px;
}

.cp-pdp__bullets {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 44px;
}

.cp-pdp__bullet {
	display: flex;
	gap: 12px;
	align-items: center;
	font-size: 15px;
	color: #d6d6d6;
}

.cp-pdp__bullet-glyph {
	display: flex;
	color: var(--cp-accent);
	flex-shrink: 0;
}

/* ---------- WooCommerce's own add-to-cart form ----------
   WooCommerce's core CSS styles these same elements directly (verified
   against its actual source, plugins/woocommerce/client/legacy/css/
   woocommerce.scss): the deepest-competing rule is
   ".woocommerce div.product form.cart div.quantity" (4 classes, 3 elements),
   and ".woocommerce .quantity .qty" (3 classes). The button rule is wrapped
   in :where(), which always contributes zero specificity — WooCommerce did
   that deliberately so themes can win without !important.

   ".cp-pdp.product" below is real, not decorative: wc_product_class() adds
   the "product" class to our own wrapper div, and "body.woocommerce" is
   added by WooCommerce itself — chaining them onto our own classes reliably
   out-classes WooCommerce's core rules by plain specificity, no !important
   anywhere in this file. */

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-bottom: 14px;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .quantity {
	display: flex;
	align-items: center;
	gap: 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: var(--cp-radius-pill);
	padding: 6px 10px;
	flex-shrink: 0;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .cp-qty-btn {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: none;
	background: transparent;
	color: var(--cp-text);
	font-size: 16px;
	line-height: 1;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease;
	padding: 0;
	flex-shrink: 0;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .cp-qty-btn:hover,
body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .cp-qty-btn:focus-visible {
	color: var(--cp-accent);
	background: rgba(88, 211, 107, 0.07);
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .quantity .qty {
	width: 34px;
	height: auto;
	border: none;
	background: transparent;
	color: var(--cp-text);
	font-family: var(--cp-font-body);
	font-size: 14.5px;
	font-weight: 600;
	text-align: center;
	box-sizing: border-box;
	padding: 0;
	-moz-appearance: textfield;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .qty::-webkit-outer-spin-button,
body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .single_add_to_cart_button {
	flex: 1;
	min-width: 200px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(160deg, var(--cp-accent), var(--cp-accent-dark));
	color: var(--cp-accent-ink);
	font-family: var(--cp-font-body);
	font-weight: 700;
	font-size: 14.5px;
	letter-spacing: 0.03em;
	padding: 16px 34px;
	border-radius: var(--cp-radius-pill);
	border: none;
	box-shadow: var(--cp-shadow-glow);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .single_add_to_cart_button:hover,
body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .single_add_to_cart_button:focus-visible {
	color: var(--cp-accent-ink);
	transform: translateY(-2px);
	box-shadow: 0 12px 42px rgba(88, 211, 107, 0.42);
}

/* WooCommerce's own .loading::after spinner is positioned at a fixed
   `right: 1em` (by design — text stays visible on the left while it spins),
   which reads as off-center on this wide, center-aligned pill button.
   Recenter it directly over the button instead — and hide the button's own
   text while loading, since centering both text and spinner on the same
   point makes them visually collide ("Add t[spinner]cart"). */
body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .single_add_to_cart_button.loading {
	color: transparent;
}

body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .single_add_to_cart_button.loading::after {
	top: 50%;
	right: auto;
	left: 50%;
	transform: translate(-50%, -50%);
	color: var(--cp-accent-ink);
}

.cp-pdp__add-to-cart table.variations {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 18px;
}

.cp-pdp__add-to-cart table.variations tr {
	display: block;
	margin-bottom: 12px;
}

.cp-pdp__add-to-cart table.variations label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--cp-text-muted);
	margin-bottom: 8px;
	text-transform: uppercase;
}

.cp-pdp__add-to-cart table.variations select {
	width: 100%;
	max-width: 320px;
	padding: 12px 16px;
	border-radius: var(--cp-radius-md);
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: var(--cp-bg-alt);
	color: var(--cp-text);
	font-family: var(--cp-font-body);
	font-size: 14px;
}

.cp-pdp__add-to-cart .reset_variations {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	color: var(--cp-text-dim);
}

.cp-pdp__add-to-cart .woocommerce-variation-price .price {
	font-family: var(--cp-font-heading);
	font-weight: 600;
	font-size: 24px;
}

.cp-pdp__add-to-cart .woocommerce-variation-availability {
	font-size: 13px;
	color: var(--cp-text-dim);
	margin-bottom: 12px;
}

.cp-pdp__add-to-cart p.stock {
	font-size: 13px;
	color: var(--cp-text-dim);
}

.cp-pdp__add-to-cart p.stock.out-of-stock {
	color: #e07a7a;
}

/* ---------- Tabs ---------- */

.cp-pdp__tabs-section {
	padding-bottom: 0;
}

.cp-pdp__tabs {
	display: flex;
	gap: 36px;
	border-bottom: 1px solid var(--cp-border);
	margin-bottom: 40px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cp-pdp__tab {
	background: transparent;
	border: none;
	color: var(--cp-text-dim);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.03em;
	padding: 18px 4px;
	border-bottom: 2px solid transparent;
	transition: color 0.25s ease, border-color 0.25s ease;
	white-space: nowrap;
	cursor: pointer;
}

.cp-pdp__tab:hover,
.cp-pdp__tab:focus-visible {
	color: var(--cp-text);
}

.cp-pdp__tab.is-active {
	color: var(--cp-text);
	border-color: var(--cp-accent);
}

.cp-pdp__tab-panel[hidden] {
	display: none;
}

.cp-pdp__tab-grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 70px;
}

.cp-pdp__long-description {
	color: var(--cp-text-muted);
	font-size: 15.5px;
	line-height: 1.8;
	margin: 0 0 20px;
}

.cp-pdp__spec-table {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cp-pdp__spec-row {
	display: flex;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid var(--cp-border-soft);
	gap: 16px;
}

.cp-pdp__spec-label {
	color: var(--cp-text-dim);
	font-size: 13.5px;
}

.cp-pdp__spec-value {
	font-size: 13.5px;
	font-weight: 600;
	text-align: right;
}

.cp-pdp__coa-card {
	background: linear-gradient(180deg, var(--cp-surface), var(--cp-surface-soft));
	border: 1px solid var(--cp-border);
	border-radius: var(--cp-radius-lg);
	padding: 32px;
	backdrop-filter: blur(12px);
	height: fit-content;
}

.cp-pdp__coa-title {
	font-family: var(--cp-font-heading);
	font-weight: 600;
	font-size: 16px;
	margin-bottom: 16px;
}

.cp-pdp__coa-text {
	color: #9a9a9a;
	font-size: 13.5px;
	line-height: 1.7;
	margin: 0 0 20px;
}

.cp-pdp__coa-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	color: var(--cp-accent);
	font-family: var(--cp-font-body);
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.06em;
	border: 1px solid var(--cp-accent-border);
	padding: 12px 22px;
	border-radius: var(--cp-radius-pill);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.cp-pdp__coa-link:hover,
.cp-pdp__coa-link:focus-visible {
	background: var(--cp-accent);
	color: var(--cp-accent-ink);
}

.cp-pdp__coa-unavailable {
	color: var(--cp-text-faint);
	font-size: 13.5px;
}

/* ---------- COA tab: inline thumbnail ---------- */

.cp-pdp__coa-thumb {
	display: block;
	position: relative;
	width: 100%;
	max-width: 360px;
	padding: 0;
	border: 1px solid var(--cp-border);
	border-radius: var(--cp-radius-md);
	overflow: hidden;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.02);
	margin: 0 0 16px;
	transition: border-color 0.25s ease;
}

.cp-pdp__coa-thumb:hover,
.cp-pdp__coa-thumb:focus-visible {
	border-color: var(--cp-accent-border);
}

.cp-pdp__coa-thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.cp-pdp__coa-thumb-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.cp-pdp__coa-thumb:hover .cp-pdp__coa-thumb-overlay,
.cp-pdp__coa-thumb:focus-visible .cp-pdp__coa-thumb-overlay {
	opacity: 1;
}

/* ---------- COA popup ---------- */

.cp-coa-modal {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.cp-coa-modal.is-open {
	opacity: 1;
	pointer-events: auto;
}

.cp-coa-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.cp-coa-modal__dialog {
	position: relative;
	z-index: 1;
	max-width: min(720px, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	transform: scale(0.96) translateY(8px);
	transition: transform 0.25s ease;
}

.cp-coa-modal.is-open .cp-coa-modal__dialog {
	transform: scale(1) translateY(0);
}

.cp-coa-modal__image {
	max-width: 100%;
	max-height: 72vh;
	width: auto;
	height: auto;
	border-radius: var(--cp-radius-md);
	border: 1px solid var(--cp-border);
	background: #fff;
}

.cp-coa-modal__close {
	position: absolute;
	top: -18px;
	right: -18px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--cp-bg-alt);
	border: 1px solid var(--cp-border);
	color: var(--cp-text);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.cp-coa-modal__close:hover,
.cp-coa-modal__close:focus-visible {
	background: var(--cp-accent);
	border-color: var(--cp-accent);
	color: var(--cp-accent-ink);
}

body.cp-coa-modal-open {
	overflow: hidden;
}

@media (max-width: 560px) {
	.cp-coa-modal__close {
		top: 0;
		right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cp-coa-modal,
	.cp-coa-modal__dialog,
	.cp-pdp__coa-thumb-overlay {
		transition-duration: 0.001ms;
	}
}

/* ---------- Related products ----------
   Unlike the homepage's Featured Products (always exactly 4 items, so the
   shared .cp-product-grid's fixed 4-column layout always fills edge to
   edge), related products can return anywhere from 0-4 items depending on
   category overlap. Scoped to .cp-pdp__related only, so the homepage grid
   is untouched.

   auto-fit's repeat count is computed using the minmax() MAX bound (300px)
   when both bounds are fixed lengths, not the min — so at this theme's
   1240px content width with a 26px gap, minmax(260px, 300px) only fit 3
   tracks (4 × 300px + 3 × 26px = 1278px > 1240px), pushing a 4th card onto
   its own row. Capping the max at 290px keeps 4 × 290px + 3 × 26px =
   1238px, just inside the container, so 4 related products fill one row. */
.cp-pdp__related .cp-product-grid {
	grid-template-columns: repeat(auto-fit, minmax(260px, 290px));
	justify-content: start;
}

@media (max-width: 560px) {
	.cp-pdp__related .cp-product-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
	.cp-pdp__main {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.cp-pdp__gallery {
		position: static;
	}

	.cp-pdp__tab-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}

@media (max-width: 640px) {
	.cp-pdp__main {
		padding-top: 24px;
		padding-bottom: 60px;
	}

	.cp-pdp__thumb {
		width: 68px;
		height: 68px;
	}

	.cp-pdp__stats {
		gap: 22px;
	}

	body.woocommerce .cp-pdp.product .cp-pdp__add-to-cart .single_add_to_cart_button {
		min-width: 100%;
	}

	.cp-pdp__tabs {
		padding-bottom: 10px;
	}

	.cp-pdp__tab {
		padding: 10px 4px;
	}
}
