/*
 * CrunchFit product and shop pages.
 *
 * Loaded only on single products, the shop and category archives. Woodmart
 * owns the layout; this brings its type, colour and controls in line with the
 * homepage design system without rebuilding the templates.
 *
 * Selectors are kept as tight as the parent theme allows. Where !important
 * appears it is because Woodmart sets the same property from a generated
 * per-page stylesheet that loads after this file - noted at each use.
 */

.single-product,
.woocommerce-shop,
.tax-product_cat {
	--cf-green-900: #1E2D06;
	--cf-green-800: #263907;
	--cf-kraft:     #E2B16C;
	--cf-sand:      #EADFCC;
	--cf-cream:     #F9F4E5;
	--cf-paper:     #FFFDF8;
	--cf-rust:      #C0561F;
	--cf-rust-dark: #A2461A;
	--cf-ink:       #2B2118;
	--cf-ink-soft:  #5C5044;
	--cf-radius:    4px;
}

/* ------------------------------------------------------------ typography */

.single-product .wd-single-title h1,
.single-product .product_title {
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.14;
	font-size: clamp(1.6rem, 3vw, 2.35rem);
	color: var(--cf-green-900);
}

.single-product .wd-single-short-desc p,
.single-product .woocommerce-product-details__short-description p {
	font-family: Inter, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--cf-ink-soft);
}

/* Price: the one number people came for. */
.single-product .wd-single-price .price,
.single-product .summary .price {
	font-family: Montserrat, Inter, sans-serif;
	font-size: clamp(1.5rem, 2.4vw, 1.95rem);
	font-weight: 700;
	color: var(--cf-green-800);
}

.single-product .price del {
	opacity: .45;
	font-weight: 500;
	margin-right: .45rem;
}

.single-product .price ins {
	text-decoration: none;
	color: var(--cf-rust);
}

/* --------------------------------------------------------------- buttons */

/* Woodmart paints button colours from a generated stylesheet that loads after
   this one, so the accent needs the extra weight to stick. */
.single-product .single_add_to_cart_button,
.woocommerce-shop .button.add_to_cart_button,
.tax-product_cat .button.add_to_cart_button {
	background-color: var(--cf-rust) !important;
	color: #fff !important;
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	border-radius: var(--cf-radius);
	border: 0;
}

.single-product .single_add_to_cart_button:hover,
.woocommerce-shop .button.add_to_cart_button:hover,
.tax-product_cat .button.add_to_cart_button:hover {
	background-color: var(--cf-rust-dark) !important;
}

/* The WhatsApp button from CrunchFit Core, sitting under Add to Cart. */
.single-product .cf-wa-product {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	background: #25D366;
	color: #fff;
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 600;
	font-size: .875rem;
	letter-spacing: .04em;
	padding: .95rem 1.5rem;
	border-radius: var(--cf-radius);
	text-decoration: none;
	margin-top: .65rem;
}

.single-product .cf-wa-product:hover {
	background: #1FB855;
	color: #fff;
}

/* ------------------------------------------------------- size selector */

.single-product .variations {
	margin-block: 1.25rem;
	border: 0;
}

.single-product .variations label,
.single-product .variations .label {
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 600;
	font-size: .8125rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cf-green-900);
}

.single-product .variations select {
	font-family: Inter, sans-serif;
	font-size: 1rem;
	padding: .85rem 1rem;
	border: 1px solid rgba(43,33,24,.22);
	border-radius: var(--cf-radius);
	background-color: var(--cf-paper);
	color: var(--cf-ink);
	min-height: 3rem;
}

.single-product .variations select:focus-visible {
	outline: 2px solid var(--cf-green-800);
	outline-offset: 1px;
}

/* ------------------------------------------------------------ trust row */

.cf-trust-row {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 1.15rem 1.25rem;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .9rem 1.25rem;
	background: var(--cf-cream);
	border: 1px solid rgba(43,33,24,.09);
	border-radius: var(--cf-radius);
}

.cf-trust-row li {
	display: grid;
	gap: .12rem;
	margin: 0;
	padding-left: 1.35rem;
	position: relative;
}

/* A tick drawn in CSS rather than an icon font, so it cannot fail to load. */
.cf-trust-row li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .42em;
	width: .5rem;
	height: .28rem;
	border-left: 2px solid var(--cf-green-800);
	border-bottom: 2px solid var(--cf-green-800);
	transform: rotate(-45deg);
}

.cf-trust-row strong {
	font-family: Montserrat, Inter, sans-serif;
	font-size: .875rem;
	font-weight: 600;
	color: var(--cf-green-900);
	line-height: 1.3;
}

.cf-trust-row span {
	font-size: .8125rem;
	color: var(--cf-ink-soft);
	line-height: 1.4;
}

/* The existing COD note reads as a callout rather than fine print. */
.single-product .cf-cod-note {
	margin-top: 1rem;
	padding: .95rem 1.15rem;
	background: rgba(192,86,31,.07);
	border-left: 3px solid var(--cf-rust);
	border-radius: 0 var(--cf-radius) var(--cf-radius) 0;
	font-size: .9375rem;
	line-height: 1.6;
	color: var(--cf-ink-soft);
}

.single-product .cf-cod-note strong { color: var(--cf-green-900); }

/* -------------------------------------------------------- details block */

.cf-details {
	padding-block: .5rem 0;
}

.cf-details__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: clamp(1.75rem, 4vw, 3.5rem);
	align-items: start;
}

.cf-details h2 {
	font-family: Montserrat, Inter, sans-serif;
	font-size: clamp(1.35rem, 2.2vw, 1.75rem);
	font-weight: 700;
	color: var(--cf-green-900);
	margin: 0 0 1rem;
}

.cf-details h3 {
	font-family: Montserrat, Inter, sans-serif;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--cf-green-800);
	margin: 1.6rem 0 .55rem;
}

.cf-details__aside h3:first-child { margin-top: 0; }

.cf-details p,
.cf-details li {
	font-family: Inter, sans-serif;
	font-size: 1rem;
	line-height: 1.75;
	color: var(--cf-ink-soft);
}

.cf-details__body ul {
	list-style: none;
	margin: 1.1rem 0 0;
	padding: 0;
	display: grid;
	gap: .55rem;
}

.cf-details__body li {
	position: relative;
	padding-left: 1.6rem;
}

.cf-details__body li::before {
	content: "";
	position: absolute;
	left: .1rem;
	top: .62em;
	width: .45rem;
	height: .45rem;
	border-radius: 50%;
	background: var(--cf-kraft);
}

.cf-details__aside {
	background: var(--cf-cream);
	border: 1px solid rgba(43,33,24,.09);
	border-radius: var(--cf-radius);
	padding: 1.75rem;
}

.cf-details__aside p { font-size: .9375rem; margin: 0; }

.cf-sizes {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.cf-sizes th,
.cf-sizes td {
	padding: .6rem 0;
	border-bottom: 1px solid rgba(43,33,24,.1);
	font-size: .9375rem;
	text-align: left;
}

.cf-sizes th {
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 600;
	color: var(--cf-green-900);
}

.cf-sizes td {
	text-align: right;
	color: var(--cf-ink-soft);
	font-weight: 500;
}

.cf-sizes tr:last-child th,
.cf-sizes tr:last-child td { border-bottom: 0; }

.cf-details__wa {
	display: inline-block;
	font-family: Montserrat, Inter, sans-serif;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .06em;
	color: #fff;
	background: #25D366;
	padding: .8rem 1.25rem;
	border-radius: var(--cf-radius);
	text-decoration: none;
}

.cf-details__wa:hover { background: #1FB855; color: #fff; }

/* ------------------------------------------------- shop / archive cards */

.woocommerce-shop .product-wrapper,
.tax-product_cat .product-wrapper {
	background: var(--cf-paper);
	border: 1px solid rgba(43,33,24,.08);
	border-radius: var(--cf-radius);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
}

.woocommerce-shop .product-wrapper:hover,
.tax-product_cat .product-wrapper:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(43,33,24,.13);
}

.woocommerce-shop .wd-entities-title,
.tax-product_cat .wd-entities-title {
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 600;
}

.woocommerce-shop .wd-entities-title a,
.tax-product_cat .wd-entities-title a {
	color: var(--cf-green-900);
}

.woocommerce-shop .price,
.tax-product_cat .price {
	font-family: Montserrat, Inter, sans-serif;
	font-weight: 600;
	color: var(--cf-ink-soft);
}

/* ------------------------------------------------------------- reviews */

/* A brand-new store shows "0 reviews" beside a five-row rating breakdown of
   zeros, which reads as neglect. The empty histogram is hidden; the form and
   any real reviews stay. */
.single-product .wd-single-reviews .wd-rating-summary:has(.wd-rating-count-0),
.single-product .wd-reviews-empty-histogram {
	display: none;
}

.single-product #reviews h2,
.single-product .wd-single-reviews h2,
.single-product .wd-single-reviews h3 {
	font-family: Montserrat, Inter, sans-serif;
	color: var(--cf-green-900);
}

/* --------------------------------------------------------- breakpoints */

@media (max-width: 1024px) {
	.cf-details__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
	.cf-trust-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce-shop .product-wrapper,
	.tax-product_cat .product-wrapper { transition: none; }
}
