/* ============================================================
   Product (single-product) — Coffs Coast Drones
   Commerce discipline: conventional layout, tokenised Woo output.
   ============================================================ */

.ccd-product { padding-block: clamp(32px, 5vw, 56px); background: var(--bg-page); }

/* ---------- Two-column grid ---------- */
.ccd-product__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr);
	gap: clamp(24px, 4vw, 56px);
	align-items: start;
}
@media (max-width: 900px) { .ccd-product__grid { grid-template-columns: 1fr; } }

/* ---------- Gallery (styles Woo's default gallery markup) ---------- */
.ccd-product__gallery { position: relative; }
.ccd-product__gallery .woocommerce-product-gallery {
	background: var(--surface-card);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md, 4px);
	padding: 16px;
	overflow: hidden;
}
.ccd-product__gallery .woocommerce-product-gallery__image img {
	border-radius: var(--radius-sm, 3px);
}
.ccd-product__gallery .flex-control-nav {
	margin-top: 12px;
	display: flex; flex-wrap: wrap; gap: 8px;
	list-style: none; padding: 0;
}
.ccd-product__gallery .flex-control-nav li { flex: 0 0 auto; }
.ccd-product__gallery .flex-control-nav img {
	border: 2px solid transparent;
	border-radius: 3px;
	cursor: pointer;
	width: 60px; height: 60px; object-fit: cover;
	opacity: .8;
	transition: border-color .15s ease, opacity .15s ease;
}
.ccd-product__gallery .flex-control-nav img:hover,
.ccd-product__gallery .flex-control-nav img.flex-active {
	border-color: var(--brand);
	opacity: 1;
}
.ccd-product__gallery .onsale {
	position: absolute; top: 16px; left: 16px;
	z-index: 2;
	background: var(--accent);
	color: var(--accent-contrast);
	font-family: var(--font-mono);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 11px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	min-width: 0; min-height: 0;
	line-height: 1;
}

/* ---------- Summary column ---------- */
.ccd-product__summary { position: sticky; top: 24px; align-self: start; }

.ccd-product__cat {
	font-family: var(--font-heading);
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-faint);
	margin: 0 0 10px;
}
.ccd-product__summary .product_title {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: clamp(24px, 3vw, 34px);
	letter-spacing: -0.015em;
	line-height: 1.2;
	color: var(--text-strong);
	margin: 0 0 16px;
	text-wrap: balance;
}
.ccd-product__summary .price {
	font-family: var(--font-mono);
	font-weight: 600;
	font-size: 28px;
	color: var(--text-strong);
	margin: 0 0 20px;
	display: block;
}
.ccd-product__summary .price ins { text-decoration: none; color: var(--accent); }
.ccd-product__summary .price del {
	color: var(--text-muted); font-weight: 400; font-size: 20px;
	margin-right: 10px;
}
.ccd-product__summary .price .amount { color: inherit; }

.ccd-product__summary .woocommerce-product-details__short-description {
	font-size: 15px; line-height: 1.65;
	color: var(--text-body);
	margin-bottom: 20px;
}
.ccd-product__summary .woocommerce-product-details__short-description p:last-child { margin-bottom: 0; }

/* Star rating */
.ccd-product__summary .woocommerce-product-rating {
	display: flex; align-items: center; gap: 8px;
	margin-bottom: 12px;
	font-size: 13px;
}
.ccd-product__summary .star-rating { color: var(--brand); }
.ccd-product__summary .woocommerce-review-link { color: var(--text-muted); text-decoration: none; }
.ccd-product__summary .woocommerce-review-link:hover { color: var(--brand); }

/* ---------- Free intro flight callout ---------- */
.ccd-intro-callout {
	display: flex; gap: 12px;
	background: var(--paddock-50);
	border: 1px solid var(--paddock-100);
	border-left: 3px solid var(--accent-2);
	border-radius: var(--radius-md, 4px);
	padding: 14px 16px;
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--text-body);
}
.ccd-intro-callout__icon {
	flex-shrink: 0;
	color: var(--accent-2);
	margin-top: 1px;
}
.ccd-intro-callout__body strong { color: var(--text-strong); }
.ccd-intro-callout__body a { color: var(--brand); text-decoration: none; border-bottom: 1px solid currentColor; }
.ccd-intro-callout__body a:hover { color: var(--accent); }

/* ---------- Add-to-cart form ---------- */
.ccd-product__summary .cart {
	display: flex; gap: 12px; align-items: stretch;
	flex-wrap: wrap;
	padding: 20px 0;
	border-top: 1px solid var(--border-subtle);
	border-bottom: 1px solid var(--border-subtle);
	margin: 0 0 20px;
}

/* Quantity stepper */
.ccd-product__summary .quantity {
	display: inline-flex; align-items: center;
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md, 4px);
	overflow: hidden;
	background: var(--surface-raised);
}
.ccd-product__summary .quantity label { display: none; }
.ccd-product__summary .quantity input.qty {
	width: 60px; height: 48px;
	border: 0; background: transparent;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 16px;
	color: var(--text-strong);
	appearance: textfield;
	-moz-appearance: textfield;
}
.ccd-product__summary .quantity input.qty::-webkit-outer-spin-button,
.ccd-product__summary .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none; margin: 0;
}
.ccd-product__summary .quantity input.qty:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* Woo's default doesn't render +/- buttons unless a plugin injects them.
   We inject via JS below (functions.php enqueues if needed). For now:
   input can be typed. Optional enhancement later. */

/* Add-to-cart button */
.ccd-product__summary .single_add_to_cart_button,
.ccd-product__summary button.button.alt {
	flex: 1 1 auto;
	min-height: 48px;
	padding: 0 24px;
	background: var(--accent);
	color: var(--accent-contrast);
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 15px;
	letter-spacing: 0.02em;
	border: 1.5px solid var(--accent);
	border-radius: var(--radius-md, 4px);
	cursor: pointer;
	transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.ccd-product__summary .single_add_to_cart_button:hover {
	background: var(--accent-strong);
	border-color: var(--accent-strong);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(176, 58, 110, .24);
}
.ccd-product__summary .single_add_to_cart_button:focus-visible {
	outline: 2px solid var(--focus-ring); outline-offset: 2px;
}

/* Stock indicator */
.ccd-product__summary .stock {
	font-family: var(--font-mono);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 4px 10px;
	display: inline-block;
	border-radius: 999px;
	margin: 0 0 16px;
}
.ccd-product__summary .stock.in-stock,
.ccd-product__summary .stock.available-on-backorder {
	background: var(--paddock-100);
	color: var(--paddock-700);
}
.ccd-product__summary .stock.out-of-stock {
	background: var(--paper-150);
	color: var(--paper-700);
}

/* Product meta (SKU / categories / tags) */
.ccd-product__summary .product_meta {
	padding-top: 16px;
	border-top: 1px solid var(--border-subtle);
	font-size: 12px;
	color: var(--text-muted);
	line-height: 1.8;
}
.ccd-product__summary .product_meta > span { display: block; }
.ccd-product__summary .product_meta .sku,
.ccd-product__summary .product_meta a {
	font-family: var(--font-mono);
	color: var(--text-body);
	text-decoration: none;
}
.ccd-product__summary .product_meta a:hover { color: var(--brand); }
.ccd-product__summary .product_meta .sku_wrapper strong,
.ccd-product__summary .product_meta .posted_in strong,
.ccd-product__summary .product_meta .tagged_as strong {
	color: var(--text-muted);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 11px;
	margin-right: 6px;
}

/* Variations (variable products) */
.ccd-product__summary table.variations {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 12px;
	margin-bottom: 16px;
}
.ccd-product__summary table.variations td.label { padding-right: 16px; vertical-align: middle; }
.ccd-product__summary table.variations td.label label {
	font-family: var(--font-heading); font-weight: 600; font-size: 14px;
	color: var(--text-strong);
	text-transform: uppercase; letter-spacing: 0.05em;
}
.ccd-product__summary table.variations td.value select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm, 3px);
	background: var(--surface-raised);
	font-family: var(--font-body); font-size: 14px;
	color: var(--text-strong);
	cursor: pointer;
}
.ccd-product__summary .reset_variations {
	font-size: 12px; color: var(--text-muted);
	text-decoration: none;
}

/* ---------- Extras (tabs + related) ---------- */
.ccd-product__extras {
	margin-top: clamp(40px, 6vw, 72px);
}

/* Woo tabs */
.ccd-product__extras .woocommerce-tabs { }
.ccd-product__extras .wc-tabs {
	display: flex; flex-wrap: wrap; gap: 4px;
	list-style: none; padding: 0; margin: 0;
	border-bottom: 1px solid var(--border-default);
}
.ccd-product__extras .wc-tabs li { margin: 0; }
.ccd-product__extras .wc-tabs li a {
	display: inline-block;
	padding: 12px 20px;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.02em;
	color: var(--text-muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: color .15s ease, border-color .15s ease;
}
.ccd-product__extras .wc-tabs li a:hover { color: var(--text-strong); }
.ccd-product__extras .wc-tabs li.active a {
	color: var(--brand);
	border-bottom-color: var(--brand);
}
.ccd-product__extras .woocommerce-Tabs-panel {
	padding: clamp(24px, 3vw, 40px) 0;
	font-size: 15px;
	line-height: 1.65;
	color: var(--text-body);
	max-width: 78ch;
}
.ccd-product__extras .woocommerce-Tabs-panel h2 {
	font-family: var(--font-heading);
	font-size: 22px;
	color: var(--text-strong);
	margin-top: 0;
}

/* Woo attribute / spec table */
.ccd-product__extras table.shop_attributes,
.ccd-product__extras .shop_attributes {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
	font-size: 14px;
}
.ccd-product__extras table.shop_attributes th,
.ccd-product__extras table.shop_attributes td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border-subtle);
	text-align: left;
	vertical-align: top;
}
.ccd-product__extras table.shop_attributes th {
	background: var(--surface-card);
	font-family: var(--font-heading);
	font-weight: 600;
	color: var(--text-strong);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 12px;
	width: 28%;
}
.ccd-product__extras table.shop_attributes td {
	font-family: var(--font-mono);
	color: var(--text-body);
}

/* Related & upsells */
.ccd-product__extras .related > h2,
.ccd-product__extras .upsells > h2 {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: clamp(20px, 2.4vw, 26px);
	color: var(--text-strong);
	margin: clamp(32px, 5vw, 56px) 0 20px;
	letter-spacing: -0.01em;
}
/* Related / upsells — 2 wide columns.
   !important is required to defeat woocommerce.css which sets
   `.woocommerce ul.products.columns-3 li.product { width: 30.79%; float:left }`
   at higher specificity. */
.ccd-product__extras .related ul.products,
.ccd-product__extras .upsells ul.products,
.ccd-product__extras section.related ul.products,
.ccd-product__extras section.up-sells ul.products {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: clamp(16px, 2vw, 32px) !important;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	width: 100% !important;
	justify-content: stretch !important;
	justify-items: stretch !important;
	text-align: left;
	float: none !important;
}
/* Kill the clearfix ::before/::after pseudo-elements that GP/Woo inject onto
   ul.products with `display: table` — inside a grid container they become
   grid items and push the real product tiles into the "wrong" cells
   (item 1 lands in row 1 col 2, item 2 wraps to row 2 col 1 — diagonal layout).
   Removing them from grid flow restores the intended 2-per-row layout. */
.ccd-product__extras .related ul.products::before,
.ccd-product__extras .related ul.products::after,
.ccd-product__extras .upsells ul.products::before,
.ccd-product__extras .upsells ul.products::after,
.ccd-product__extras section.related ul.products::before,
.ccd-product__extras section.related ul.products::after,
.ccd-product__extras section.up-sells ul.products::before,
.ccd-product__extras section.up-sells ul.products::after {
	display: none !important;
	content: none !important;
}
@media (max-width: 720px) {
	.ccd-product__extras .related ul.products,
	.ccd-product__extras .upsells ul.products {
		grid-template-columns: 1fr !important;
	}
}
.ccd-product__extras .related ul.products li.product,
.ccd-product__extras .upsells ul.products li.product,
.ccd-product__extras section.related ul.products li.product,
.ccd-product__extras section.up-sells ul.products li.product {
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	float: none !important;
	margin: 0 !important;
	padding: 20px !important;
	clear: none !important;
	display: block !important;
}

/* Bigger images now that we've got room */
.ccd-product__extras .related ul.products li.product img,
.ccd-product__extras .upsells ul.products li.product img {
	width: 100% !important;
	height: auto !important;
	max-width: 320px;
	display: block;
	margin: 0 auto 16px;
}

/* Title reads properly at 2-col width */
.ccd-product__extras .related ul.products li.product h2.woocommerce-loop-product__title,
.ccd-product__extras .upsells ul.products li.product h2.woocommerce-loop-product__title {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 17px;
	line-height: 1.35;
	color: var(--text-strong);
	margin: 0 0 8px;
	padding: 0;
	word-break: normal;
	overflow-wrap: break-word;
}
.ccd-product__extras .related ul.products li.product .price,
.ccd-product__extras .upsells ul.products li.product .price {
	font-size: 17px;
	margin: 0 0 12px;
}
.ccd-product__extras .related ul.products li.product .add_to_cart_button,
.ccd-product__extras .upsells ul.products li.product .add_to_cart_button {
	display: inline-block;
	padding: 10px 18px;
	background: var(--brand);
	color: var(--brand-contrast);
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 14px;
	border-radius: var(--radius-sm, 3px);
	text-decoration: none;
	border: none;
	cursor: pointer;
}
.ccd-product__extras .related ul.products li.product .add_to_cart_button:hover,
.ccd-product__extras .upsells ul.products li.product .add_to_cart_button:hover {
	background: var(--brand-strong);
}
.ccd-product__extras .related li.product,
.ccd-product__extras .upsells li.product {
	background: var(--surface-card);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-md, 4px);
	padding: 16px;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ccd-product__extras .related li.product:hover,
.ccd-product__extras .upsells li.product:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(20, 23, 26, .1);
	border-color: var(--border-strong);
}
.ccd-product__extras .related li.product a,
.ccd-product__extras .upsells li.product a { text-decoration: none; color: inherit; display: block; }
.ccd-product__extras .related li.product h2.woocommerce-loop-product__title,
.ccd-product__extras .upsells li.product h2.woocommerce-loop-product__title {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 15px;
	color: var(--text-strong);
	margin: 12px 0 6px;
	line-height: 1.3;
	padding: 0;
}
.ccd-product__extras .related li.product .price,
.ccd-product__extras .upsells li.product .price {
	font-family: var(--font-mono);
	font-weight: 600;
	font-size: 15px;
	color: var(--accent);
	display: block;
}
.ccd-product__extras .related li.product img,
.ccd-product__extras .upsells li.product img { width: 100%; height: auto; }

/* ---------- CASA Safety Advocate banner (product pages) ---------- */
.ccd-casa-banner {
	margin: clamp(24px, 4vw, 40px) 0;
}
.ccd-casa-banner__link {
	display: block;
	text-decoration: none;
	border-radius: var(--radius-md, 4px);
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}
.ccd-casa-banner__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(20, 23, 26, .12);
}
.ccd-casa-banner__link:focus-visible {
	outline: 2px solid var(--focus-ring); outline-offset: 3px;
}
.ccd-casa-banner__img {
	display: block;
	width: auto;
	max-width: 100%;
	height: clamp(88px, 12vw, 120px);
	object-fit: contain;
	margin-inline: auto;
	background: transparent;
}
/* Center the banner within the aside link */
.ccd-casa-banner__link { display: flex; justify-content: center; }

/* Fallback treatment when the CASA banner image asset isn't installed yet.
   Keeps the compliance requirement visibly satisfied until the real image
   ships. Uses CASA's own yellow + black colour scheme. */
.ccd-casa-banner__fallback {
	display: flex; align-items: center; gap: 20px;
	background: #FFD200;
	color: #000;
	padding: 20px 28px;
	border: 3px solid #000;
	border-radius: var(--radius-md, 4px);
	font-family: var(--font-heading);
}
.ccd-casa-banner__fallback-mark {
	font-weight: 800;
	font-size: 20px;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	line-height: 1;
	flex-shrink: 0;
	white-space: nowrap;
}
.ccd-casa-banner__fallback-x {
	display: inline-block;
	font-size: 22px;
	transform: translateY(1px);
}
.ccd-casa-banner__fallback-body {
	font-size: 14px;
	line-height: 1.5;
	font-weight: 500;
}
.ccd-casa-banner__fallback-body strong {
	text-transform: uppercase;
	letter-spacing: 0.02em;
	font-weight: 700;
}
.ccd-casa-banner__fallback-cta {
	font-weight: 600;
	white-space: nowrap;
	border-bottom: 1px solid currentColor;
}
@media (max-width: 640px) {
	.ccd-casa-banner__fallback { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* Notices (Woo add-to-cart success etc) */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	padding: 14px 18px;
	border-radius: var(--radius-md, 4px);
	border: 1px solid var(--border-default);
	background: var(--surface-card);
	font-size: 14px;
	list-style: none;
	margin-bottom: 20px;
}
.woocommerce-message { border-left: 3px solid var(--paddock-500); }
.woocommerce-info { border-left: 3px solid var(--brand); }
.woocommerce-error { border-left: 3px solid var(--danger); color: var(--danger); }
.woocommerce-message .button,
.woocommerce-info .button {
	float: right;
	font-family: var(--font-heading);
	font-size: 13px;
	font-weight: 600;
	padding: 6px 14px;
	background: var(--brand);
	color: var(--brand-contrast);
	text-decoration: none;
	border-radius: var(--radius-sm, 3px);
}

/* -------------------------------------------------------------
 * Afterpay — plugin-injected "4 payments of $X" placement on
 * product pages. Scoped defensive styling so the plugin's default
 * output lands looking native in our token system rather than as
 * an alien widget. Class names cover both current and legacy
 * variants shipped by afterpay-gateway-for-woocommerce.
 * ------------------------------------------------------------- */
.afterpay-paragraph,
.afterpay-payment-info-container,
.afterpay-installments-info,
.wc-afterpay-messaging,
.woocommerce-afterpay-installments {
	font-family: var(--font-body);
	font-size: 13px;
	line-height: 1.5;
	color: var(--text-body);
	margin: 8px 0 16px;
	padding: 0;
}
.afterpay-paragraph a,
.afterpay-installments-info a {
	color: var(--brand);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.afterpay-paragraph a:hover { color: var(--brand-strong); }
.afterpay-logo,
.afterpay-paragraph svg,
.afterpay-installments-info svg {
	vertical-align: middle;
	height: 14px;
	width: auto;
}
/* Installment amount — nudge into the mono numeric identity */
.afterpay-installment-amount,
.afterpay-installments-info strong {
	font-family: var(--font-mono);
	font-feature-settings: "tnum";
	font-weight: 600;
}
