/* WholesaleNode for WooCommerce — Frontend Styles
 * Uses the same CSS classes as the Pro plugin for visual consistency.
 */

/* ── Hidden price ─────────────────────────────────────────────── */
.woowsn-hidden-price {
	color: #6b7280;
	font-style: italic;
	font-size: .9em;
}

.woowsn-login-to-view-btn,
.woowsn-hidden-price-btn,
.woowsn-free-login-trigger {
	display: inline-block;
	margin-left: 6px;
	padding: 4px 12px;
	font-size: .85em;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
}

/* ── Registration extra fields ────────────────────────────────── */
.woowsn-free-reg-fields { margin-bottom: 10px; }
.woowsn-free-reg-fields .woocommerce-form-row { margin-bottom: 12px; }
.woowsn-free-reg-fields label { display: block; font-weight: 500; margin-bottom: 4px; }
.woowsn-free-reg-fields input,
.woowsn-free-reg-fields textarea { width: 100%; box-sizing: border-box; }

/* ── Quote form wrapper (mirrors pro) ─────────────────────────── */
.woowsn-quote-form-wrapper {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	float: left;
	width: 100%;
	box-sizing: border-box;
}

.woowsn-quote-title {
	margin: 0 0 20px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333;
	text-align: center;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 10px;
}

.woowsn-quote-messages {
	padding: 12px 16px;
	border-radius: 4px;
	margin: 10px 0;
	font-size: 14px;
	line-height: 1.5;
}

.woowsn-quote-messages.success {
	background-color: #d1ecf1;
	border: 1px solid #bee5eb;
	color: #0c5460;
}

.woowsn-quote-messages.error {
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.woowsn-free-quote-form {
	display: grid;
	gap: 20px;
}

.woowsn-quote-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.woowsn-quote-field label {
	display: block;
	font-weight: 600;
	color: #495057;
	font-size: 14px;
	margin-bottom: 5px;
}

.woowsn-quote-field.required label::after {
	content: " *";
	color: #dc3545;
	font-weight: bold;
}

.woowsn-quote-field input,
.woowsn-quote-field textarea,
.woowsn-quote-field select {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e9ecef;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	transition: all 0.2s ease-in-out;
	font-family: inherit;
	box-sizing: border-box;
	background-color: #fff;
}

.woowsn-quote-field input:focus,
.woowsn-quote-field textarea:focus,
.woowsn-quote-field select:focus {
	outline: none;
	border-color: #0073aa;
	background-color: #fff;
}

.woowsn-quote-field input:hover,
.woowsn-quote-field textarea:hover,
.woowsn-quote-field select:hover {
	border-color: #adb5bd;
}

.woowsn-quote-field textarea {
	resize: vertical;
	min-height: 100px;
	font-family: inherit;
}

/* ── Submit button (mirrors pro) ──────────────────────────────── */
.woowsn-quote-submit-wrapper {
	margin-top: 10px;
	display: flex;
	justify-content: center;
}

.woowsn-quote-submit {
	background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
	color: white;
	border: none;
	padding: 15px 30px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
	min-width: 200px;
}

.woowsn-quote-submit:hover:not(:disabled) {
	background: linear-gradient(135deg, #005a87 0%, #004a73 100%);
	box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
	transform: translateY(-2px);
}

.woowsn-quote-submit:active:not(:disabled) {
	transform: translateY(0);
	box-shadow: 0 2px 10px rgba(0, 115, 170, 0.3);
}

.woowsn-quote-submit:disabled {
	background: #6c757d;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.woowsn-quote-submit .submit-loading { display: none; }
.woowsn-quote-submit.loading .submit-text { display: none; }
.woowsn-quote-submit.loading .submit-loading { display: inline; }

/* ── Error states ─────────────────────────────────────────────── */
.woowsn-quote-field.error input,
.woowsn-quote-field.error textarea,
.woowsn-quote-field.error select {
	border-color: #dc3545;
	background-color: #fff5f5;
}

.woowsn-quote-field .field-error {
	color: #dc3545;
	font-size: 12px;
	font-weight: 500;
	margin-top: 5px;
	display: flex;
	align-items: center;
	gap: 5px;
}

/* ── Popup trigger button (mirrors pro) ───────────────────────── */
.woowsn-quote-popup-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
	color: #fff;
	border: none;
	padding: 12px 24px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.25);
}

.woowsn-quote-popup-btn:hover {
	background: linear-gradient(135deg, #005a87 0%, #004a73 100%);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.35);
	transform: translateY(-1px);
}

.woowsn-quote-popup-btn:active { transform: translateY(0); }

/* ── Popup overlay (mirrors pro) ──────────────────────────────── */
.woowsn-quote-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	backdrop-filter: blur(2px);
}

.woowsn-quote-popup-modal {
	position: relative;
	background: #fff;
	border-radius: 12px;
	max-width: 600px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: woowsn-popup-slide-in 0.25s ease-out;
}

@keyframes woowsn-popup-slide-in {
	from { opacity: 0; transform: translateY(20px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.woowsn-quote-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #f3f4f6;
	color: #6b7280;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
	z-index: 10;
}

.woowsn-quote-popup-close:hover { background: #e5e7eb; color: #1f2937; }

.woowsn-quote-popup-modal .woowsn-quote-form-wrapper {
	border: none;
	border-radius: 0;
	margin: 0;
	background: #fff;
	padding: 28px 28px 24px;
	float: none;
}

.woowsn-quote-popup-modal .woowsn-quote-title { padding-right: 30px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
	.woowsn-quote-form-wrapper { padding: 15px; margin: 15px 0; }
	.woowsn-quote-title { font-size: 18px; }

	.woowsn-quote-field input,
	.woowsn-quote-field textarea,
	.woowsn-quote-field select { padding: 10px 12px; font-size: 16px; }

	.woowsn-quote-submit { width: 100%; padding: 12px 20px; font-size: 14px; }
}

@media (max-width: 640px) {
	.woowsn-quote-popup-overlay { padding: 10px; align-items: flex-end; }
	.woowsn-quote-popup-modal {
		max-height: 85vh;
		border-radius: 12px 12px 0 0;
		animation: woowsn-popup-slide-up 0.25s ease-out;
	}
	@keyframes woowsn-popup-slide-up {
		from { opacity: 0; transform: translateY(100%); }
		to   { opacity: 1; transform: translateY(0); }
	}
	.woowsn-quote-popup-modal .woowsn-quote-form-wrapper { padding: 20px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.woowsn-quote-field input,
	.woowsn-quote-field textarea,
	.woowsn-quote-field select,
	.woowsn-quote-submit,
	.woowsn-quote-popup-btn { transition: none; }
}
