/* Perth Delivery Fees — cart shipping calculator + quote flow styling */

/* "Estimate Shipping and Tax" box injected into the Cart Totals panel */
.pdf-shipping-estimator {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e2e2e2;
}
.pdf-shipping-estimator-title {
	margin: 0 0 4px;
	font-size: 1.1em;
}
.pdf-shipping-estimator-subtitle {
	margin: 0 0 12px;
	color: #666;
	font-size: 0.9em;
}
.pdf-shipping-table,
.pdf-shipping-table tbody,
.pdf-shipping-table tr,
.pdf-shipping-table th,
.pdf-shipping-table td {
	display: block;
	width: 100%;
	border: none;
	padding: 0;
	background: none;
}
.pdf-shipping-table th {
	display: none; /* The row label ("Shipping") isn't needed inside our own box heading. */
}

/* Force WooCommerce's shipping calculator fields to always be visible,
   instead of collapsed behind a "Calculate shipping" toggle link, to match
   the approved design (fields shown directly). Unscoped (not limited to
   .pdf-shipping-table) because the active theme's own cart-totals template
   sometimes prints the calculator itself, outside that wrapper. */
.shipping-calculator-button {
	display: none !important;
}
.shipping-calculator-form {
	display: block !important;
	margin-top: 10px;
}
.shipping-calculator-form p {
	margin: 0 0 10px;
}
.shipping-calculator-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}
.shipping-calculator-form select,
.shipping-calculator-form input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
}
.shipping-calculator-form select:disabled {
	color: #999;
	background: #f5f5f5;
	cursor: not-allowed;
}
/* The fee now updates automatically as soon as a suburb/postcode is picked,
   so the manual "Update" button is no longer needed. The field stays in the
   DOM (not removed) so nothing else relying on it breaks. !important because
   the theme's own button reset styles otherwise force it back to visible. */
.shipping-calculator-form button[name="calc_shipping"] {
	display: none !important;
}
/* Country / Region is shown for every product, same as State / Suburb /
   Postcode — one consistent calculator regardless of what's in the cart. */

/* Small "Subtotal + Ship = taxed amount" note under the Tax row */
.pxl-tax-breakdown-note {
	margin: -6px 0 0;
	text-align: right;
	color: #888;
}

/* Blue info notice, matches the "postcode outside standard zones" box */
.pdf-quote-required-notice {
	background: #eaf3fb;
	border: 1px solid #cfe2f3;
	border-radius: 4px;
	padding: 12px 14px;
	margin: 10px 0;
	color: #1f4b66;
	font-size: 0.92em;
	line-height: 1.5;
}

/* "Delivery Quote Required" fake radio row */
#pdf-shipping-method {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
}
#pdf-shipping-method li {
	display: flex;
	align-items: center;
	gap: 8px;
}
/* CSS-drawn "selected radio" look (ring + filled dot) — see the PHP
   template comment for why this isn't a real <input type="radio">. */
.pdf-fake-radio {
	display: inline-block;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	box-sizing: border-box;
	border: 2px solid #3373b0;
	border-radius: 50%;
	position: relative;
}
.pdf-fake-radio::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3373b0;
}

/* Same fake-radio, placed inline in WooCommerce's own #shipping_method list
   (native `line-height:1.5em; label{display:inline}` styling, not a flex
   row like #pdf-shipping-method above) — used for the locked "Click and
   Collect" result so it reads as prominently as "Delivery Quote Required"
   instead of plain text next to an invisible auto-selected hidden input. */
#shipping_method .pdf-fake-radio {
	vertical-align: middle;
	margin: 0 8px 0 0;
}
#shipping_method .pdf-fake-radio + label {
	font-weight: 600;
}
#pdf-shipping-method label {
	font-weight: 600;
}

/* Generic (non-category-flagged) out-of-zone products: real, clickable
   Click and Collect / Request a Delivery Quote radio choice — see
   updateGenericFulfillmentChoice() in pdf-shipping.js. */
.pdf-generic-fulfillment-choice {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 4px;
}
.pdf-generic-radio-option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	cursor: pointer;
}
.pdf-generic-radio-option input[type="radio"] {
	accent-color: #3373b0;
	width: 16px;
	height: 16px;
	margin: 0;
}

/* Request a Delivery Quote button, styled as a secondary/lighter green CTA.
   !important because WooCommerce core's own .button.alt (purple, #7f54b3)
   and the theme's stylesheet both load AFTER this file at equal
   specificity, and win the cascade tie without it — confirmed via computed
   style, not just visual guesswork (both buttons were rendering as the
   same WooCommerce-default purple before this). */
.pdf-quote-request-wrap {
	margin-top: 8px;
}
.pdf-request-quote-btn.button {
	display: block;
	width: 100%;
	text-align: center;
	background: #6fbf73 !important;
	border-color: #6fbf73 !important;
	color: #fff !important;
}
.pdf-request-quote-btn.button:hover {
	background: #5aa85e !important;
	border-color: #5aa85e !important;
	color: #fff !important;
}

/* "Proceed to Checkout" recoloured to the site's dark green brand colour
   ONLY while the cart is locked to Click and Collect or Request a Delivery
   Quote (PDF_Click_Collect body classes) — scoped deliberately rather than
   changed site-wide, since the button is plain WooCommerce purple
   everywhere else by the theme's own current default and that wasn't part
   of what was asked. */
body.pdf-fulfillment-collect .checkout-button.button,
body.pdf-fulfillment-quote .checkout-button.button {
	background: #1b5e20 !important;
	border-color: #1b5e20 !important;
	color: #fff !important;
}
body.pdf-fulfillment-collect .checkout-button.button:hover,
body.pdf-fulfillment-quote .checkout-button.button:hover {
	background: #144a19 !important;
	border-color: #144a19 !important;
	color: #fff !important;
}

/* Modal */
.pdf-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pdf-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}
.pdf-modal-content {
	position: relative;
	background: #fff;
	border-radius: 6px;
	max-width: 560px;
	width: 92%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 20px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.pdf-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #666;
}
.pdf-modal-content h3 {
	margin-top: 0;
}
.pdf-field {
	margin-bottom: 12px;
}
.pdf-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}
.pdf-field input,
.pdf-field select,
.pdf-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

/* Two/three fields side by side (First/Last name, Email/Phone, Suburb/State/Postcode) */
.pdf-field-row {
	display: flex;
	gap: 12px;
}
.pdf-field-row .pdf-field {
	flex: 1 1 0;
	min-width: 0;
}
.pdf-field-row-address .pdf-field-suburb {
	flex: 2 1 0;
}
.pdf-field-row-address .pdf-field-state {
	flex: 1.4 1 0;
}
.pdf-field-row-address .pdf-field-postcode {
	flex: 1 1 0;
}
@media (max-width: 480px) {
	.pdf-field-row {
		flex-direction: column;
		gap: 0;
	}
}

/* "Standard Delivery" — display-only, matches the look of the disabled/
   locked fields elsewhere on the site rather than being an actual select. */
.pdf-field-static {
	display: block;
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background: #f5f5f5;
	color: #666;
}
.pdf-form-msg {
	min-height: 20px;
	font-size: 0.92em;
	margin-bottom: 8px;
}
.pdf-form-msg.pdf-success {
	color: #2e7d32;
}
.pdf-form-msg.pdf-error {
	color: #c62828;
}
.pdf-submit-row .button {
	width: 100%;
	text-align: center;
}

/* Admin settings screen */
.pdf-settings-wrap input[type="number"] {
	width: 90px;
}
