/* ==========================================================================
   Brand colors — edit these two lines to match your site's palette exactly.
   Currently set to the same red used by your sale badge / sale price.
   ========================================================================== */
:root {
	--tfa-preorder-bg: #b91c2c;
	--tfa-preorder-bg-hover: #931521;
	--tfa-preorder-color: #ffffff;
}

/* Pre-Order button (single product page — uses default WooCommerce button styling) */
.tfa-preorder-btn {
	cursor: pointer;
}

/* Pre-Order button on shop/category/related loops — styled as a circular
   icon button to match the wishlist / quick-view / compare icons it sits
   alongside, with a small tooltip label shown on hover since there's no
   visible text. Adjust the 40px size below if your icon circles are a
   different size. */
.tfa-preorder-btn.tfa-preorder-icon {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 40px !important;
	height: 40px !important;
	padding: 0 !important;
	margin: 0 auto;
	border-radius: 50% !important;
	background: #ffffff !important;
	color: #1c2b39;
	border: none !important;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.18 );
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

@media (max-width: 767px){
	.tfa-preorder-btn.tfa-preorder-icon {
		width: 26px !important;
		height: 26px !important;
	}
}

.tfa-preorder-btn.tfa-preorder-icon svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
}

.tfa-preorder-btn.tfa-preorder-icon:hover {
	background: var( --tfa-preorder-bg ) !important;
	color: var( --tfa-preorder-color ) !important;
	transform: translateY( -1px );
}

/* Tooltip label, shown above the icon on hover */
.tfa-preorder-btn.tfa-preorder-icon::after {
	content: 'Pre-Order';
	position: absolute;
	bottom: 50%;
	right: 112%;
	transform: translateY(50%);
	background: rgba(0, 0, 0, 1);
	color: #ffffff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 12px;
	border-radius: 300px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
	font-family: var(--ts-font-family);
}

.tfa-preorder-btn.tfa-preorder-icon:hover::after {
	opacity: 1;
}

/* Pre-Order button injected into a Quick View popup (see preorder.js) —
   uses the same button/icon-free style as the single product page button
   so it matches the rest of the Quick View's Add to Cart area. */
.tfa-preorder-btn.tfa-preorder-quickview {
	cursor: pointer;
}

/* Modal wrapper */
.tfa-preorder-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.tfa-preorder-modal.is-open {
	display: block;
}

.tfa-preorder-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.6 );
}

.tfa-preorder-modal__dialog {
	position: relative;
	background: #fff;
	max-width: 560px;
	width: 90%;
	margin: 5vh auto;
	padding: 32px 28px 24px;
	border-radius: 6px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
}

.tfa-preorder-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #555;
}

.tfa-preorder-modal__close:hover {
	color: #000;
	background: transparent;
}

.tfa-preorder-modal h2 {
	margin-top: 0;
	margin-bottom: 4px;
	font-size: 22px;
}

.tfa-preorder-product-name {
	font-weight: 600;
	margin-top: 0;
	margin-bottom: 18px;
	color: #444;
}

body.tfa-modal-open {
	overflow: hidden;
}

/* Form fields — laid out as a 2-column grid:
   Name | Phone, Email | Address, Requirement | Quantity, Description (full width) */
.tfa-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 16px;
}

.tfa-field {
	margin: 0 0 14px;
}

.tfa-field--full {
	grid-column: 1 / -1;
}

.tfa-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
	font-size: 14px;
}

.tfa-field .req {
	color: #c0392b;
}

.tfa-field input[type="text"],
.tfa-field input[type="email"],
.tfa-field input[type="tel"],
.tfa-field input[type="number"],
.tfa-field input[type="date"],
.tfa-field textarea {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

.tfa-field input::placeholder,
.tfa-field textarea::placeholder {
	color: #9a9a9a;
}

.tfa-field textarea {
	resize: vertical;
}

.tfa-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	padding-top: 6px;
}

.tfa-radio-group label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-right: 0;
	font-weight: normal;
	cursor: pointer;
}

.tfa-radio-group input[type="radio"] {
	margin: 0;
}

.tfa-submit-row {
	margin-top: 6px;
}

.tfa-submit-row .tfa-preorder-submit {
	width: 100%;
	cursor: pointer;
}

.tfa-preorder-message {
	margin-top: 12px;
	font-size: 14px;
}

.tfa-preorder-message.success {
	color: #2a7d2a;
	font-weight: 600;
}

.tfa-preorder-message.error {
	color: #c0392b;
	font-weight: 600;
}

/* Honeypot field: hidden from real users, left for bots */
.tfa-hp-field {
	position: absolute;
	left: -9999px;
	top: -9999px;
}

/* Responsive */
@media ( max-width: 600px ) {
	.tfa-preorder-modal__dialog {
		width: 100%;
		max-width: 100%;
		margin: 0;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		padding: 24px 18px 18px;
	}

	.tfa-form-grid {
		grid-template-columns: 1fr;
	}
}