/**
 * 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;
}

/* ───────────────────────────────────────────────
 * 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;
}

/* ───────────────────────────────────────────────
 * 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%;
	}
}
