/**
 * WooCommerce Catalog Mode & Product Enquiry - Frontend Styles
 *
 * Polished, high-aesthetic styling for enquiry buttons, responsive modal dialog,
 * animations, inputs, and feedback states.
 */

/* ==========================================================================
   1. Enquire Now Button Styling
   ========================================================================== */
.wcce-button-wrapper {
	display: inline-block;
	margin: 8px 0;
	vertical-align: middle;
}

.wcce-wrapper-loop {
	display: block;
	width: 100%;
	margin-top: 10px;
}

.wcce-enquire-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 20px !important;
	font-family: inherit;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	text-decoration: none !important;
	cursor: pointer;
	border: 1px solid transparent !important;
	border-radius: var(--wcce-btn-radius, 6px) !important;
	background-color: var(--wcce-btn-bg, #1e293b) !important;
	color: var(--wcce-btn-text, #ffffff) !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
	transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
	position: relative;
	overflow: hidden;
}

.wcce-enquire-btn:hover {
	background-color: var(--wcce-btn-hover-bg, #0f172a) !important;
	color: var(--wcce-btn-hover-text, #ffffff) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
	transform: translateY(-1px);
}

.wcce-enquire-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.wcce-enquire-btn:focus-visible {
	outline: 2px solid var(--wcce-btn-bg, #1e293b) !important;
	outline-offset: 2px;
}

.wcce-context-loop {
	width: 100%;
}

.wcce-btn-icon {
	display: inline-flex;
	align-items: center;
	transition: transform 0.2s ease;
}

.wcce-enquire-btn:hover .wcce-btn-icon {
	transform: scale(1.1);
}

/* ==========================================================================
   2. Modal Overlay & Container
   ========================================================================== */
body.wcce-modal-open {
	overflow: hidden !important;
}

.wcce-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.wcce-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: opacity 0.25s ease;
	opacity: 0;
}

.wcce-modal-overlay.wcce-active .wcce-modal-backdrop {
	opacity: 1;
}

.wcce-modal-container {
	position: relative;
	width: 100%;
	max-width: 540px;
	max-height: 90vh;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
	overflow-y: auto;
	z-index: 2;
	box-sizing: border-box;
	transform: scale(0.95) translateY(10px);
	opacity: 0;
	transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.wcce-modal-overlay.wcce-active .wcce-modal-container {
	transform: scale(1) translateY(0);
	opacity: 1;
}

/* ==========================================================================
   3. Modal Header
   ========================================================================== */
.wcce-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 24px 28px 16px;
	border-bottom: 1px solid #f1f5f9;
}

.wcce-header-text {
	flex: 1;
	padding-right: 16px;
}

.wcce-badge-tag {
	display: inline-block;
	background: #eff6ff;
	color: #2563eb;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 3px 8px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.wcce-modal-title {
	margin: 0 0 4px 0 !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	line-height: 1.3 !important;
}

.wcce-modal-subtitle {
	margin: 0 !important;
	font-size: 13px !important;
	color: #64748b !important;
	line-height: 1.5 !important;
}

.wcce-modal-close {
	background: #f8fafc !important;
	border: 1px solid #e2e8f0 !important;
	color: #64748b !important;
	border-radius: 50% !important;
	width: 34px !important;
	height: 34px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	padding: 0 !important;
	transition: all 0.2s ease !important;
	box-shadow: none !important;
}

.wcce-modal-close:hover {
	background: #fee2e2 !important;
	border-color: #fca5a5 !important;
	color: #ef4444 !important;
	transform: rotate(90deg);
}

.wcce-modal-close:focus-visible {
	outline: 2px solid #ef4444;
	outline-offset: 2px;
}

/* ==========================================================================
   4. Modal Body & Product Preview Card
   ========================================================================== */
.wcce-modal-body {
	padding: 20px 28px 28px;
}

.wcce-product-summary-card {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 12px 14px;
	margin-bottom: 20px;
}

.wcce-product-summary-thumb {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 8px;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #e2e8f0;
}

.wcce-product-summary-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wcce-product-summary-details {
	flex: 1;
	min-width: 0;
}

.wcce-product-summary-name {
	margin: 0 0 4px 0 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	color: #0f172a !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wcce-product-summary-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.wcce-sku-badge,
.wcce-variation-badge {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 6px;
	font-weight: 500;
}

.wcce-sku-badge {
	background: #e2e8f0;
	color: #475569;
}

.wcce-variation-badge {
	background: #dbeafe;
	color: #1e40af;
}

/* ==========================================================================
   5. Form Controls & Layout
   ========================================================================== */
.wcce-enquiry-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wcce-form-row {
	display: flex;
	gap: 12px;
}

.wcce-form-row .wcce-form-group {
	flex: 1;
}

.wcce-form-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.wcce-label {
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #334155 !important;
	margin: 0 !important;
}

.wcce-required {
	color: #ef4444;
	font-weight: 700;
}

.wcce-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.wcce-input,
.wcce-textarea {
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 10px 14px !important;
	font-size: 14px !important;
	font-family: inherit !important;
	color: #0f172a !important;
	background: #ffffff !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	line-height: 1.5 !important;
	transition: all 0.2s ease !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.wcce-input:focus,
.wcce-textarea:focus {
	outline: none !important;
	border-color: #2563eb !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.wcce-input-readonly {
	background: #f1f5f9 !important;
	border-color: #e2e8f0 !important;
	color: #475569 !important;
	cursor: default;
	padding-right: 38px !important;
}

.wcce-input-icon {
	position: absolute;
	right: 12px;
	color: #94a3b8;
	pointer-events: none;
	display: flex;
	align-items: center;
}

.wcce-textarea {
	resize: vertical;
	min-height: 80px;
}

.wcce-input.wcce-field-error,
.wcce-textarea.wcce-field-error {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Privacy Checkbox */
.wcce-privacy-group {
	margin-top: 2px;
}

.wcce-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	color: #64748b;
	cursor: pointer;
	line-height: 1.4;
}

.wcce-checkbox-label input[type="checkbox"] {
	margin-top: 2px;
	accent-color: #2563eb;
}

/* ==========================================================================
   6. Form Submit Button & Spinner
   ========================================================================== */
.wcce-form-footer {
	margin-top: 6px;
}

.wcce-submit-btn {
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px;
	padding: 12px 24px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	border-radius: 8px !important;
	border: none !important;
	background: var(--wcce-btn-bg, #1e293b) !important;
	color: var(--wcce-btn-text, #ffffff) !important;
	cursor: pointer !important;
	transition: all 0.22s ease !important;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}

.wcce-submit-btn:hover {
	background: var(--wcce-btn-hover-bg, #0f172a) !important;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18) !important;
	transform: translateY(-1px);
}

.wcce-submit-btn:active {
	transform: translateY(0);
}

.wcce-submit-btn:disabled {
	opacity: 0.75 !important;
	cursor: not-allowed !important;
	transform: none !important;
}

/* SVG Spinner */
.wcce-spinner-svg {
	animation: wcce-spin 1s linear infinite;
	width: 18px;
	height: 18px;
}

.wcce-spinner-path {
	stroke: #ffffff;
	stroke-linecap: round;
	animation: wcce-dash 1.5s ease-in-out infinite;
}

@keyframes wcce-spin {
	100% { transform: rotate(360deg); }
}

@keyframes wcce-dash {
	0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
	50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
	100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* ==========================================================================
   7. Form Alerts & Feedback Notices
   ========================================================================== */
.wcce-form-notice {
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
	animation: wcce-fade-in 0.3s ease;
}

.wcce-notice-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.wcce-notice-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

@keyframes wcce-fade-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Inline Form Specifics */
.wcce-form-inline {
	max-width: 600px;
	margin: 20px auto;
	padding: 24px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments */
@media (max-width: 580px) {
	.wcce-form-row {
		flex-direction: column;
		gap: 14px;
	}
	.wcce-modal-header {
		padding: 20px 20px 14px;
	}
	.wcce-modal-body {
		padding: 16px 20px 24px;
	}
}
