/* Chronospride Store: product page (single product pages only). */

/* ---------- Price: near-black (#111); Add to cart keeps the brand blue. Sale: grey strikethrough. ----------
   The child theme's style.css forces `.single-product div.product .summary p.price, … span.price` to the brand
   blue with !important. A body-qualified selector with !important outranks that rule wherever this file loads.
   If that child theme rule is ever removed, the !important on the first two selectors can go too. */
body.single-product div.product .summary p.price,
body.single-product div.product .summary span.price {
	color: #111 !important;
}
.single-product div.product .summary .price ins,
.single-product div.product .summary .price ins .woocommerce-Price-amount,
.single-product div.product .summary .woocommerce-variation-price,
.single-product div.product .summary .woocommerce-variation-price ins,
.single-product div.product .summary .woocommerce-variation-price ins .woocommerce-Price-amount,
.single-product div.product .summary .woocommerce-variation-price .woocommerce-Price-amount {
	color: #111;
}
.single-product div.product .summary .price del,
.single-product div.product .summary .price del .woocommerce-Price-amount,
.single-product div.product .summary .woocommerce-variation-price del,
.single-product div.product .summary .woocommerce-variation-price del .woocommerce-Price-amount {
	color: #8a8a8a;
	text-decoration: line-through;
	opacity: 1;
}

/* ---------- Trust block ---------- */
.cp-trust {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 16px;
	margin: 18px 0 0;
	padding: 14px 16px;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	background: #fff;
}
.cp-trust a {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	color: #1f2933;
	text-decoration: none;
	font-size: 13.5px;
	line-height: 1.3;
	font-weight: 600;
}
.cp-trust a:hover,
.cp-trust a:focus-visible {
	text-decoration: underline;
}
.cp-trust svg {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	color: #333;
	margin-top: 1px;
}
.cp-trust small {
	display: block;
	margin-top: 2px;
	font-weight: 400;
	font-size: 12px;
	color: #5b6672;
}
@media (max-width: 544px) {
	.cp-trust {
		gap: 12px 10px;
		padding: 12px;
	}
	.cp-trust a {
		font-size: 13px;
	}
	.cp-trust small {
		display: none;
	}
	.cp-trust svg {
		flex-basis: 18px;
		width: 18px;
		height: 18px;
	}
}

/* ---------- Gallery: Flexslider paging dots, phones only; full-width image, no thumbnail column ---------- */
.woocommerce-product-gallery .flex-control-paging {
	display: none;
}
@media (max-width: 767px) {
	.woocommerce.single-product div.product div.images.woocommerce-product-gallery > #ast-gallery-thumbnails {
		display: none;
	}
	.woocommerce.single-product div.product div.images.woocommerce-product-gallery > .flex-viewport {
		width: 100%;
		margin-left: 0;
	}
	.woocommerce.single-product div.product div.images .flex-control-paging {
		display: flex;
		justify-content: center;
		gap: 4px;
		margin: 6px 0 2px;
		padding: 0;
		list-style: none;
	}
	.woocommerce.single-product div.product div.images .flex-control-paging li {
		margin: 0;
	}
	.woocommerce.single-product div.product div.images .flex-control-paging a {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 22px;
		height: 22px;
		font-size: 0;
		color: transparent;
		cursor: pointer;
	}
	.woocommerce.single-product div.product div.images .flex-control-paging a::before {
		content: "";
		display: block;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: #cfd4d9;
	}
	.woocommerce.single-product div.product div.images .flex-control-paging a.flex-active::before {
		background: #111;
	}
}

/* ---------- Gallery before the slider starts (phones) ----------
 * Until Flexslider initialises, WooCommerce lays the 2nd and later images out as a row of small tiles under
 * the first one and keeps the gallery invisible (opacity 0), so a slow phone saw a tall empty box (up to ~536px
 * for a 350px image) that then collapsed. Show the first image straight away, hide the rest until the slider
 * owns them, and reserve the paging-dots row (30px, galleries with 2+ images) so nothing moves when the slider takes over. */
@media (max-width: 767px) {
	.woocommerce.single-product div.product div.images.woocommerce-product-gallery:not(:has(> .flex-viewport)) {
		opacity: 1 !important;
	}
	/* Dots appear only when there is more than one image. */
	.woocommerce.single-product div.product div.images.woocommerce-product-gallery:not(:has(> .flex-viewport)):has(.woocommerce-product-gallery__image:nth-child(2)) {
		padding-bottom: 30px;
	}
	.woocommerce.single-product div.product div.images.woocommerce-product-gallery:not(:has(> .flex-viewport)) .woocommerce-product-gallery__image:nth-child(n+2) {
		display: none;
	}
	.woocommerce.single-product div.product div.images.woocommerce-product-gallery:not(:has(> .flex-viewport)) .woocommerce-product-gallery__image:first-child {
		width: 100%;
	}
}

/* ---------- Sticky Add to cart bar (phones) ---------- */
#cp-sticky-atc {
	display: none;
}
@media (max-width: 767px) {
	#cp-sticky-atc {
		--cp-cta: #0170b9;
		--cp-cta-text: #fff;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9990;
		align-items: center;
		gap: 12px;
		background: #fff;
		border-top: 1px solid #e5e5e5;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
	}
	#cp-sticky-atc.cp-on {
		display: flex;
	}
	#cp-sticky-atc img {
		width: 44px;
		height: 44px;
		object-fit: contain;
		border: 1px solid #eee;
		border-radius: 6px;
		background: #fff;
		flex: 0 0 44px;
	}
	#cp-sticky-atc .cp-st-t {
		flex: 1;
		min-width: 0;
	}
	#cp-sticky-atc .cp-st-t b {
		display: block;
		font-size: 13px;
		line-height: 1.25;
		font-weight: 600;
		color: #111;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	#cp-sticky-atc .cp-st-p {
		display: block;
		font-size: 15px;
		font-weight: 700;
		color: #111;
		line-height: 1.3;
	}
	#cp-sticky-atc .cp-st-p .woocommerce-Price-amount {
		color: #111;
	}
	#cp-sticky-atc .cp-st-p ins,
	#cp-sticky-atc .cp-st-p ins .woocommerce-Price-amount {
		text-decoration: none;
		color: #111;
	}
	#cp-sticky-atc .cp-st-p del,
	#cp-sticky-atc .cp-st-p del .woocommerce-Price-amount {
		font-weight: 400;
		font-size: 12px;
		color: #8a8a8a;
		opacity: 1;
		text-decoration: line-through;
	}
	#cp-sticky-atc button {
		flex: 0 0 auto;
		height: 48px;
		min-width: 132px;
		padding: 0 18px;
		border: 0;
		border-radius: 8px;
		background: var(--cp-cta);
		color: var(--cp-cta-text);
		font-size: 16px;
		font-weight: 600;
		cursor: pointer;
	}
	#cp-sticky-atc button:focus-visible {
		outline: 3px solid #111;
		outline-offset: 2px;
	}
	html.cp-sticky-on body {
		padding-bottom: 72px;
	}
	html.cp-sticky-on #ast-scroll-top {
		bottom: 84px;
	}
	.cp-pulse {
		animation: cpPulse 0.9s ease 1;
	}
	@keyframes cpPulse {
		0%, 100% { box-shadow: 0 0 0 0 rgba(1, 112, 185, 0); }
		40% { box-shadow: 0 0 0 6px rgba(1, 112, 185, 0.35); }
	}
}
@media (prefers-reduced-motion: reduce) {
	.cp-pulse {
		animation: none;
	}
}
