/**
 * Tradeprint For WooCommerce — Public Styles
 *
 * Modern defaults inspired by best-in-class Tradeprint sites.
 * Theme CSS and custom CSS override these via normal cascade.
 */

/* ───────────────────────────────────────────────
 * 1. Main wrapper — subtle card background
 * ─────────────────────────────────────────────── */
.cotp-tradeprint-main {
	width: 100%;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 10px;
	padding: 24px;
	margin: 16px 0;
	box-sizing: border-box;
}

/* ───────────────────────────────────────────────
 * 1a. form.cart layout reset (compatibility)
 * ─────────────────────────────────────────────── *
 * Some themes/builders (Elementor Pro WC widget,
 * simchaprint's Hello-child variant, a few Astra/Blocksy
 * presets) apply display:flex / grid to <form class="cart">
 * itself OR to its immediate wrapper. On a Tradeprint
 * configurator that's catastrophic — every direct child
 * (configurator, design-app button, ATC) becomes a flex item
 * competing for horizontal space, halving the options column
 * and squeezing buttons into vertical strips.
 *
 * We use `:has()` so the override only activates on forms
 * that actually contain a Tradeprint configurator. All other
 * products on the same site (variable, simple, etc.) are
 * untouched. `:has()` is supported in every modern browser
 * (Safari 15.4+, Chrome 105+, Firefox 121+). Older browsers
 * just fall back to whatever the theme set — at worst the
 * notice still shows, just with the original cramped layout. */

/* (a) Form itself + every common Elementor / WC builder
   wrapper that might also be flexed. Listing them by name
   is cheap insurance against builder-specific quirks. */
form.cart:has(.cotp-tradeprint-main),
.elementor-add-to-cart:has(.cotp-tradeprint-main),
.elementor-widget-woocommerce-product-add-to-cart:has(.cotp-tradeprint-main),
.elementor-widget-container:has(> .elementor-add-to-cart .cotp-tradeprint-main),
.cart:has(.cotp-tradeprint-main),
[class*="product-add-to-cart"]:has(.cotp-tradeprint-main) {
	display: block !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	grid-template-columns: none !important;
	grid-template-rows: none !important;
	grid-auto-flow: row !important;
	gap: 0 !important;
	column-gap: 0 !important;
	row-gap: 0 !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
}

/* (b) Belt and braces: in case a wrapper we don't have a
   class name for is still flexing, force every direct child
   of form.cart to occupy a full row. This means even if (a)
   misses the actual flex parent, children still stack
   vertically because each one says "I want 100% of the row".
   Combined with `align-self: flex-start`, no child can grow
   vertically to match a tall sibling either. */
form.cart:has(.cotp-tradeprint-main) > * {
	flex: 0 0 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	width: 100% !important;
	grid-column: 1 / -1 !important;
	align-self: flex-start !important;
	justify-self: stretch !important;
	min-height: 0 !important;
}

/* (c) The Add to Cart button itself often has theme styling
   that gives it a fixed/stretched height (e.g. min-height:
   100% inside a flexed column). On Tradeprint products we
   want it to render at its natural height, full row width,
   below everything else. */
form.cart:has(.cotp-tradeprint-main) .single_add_to_cart_button {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	align-self: flex-start !important;
}

/* (d) Body-class fallback (v2.4.12) — for the rare older
   browsers that don't support :has() and for cases where
   the builder's CSS specificity beats our :has() rule. We
   add a `cotp-tradeprint-product` body class server-side
   (see Tradeprint_Public::cotp_add_tradeprint_body_class)
   so this scope is reliably present on every Tradeprint
   product page. */
body.cotp-tradeprint-product form.cart,
body.cotp-tradeprint-product .elementor-add-to-cart,
body.cotp-tradeprint-product .elementor-widget-woocommerce-product-add-to-cart .elementor-widget-container,
body.cotp-tradeprint-product [class*="product-add-to-cart"] {
	display: block !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	grid-template-columns: none !important;
	grid-template-rows: none !important;
	gap: 0 !important;
	column-gap: 0 !important;
	row-gap: 0 !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
}

body.cotp-tradeprint-product form.cart > * {
	flex: 0 0 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	width: 100% !important;
	grid-column: 1 / -1 !important;
	align-self: flex-start !important;
	justify-self: stretch !important;
	min-height: 0 !important;
}

body.cotp-tradeprint-product form.cart .single_add_to_cart_button {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	align-self: flex-start !important;
}

/* ───────────────────────────────────────────────
 * 2. Attribute dropdowns — full-width stacked
 * ─────────────────────────────────────────────── */
.cotp-tradeprint.cotp-product-attributes {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	margin: 0 0 8px;
	gap: 4px;
}

.cotp-product-attribute-single {
	width: 100%;
	margin-bottom: 6px;
}

.cotp-product-attribute-single label,
.cotp-product-attribute-single select {
	width: 100%;
}

.cotp-product-attribute-single label {
	font-weight: 600;
	font-size: 14px;
	color: #212529;
	margin-bottom: 6px;
	display: block;
}

.cotp-tradeprint-main select,
.cotp-product-attribute-single select {
	font-size: 15px;
	padding: 12px 38px 12px 14px;
	margin-bottom: 0;
	border: 1px solid #ced4da;
	border-radius: 8px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236c757d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	color: #212529;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	cursor: pointer;
	line-height: 1.5;
	height: auto !important;
	min-height: 46px;
	box-sizing: border-box;
	overflow: visible;
}

.cotp-tradeprint-main select:hover,
.cotp-product-attribute-single select:hover {
	border-color: #adb5bd;
}

.cotp-tradeprint-main select:focus,
.cotp-product-attribute-single select:focus {
	outline: none;
	border-color: #86b7fe;
	box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

/* ───────────────────────────────────────────────
 * 3. Quantity selector — same modern styling
 * ─────────────────────────────────────────────── */
.cotp-tradeprint.cotp-quantity-options {
	width: 100%;
	margin-bottom: 6px;
}

.cotp-tradeprint.cotp-quantity-options label {
	font-weight: 600;
	font-size: 14px;
	color: #212529;
	width: 100%;
	margin-bottom: 6px;
	display: block;
}

.cotp-tradeprint.cotp-quantity-options select {
	width: 100%;
}

/* ───────────────────────────────────────────────
 * 4. Pricing — list view (full width)
 * ─────────────────────────────────────────────── */
.cotp-tradeprint.cotp-tradeprint-prices {
	width: 100%;
}

.cotp-tradeprint.cotp-tradeprint-prices .tradeprice_service_level label {
	width: 100%;
}

.cotp-tradeprint.cotp-tradeprint-prices .tradeprice_service_level {
	display: flex;
	flex-wrap: wrap;
}

/* ───────────────────────────────────────────────
 * 5. Pricing grid — header, toggle, rows
 * ─────────────────────────────────────────────── */
.cotp-pricing-grid-view-control {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.cotp-pricing-grid-view-control h4,
body .cotp-pricing-grid-view-control h4 {
	font-size: 15px;
	font-weight: 600;
	color: #212529;
	margin: 0;
	margin-top: 0;
}

.cotp-pricing-grid-view-switch {
	display: flex;
	align-items: center;
	gap: 6px;
}

.cotp-pricing-grid-view-header {
	border-radius: 8px 8px 0 0;
	overflow: hidden;
}

/* Toggle switch */
input#cotp-switch-view[type=checkbox] {
	height: 0;
	width: 0;
	visibility: hidden;
	position: absolute;
}

#cotp-switch-view+label {
	cursor: pointer;
	text-indent: -9999px;
	width: 46px;
	height: 24px;
	background: #ced4da;
	display: block;
	border-radius: 100px;
	position: relative;
	margin-left: 8px;
	transition: background 0.2s ease;
}

#cotp-switch-view+label:after {
	content: "";
	position: absolute;
	top: 2px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: 0.2s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input#cotp-switch-view:checked + label {
	background: #198754;
}

input#cotp-switch-view:checked + label:after {
	left: calc(100% - 3px);
	transform: translateX(-100%);
}

#cotp-switch-view+label:active:after {
	width: 28px;
}

/* Grid header row */
.tradeprice_service_level_qty_header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.tradeprice_service_level_qty_header label {
	width: 28%;
	display: flex;
	text-align: center;
	height: 42px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	row-gap: 3px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
}

.tradeprice_service_level_qty_header label:first-child {
	width: 16%;
}

.tradeprice_service_level_qty_header label>span {
	display: block;
	line-height: 1;
	width: 100%;
}

span.cotp-service-label_selected_price {
	color: #dc3545;
	font-weight: 600;
}

/* Grid view container */
.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view {
	width: 100% !important;
	max-height: 400px;
	overflow: auto;
	border: 1px solid #dee2e6;
	border-top: unset;
	border-radius: 0 0 8px 8px;
	scrollbar-width: thin;
	scrollbar-color: rgba(0,0,0,0.25) transparent;
}

/* Grid view rows */
.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level {
	display: flex !important;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: unset;
}

/* Grid view cells */
.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label {
	border-bottom: 1px solid #f0f0f0;
	width: 28%;
	display: flex;
	text-align: center;
	height: 42px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	row-gap: 3px;
	cursor: pointer;
	margin: 0;
	font-size: 14px;
	transition: background 0.15s ease;
}

.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label:first-child {
	width: 16%;
	font-weight: 600;
}

.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label:hover {
	background: #95b97a;
	color: #fff;
}

.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label.selected-service-level {
	background: #95b97a;
	color: #fff;
}

.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label span.cotp-sl-level-name {
	display: none;
}

.cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label input {
	display: none;
}

/* Grid column width overrides */
.cotp_grid_col_3 .tradeprice_service_level_qty_header label,
.cotp_grid_col_3 .cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label {
	width: 33% !important;
}

.cotp_grid_col_2 .tradeprice_service_level_qty_header label,
.cotp_grid_col_2 .cotp-tradeprint.cotp-tradeprint-prices.cotp-tradeprint-prices-grid-view .tradeprice_service_level label {
	width: 50% !important;
}

.cotp-sl-active {}

.service_level_opt_qty_val {
	display: none;
}

.cotp-tradeprint-prices-grid-view .service_level_opt_qty_val {
	display: block;
}

/* ───────────────────────────────────────────────
 * 6. Delivery / postcode lookup
 * ─────────────────────────────────────────────── */
.cotp-delivery-box {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 10px;
	width: 100%;
}

.cotp-delivery-box label {
	width: 100%;
	font-weight: 600;
	font-size: 14px;
	color: #212529;
	line-height: 2rem;
	margin-top: 10px;
}

.cotp-postcode-field {
	width: 70%;
}

.cotp-postcode-field input,
input#cotp_postcode_field {
	font-size: 15px;
	padding: 11px 14px;
	width: 100%;
	border: 1px solid #ced4da;
	border-radius: 8px 0 0 8px;
	margin: 0 !important;
	min-height: 46px;
	box-sizing: border-box;
	color: #212529;
	transition: border-color 0.15s ease;
}

.cotp-postcode-field input:focus,
input#cotp_postcode_field:focus {
	outline: none;
	border-color: #86b7fe;
}

.cotp-postcode-submit {
	width: 30%;
}

.cotp-postcode-submit button,
button.cotp-check-deliveryajax {
	width: 100%;
	min-height: 46px;
	margin: 0;
	border: 1px solid #212529;
	background: #212529;
	color: #fff;
	border-radius: 0 8px 8px 0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.cotp-postcode-submit button:hover,
button.cotp-check-deliveryajax:hover {
	background: #343a40;
	border-color: #343a40;
}

.cotp-tradeprint-expected-delivery {
	width: auto;
}

.cotp-estimated-delivery-date {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
	display: block;
	width: 100%;
	border-radius: 8px;
	text-align: center;
	margin-top: 10px;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 500;
}

/* ───────────────────────────────────────────────
 * 7. File upload
 * ─────────────────────────────────────────────── */
.cotp-tradeprint.cotp-tradeprint-file-upload {
	width: auto;
}

.cotp-upload-main {
	display: flex;
	flex-wrap: wrap;
	padding: 8px 0;
}

.cotp-upload-main label {
	line-height: 2rem;
	font-weight: 600;
	font-size: 14px;
	color: #212529;
}

button#cotp_upload_now_btn {
	width: 100%;
	padding: 12px 16px;
	border: 2px dashed #ced4da;
	border-radius: 8px;
	background: #fff;
	color: #495057;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

button#cotp_upload_now_btn:hover {
	border-color: #6c757d;
	background: #f8f9fa;
}

a#cotp_upload_later {
	width: 100%;
	display: block;
	text-align: center;
	padding: 8px;
	font-size: 13px;
	color: #6c757d;
}

input#tradeprint_upload {
	display: none;
	width: 100%;
}

/* ───────────────────────────────────────────────
 * 8. Additional fees & total price
 * ─────────────────────────────────────────────── */
.cotp-tradeprint.cotp-tradeprint-additional-product-fees {
	margin-bottom: 8px;
	margin-top: 8px;
}

.cotp-tradeprint.cotp-tradeprint-additional-product-fees h3 {
	font-size: 16px;
	font-weight: 600;
	color: #212529;
	margin-top: 12px;
	margin-bottom: 8px;
}

.cotp-tradeprint.cotp-tradeprint-additional-product-fees .cotp-additional-fees {
	font-size: 16px;
	color: #495057;
}

.cotp-tradeprint-total-price {
	font-size: 24px;
	font-weight: 700;
	color: #212529;
	margin-top: 16px;
	padding: 16px;
	background: #fff;
	border: 2px solid #198754;
	border-radius: 8px;
	text-align: center;
}

/* ───────────────────────────────────────────────
 * 9. Tooltips
 * ─────────────────────────────────────────────── */
.cotp-tooltip-icon {
	display: inline-block;
	cursor: pointer;
	position: relative;
	line-height: 1;
	vertical-align: middle;
}

.cotp-tooltip-icon span.wc-tooltip-icon.dashicons.dashicons-info {
	font-size: 16px;
	color: #6c757d;
}

span.cotp-tooltip-i {
	background: #6c757d;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	text-align: center;
	border-radius: 50%;
	font-size: 11px;
	line-height: 1;
	font-family: serif;
	font-weight: 700;
	padding: 0;
}

.cotp-tooltip-icon .cotp-tooltip-text {
	display: none;
	position: absolute;
	background-color: #212529;
	color: #fff;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 400;
	top: -6px;
	z-index: 1000;
	left: 24px;
	width: 220px;
	line-height: 1.5;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cotp-tooltip-icon:hover .cotp-tooltip-text {
	display: block;
}

/* ───────────────────────────────────────────────
 * 9b. Design Confirmation block (v2.4.0)
 * ───────────────────────────────────────────────
 * Sits directly above the Total Price strip. When the feature is on,
 * the customer must tick the checkbox before the Add to Cart button
 * becomes clickable.
 */
.cotp-tradeprint-design-confirm {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 18px 0 14px;
	padding: 0;
	background: transparent;
	border: 0;
}

.cotp-design-confirm-warning {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px 20px;
	background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%);
	border: 1.5px solid #facc15;
	border-radius: 10px;
	color: #78350f;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.cotp-design-confirm-warning-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: #92400e;
	margin-top: 2px;
}

.cotp-design-confirm-warning-body {
	flex: 1 1 auto;
	min-width: 0;
}

.cotp-design-confirm-warning-title {
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: #78350f;
}

.cotp-design-confirm-warning-text,
.cotp-design-confirm-warning-text p {
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 1.55;
	color: #78350f;
}

.cotp-design-confirm-warning-text p:last-child {
	margin-bottom: 0;
}

.cotp-design-confirm-checkbox-block {
	display: flex !important;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	background: #f9fafb;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
}

.cotp-design-confirm-checkbox-block:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.cotp-design-confirm-checkbox-block input[type="checkbox"].cotp-design-confirm-checkbox {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	cursor: pointer;
	accent-color: #2563eb;
}

.cotp-design-confirm-checkbox-label {
	flex: 1 1 auto;
	cursor: pointer;
}

/* Visual confirmation that the gate is now open. */
.cotp-tradeprint-design-confirm.cotp-design-confirm-ok .cotp-design-confirm-checkbox-block {
	background: #ecfdf5;
	border-color: #10b981;
	color: #065f46;
}

/* Submit-blocked flash — used when the customer tries to add to cart
 * without ticking. Pulses the checkbox row so the eye is drawn there. */
@keyframes cotpDesignConfirmFlash {
	0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); border-color: #dc2626; background: #fef2f2; }
	60%  { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); border-color: #dc2626; background: #fef2f2; }
	100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.cotp-tradeprint-design-confirm.cotp-design-confirm-flash .cotp-design-confirm-checkbox-block {
	animation: cotpDesignConfirmFlash 1.4s ease-out 1;
}

/* ───────────────────────────────────────────────
 * 10. Responsive
 * ─────────────────────────────────────────────── */
@media (max-width: 767px) {
	.cotp-tradeprint-main {
		padding: 16px;
		border-radius: 8px;
	}

	.cotp-product-attribute-single {
		width: 100%;
	}

	.cotp-pricing-grid-view-header {
		width: 100%;
		padding-right: 5px;
	}

	.cotp-postcode-field {
		width: 65%;
	}

	.cotp-postcode-submit {
		width: 35%;
	}

	.cotp-design-confirm-warning {
		flex-direction: column;
		gap: 10px;
		padding: 14px 16px;
	}

	.cotp-design-confirm-warning-icon {
		width: 24px;
		height: 24px;
	}

	.cotp-design-confirm-warning-title {
		font-size: 16px;
	}
}

/* ───────────────────────────────────────────────
 * 14. Manual Template (v2.4.3)
 *     Quantity / Price-per-unit / Total / Select grid
 * ─────────────────────────────────────────────── */

/* When the Manual Template is active, hide the default grid bits
   wholesale: the radio labels container, the quantity dropdown, and
   the grid/list view toggle. We DO keep the radios in the DOM (they're
   inside .cotp-tradeprint-prices), but the wrapper itself is hidden so
   nothing renders. The Manual Template lives in a sibling container
   .cotp-manual-template-container which the JS injects. */
.cotp-tradeprint-main.cotp-template-manual .cotp-tradeprint-prices,
.cotp-tradeprint-main.cotp-template-manual .cotp-quantity-options,
.cotp-tradeprint-main.cotp-template-manual .cotp-pricing-grid-view-toggle {
	display: none !important;
}

.cotp-manual-template-container {
	margin: 0 0 18px 0;
}

/* Storefront intro banner (v2.4.3+) — rendered as a true header
   attached to the top edge of .cotp-tradeprint-main. We pull it
   out of the parent's 24px padding with negative margins so it
   sits flush against the outer border, then re-apply the top
   corner radius so it tucks neatly inside the rounded card. A
   single bottom border separates it from the configurator below. */
.cotp-tradeprint-intro {
	background: #f1f3f5;
	color: #1c1c1c;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-align: center;
	padding: 20px 24px;
	margin: -24px -24px 20px -24px;
	border: 0;
	border-bottom: 1px solid #e2e2e2;
	border-top-left-radius: 9px;
	border-top-right-radius: 9px;
}

.cotp-tradeprint-intro p:first-child { margin-top: 0; }
.cotp-tradeprint-intro p:last-child  { margin-bottom: 0; }
.cotp-tradeprint-intro a { color: inherit; text-decoration: underline; }

/* Match the responsive padding on the parent .cotp-tradeprint-main
   (16px at <=767px) so the intro keeps sitting flush against the
   outer border on mobile too. */
@media (max-width: 767px) {
	.cotp-tradeprint-intro {
		font-size: 18px;
		margin: -16px -16px 16px -16px;
		padding: 16px 16px;
		border-top-left-radius: 7px;
		border-top-right-radius: 7px;
	}
}

/* ───────────────────────────────────────────────
 * 15. Design App ATC Gate (v2.4.8 — replaces the
 *     v2.4.4 page-wide gate). Lightweight: only the
 *     Add to Cart button is disabled + a small
 *     inline notice is shown, never the configurator.
 * ─────────────────────────────────────────────── */

.cotp-design-gate-notice {
	display: none;
	margin: 10px 0;
	padding: 10px 14px;
	background: #fff8e1;
	border: 1px solid #f0d97a;
	border-left: 4px solid #f59e0b;
	border-radius: 6px;
	color: #5a4500;
	font-size: 13px;
	line-height: 1.45;
}

body.cotp-design-gate-active .cotp-design-gate-notice {
	display: block;
}

/* When the design-app gate is active (customer has not yet
   saved a design and the product requires one), hide the
   entire Tradeprint configurator card AND the design-confirm
   block. The customer should ONLY see the design app's own
   "Customize this design" button + our gate notice telling
   them what to do. Once PitchPrint / Print.app fires the
   saved event (or our DOM heuristic detects it), the body
   class is removed by the gate JS and everything below
   reappears with normal styling.

   Failure-safe: if the gate JS fails to load, the body class
   is never added → the rule never matches → the configurator
   stays visible (default behaviour preserved). */
body.cotp-design-gate-active .cotp-tradeprint-main,
body.cotp-design-gate-active .cotp-design-confirm,
body.cotp-design-gate-active .cotp-tradeprint-total-price {
	display: none !important;
}

/* Price-Selection Gate notice (v2.4.13) — shown only when
   the customer tries to Add to Cart without picking a
   quantity from the price grid first. Same visual language
   as the design-app notice (amber pill) so they read as a
   consistent family of pre-purchase reminders. */
.cotp-price-gate-notice {
	display: none;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	flex: 0 0 100% !important;
	grid-column: 1 / -1 !important;
	align-self: flex-start !important;
	margin: 0 0 10px 0;
	padding: 12px 16px;
	background: #fff8e1;
	border: 1px solid #f0d97a;
	border-left: 4px solid #f59e0b;
	border-radius: 6px;
	color: #5a4500;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	text-align: center;
}

@keyframes cotpPriceGateFlash {
	0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
	50%  { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
	100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.cotp-price-gate-notice.cotp-price-gate-flash,
.cotp-price-gate-flash {
	animation: cotpPriceGateFlash 1.4s ease-out 1;
}

/* When the gate JS moves the notice directly above the
   Add to Cart button, tighten the spacing so it reads as
   a single unit with the button.

   Compatibility shield: some themes (e.g. simchaprint) make
   form.cart itself a flex/grid container, which would otherwise
   squeeze the notice into a thin vertical column when it sits
   as a sibling of the Add to Cart button. The four !important
   declarations below force it to occupy a full row regardless
   of the parent's display mode. They have no effect in normal
   block contexts so well-behaved themes are unaffected. */
/* When our notice sits immediately above a design-app button
   container (PitchPrint #pp_main_btn_sec or Print.app
   #pa_main_btn_sec), guarantee a visible gap by also pushing
   the button container down — some vendor CSS sets
   margin-top: 0 on its own root which would otherwise pull
   the button up against the notice. */
.cotp-design-gate-notice--inline + #pp_main_btn_sec,
.cotp-design-gate-notice--inline + #pa_main_btn_sec,
.cotp-design-gate-notice--inline + #pp-button-wrapper,
.cotp-design-gate-notice--inline + .pp-buttons,
.cotp-design-gate-notice--inline + #pa-buttons,
.cotp-design-gate-notice--inline + .ppc_btn_wrapper,
.cotp-design-gate-notice--inline + #pp_customize_design_btn,
.cotp-design-gate-notice--inline + #pp_edit_btn,
.cotp-design-gate-notice--inline + #pp_clear_design_btn,
.cotp-design-gate-notice--inline + .ppc-main-ui,
.cotp-design-gate-notice--inline + input.ppc-main-ui,
.cotp-design-gate-notice--inline + button.ppc-main-ui {
	margin-top: 20px !important;
}

/* Belt-and-braces: PitchPrint's customize/edit/clear inputs
   often have inline styles or theme-set margin: 0 that beat
   the adjacent-sibling rule above. Force a top margin on
   them whenever they appear inside form.cart, regardless of
   what sits above. The rule is harmless when the button is
   the very first thing in the form. */
form.cart #pp_customize_design_btn,
form.cart #pp_edit_btn,
form.cart #pp_clear_design_btn,
form.cart .ppc-main-ui {
	margin-top: 16px !important;
	margin-bottom: 8px !important;
}

.cotp-design-gate-notice.cotp-design-gate-notice--inline {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 16px !important;
	margin-bottom: 20px !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	text-align: center;
	flex: 0 0 auto !important;       /* don't grow OR stretch */
	grid-column: 1 / -1 !important;  /* span all grid columns */
	align-self: flex-start !important;/* prevent flex stretch in cross-axis */
	justify-self: stretch !important;/* grid: keep full row width */
	max-width: none !important;
	min-width: 0;
	height: auto !important;
	min-height: 0 !important;
}

/* Scrollable wrapper (v2.4.6+).
   The table's border + radius live on the wrapper now so the inner
   <table> can scroll without scroll-cropping the rounded corners.
   max-height is sized to ~5 rows (5 * 64px + ~50px header). The
   sticky <thead> stays pinned while the body scrolls. */
.cotp-manual-template-container {
	margin: 0 0 18px 0;
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	overflow: hidden;
}

.cotp-manual-template-container .cotp-manual-template-scroll {
	max-height: 370px;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

.cotp-manual-template-table {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
	background: #ffffff;
	border: 0;
	border-radius: 0;
	font-size: 15px;
	color: #2c2c2c;
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: none;
}

.cotp-manual-template-table thead th {
	background: #2f2f2f;
	color: #ffffff;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-align: left;
	padding: 18px 12px;
	font-size: 12px;
	border: 0;
	position: sticky;
	top: 0;
	z-index: 2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: keep-all;
	hyphens: none;
}

/* Sensible column proportions so the SELECT column always
   has room for its button and never gets clipped. */
.cotp-manual-template-table thead th.cotp-manual-th-qty    { width: 26%; }
.cotp-manual-template-table thead th.cotp-manual-th-unit   { width: 18%; }
.cotp-manual-template-table thead th.cotp-manual-th-total  { width: 22%; }
.cotp-manual-template-table thead th.cotp-manual-th-select { width: 34%; }
/* When the price/unit column is hidden by the option, redistribute. */
.cotp-template-manual-hide-unit .cotp-manual-template-table thead th.cotp-manual-th-qty    { width: 32%; }
.cotp-template-manual-hide-unit .cotp-manual-template-table thead th.cotp-manual-th-total  { width: 30%; }
.cotp-template-manual-hide-unit .cotp-manual-template-table thead th.cotp-manual-th-select { width: 38%; }

/* Outermost cells get a little extra breathing room from the rounded
   card edge — kept modest so narrow containers still fit. */
.cotp-manual-template-table thead th:first-child,
.cotp-manual-template-table tbody td:first-child {
	padding-left: 18px;
}

.cotp-manual-template-table thead th:last-child,
.cotp-manual-template-table tbody td:last-child {
	padding-right: 18px;
}

.cotp-manual-template-table thead th.cotp-manual-th-select {
	text-align: center;
}

.cotp-manual-template-table tbody tr {
	background: #ffffff;
	transition: background-color .15s ease;
}

.cotp-manual-template-table tbody tr:nth-child(even) {
	background: #fafafa;
}

/* Only apply the hover background on devices that actually have a
   hover-capable pointer (mouse / trackpad). Without this guard,
   tapping a row on iOS/Android leaves it stuck in :hover, which
   visually masks the .cotp-manual-row-selected pink background. */
@media (hover: hover) and (pointer: fine) {
	.cotp-manual-template-table tbody tr:hover {
		background: #f3f3f3;
	}
}

.cotp-manual-template-table tbody td {
	padding: 14px 12px !important;
	border-top: 1px solid #ececec;
	vertical-align: middle !important;
	font-size: 14px;
	line-height: 1.4;
	background-clip: padding-box;
}

.cotp-manual-template-table tbody td.cotp-manual-td-qty {
	font-weight: 600;
	white-space: nowrap;
}

.cotp-manual-template-table tbody td.cotp-manual-td-unit,
.cotp-manual-template-table tbody td.cotp-manual-td-total {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.cotp-manual-template-table tbody td.cotp-manual-td-select {
	text-align: center !important;
}

/* SELECT button — neutral dark by default. Sized to always fit
   inside its column without forcing horizontal overflow. The
   !important declarations below are deliberate: many themes
   (Elementor, Astra, Blocksy, Storefront children) ship with
   high-specificity button styles that would otherwise inflate
   our compact in-row select control. */
.cotp-manual-template-table .cotp-manual-select-btn,
button.cotp-manual-select-btn,
.cotp-manual-select-btn {
	display: inline-block !important;
	width: 100% !important;
	max-width: 110px !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	border: 0 !important;
	border-radius: 6px !important;
	cursor: pointer !important;
	background: #4a4a4a !important;
	color: #ffffff !important;
	font-family: inherit !important;
	font-weight: 700 !important;
	font-size: 12px !important;
	letter-spacing: 0.05em !important;
	text-transform: uppercase !important;
	text-align: center !important;
	text-decoration: none !important;
	padding: 9px 8px !important;
	margin: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	line-height: 1 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	transition: background-color .15s ease, transform .05s ease !important;
}

.cotp-manual-select-btn:hover {
	background: #2f2f2f !important;
}

.cotp-manual-select-btn:active {
	transform: translateY(1px) !important;
}

.cotp-manual-select-btn:focus,
.cotp-manual-select-btn:focus-visible {
	outline: 2px solid #2f2f2f !important;
	outline-offset: 2px !important;
}

/* Selected row — subtle pink background + maroon SELECTED button,
   matching the reference design. The high-specificity selectors
   below (and the cell-level fallback) guarantee the pink wins
   over :nth-child(even), :hover, and any theme overrides. */
.cotp-manual-template-table tbody tr.cotp-manual-row-selected,
.cotp-manual-template-table tbody tr.cotp-manual-row-selected:nth-child(even),
.cotp-manual-template-table tbody tr.cotp-manual-row-selected:hover {
	background: #f7e3ea !important;
}

/* Belt and braces: some mobile browsers ignore <tr> backgrounds
   when cells have their own. Apply the selected colour at cell
   level too so the pink always shows end-to-end across the row. */
.cotp-manual-template-table tbody tr.cotp-manual-row-selected td {
	background: #f7e3ea !important;
}

.cotp-manual-row-selected .cotp-manual-select-btn {
	background: #a23a5a !important;
}

.cotp-manual-row-selected .cotp-manual-select-btn:hover {
	background: #8c2f4d !important;
}

@media (max-width: 600px) {
	.cotp-manual-template-table thead th {
		padding: 14px 8px;
		font-size: 11px;
		letter-spacing: 0.02em;
	}

	.cotp-manual-template-table tbody td {
		padding: 14px 8px;
		font-size: 13px;
	}

	.cotp-manual-template-table thead th:first-child,
	.cotp-manual-template-table tbody td:first-child {
		padding-left: 12px;
	}

	.cotp-manual-template-table thead th:last-child,
	.cotp-manual-template-table tbody td:last-child {
		padding-right: 12px;
	}

	.cotp-manual-select-btn {
		max-width: 90px;
		padding: 8px 6px;
		font-size: 11px;
		letter-spacing: 0.04em;
	}
}

/* Very narrow containers (sidebars / small phones): drop the
   per-unit column to give the rest of the row real estate. The
   table stays at 100% width with no horizontal scroll. */
@media (max-width: 420px) {
	.cotp-manual-template-table thead th.cotp-manual-th-unit,
	.cotp-manual-template-table tbody td.cotp-manual-td-unit {
		display: none;
	}
	.cotp-manual-template-table thead th.cotp-manual-th-qty    { width: 32%; }
	.cotp-manual-template-table thead th.cotp-manual-th-total  { width: 30%; }
	.cotp-manual-template-table thead th.cotp-manual-th-select { width: 38%; }
}