/**
 * Frontend styles for WooCommerce B2B Product Enquiry Pro.
 *
 * Designed with a premium, modern aesthetic including glassmorphism, 
 * subtle animations, and responsive layouts.
 */

/* Single Product Enquiry Section */
.wc-pep-enquiry-section {
	margin: 1.5em 0;
	padding: 1.5em;
	background: #f8fafc;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wc-pep-enquiry-section.hide-buy-now ~ .buy-now-button,
.wc-pep-enquiry-section.hide-buy-now ~ .wppb-buy-now-btn {
	display: none !important;
}

.wc-pep-manufacturer-info {
	margin-bottom: 1em;
	font-size: 0.95em;
	color: #475569;
}

.wc-pep-manufacturer-info .label {
	font-weight: 600;
	margin-right: 0.5em;
}

.wc-pep-manufacturer-info .value {
	background: #e2e8f0;
	padding: 0.25em 0.75em;
	border-radius: 9999px;
	font-size: 0.9em;
	color: #0f172a;
	display: inline-block;
}

.wc-pep-quantity-row {
	display: flex;
	align-items: center;
	gap: 1em;
	flex-wrap: wrap;
}

.wc-pep-quantity-row .quantity {
	display: inline-flex;
	align-items: center;
}

.wc-pep-quantity-row .quantity input.qty {
	width: 80px;
	height: 48px;
	text-align: center;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	font-size: 1em;
	font-weight: 600;
	background: #ffffff;
	color: #0f172a;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wc-pep-quantity-row .quantity input.qty:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
	outline: none;
}

.wc-pep-button {
	height: 48px;
	padding: 0 2em;
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 8px !important;
	font-weight: 600 !important;
	font-size: 1em !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease-in-out !important;
	box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
}

.wc-pep-button:hover {
	background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
	transform: translateY(-1px);
	box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.15), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
}

.wc-pep-button:active {
	transform: translateY(0);
}

.wc-pep-button:disabled {
	background: #cbd5e1 !important;
	color: #94a3b8 !important;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.wc-pep-error-message {
	margin-top: 0.75em;
	color: #ef4444;
	font-size: 0.9em;
	font-weight: 500;
	display: flex;
	align-items: center;
	animation: wcPepFadeIn 0.2s ease-out;
}

/* Modal Overlay */
.wc-pep-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.4);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5em;
	box-sizing: border-box;
}

/* Modal Container (Glassmorphism) */
.wc-pep-modal-container {
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 20px;
	width: 100%;
	max-width: 600px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	position: relative;
	animation: wcPepSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

/* Scrollbar styling for modal */
.wc-pep-modal-container::-webkit-scrollbar {
	width: 8px;
}
.wc-pep-modal-container::-webkit-scrollbar-track {
	background: transparent;
}
.wc-pep-modal-container::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.15);
	border-radius: 9999px;
}
.wc-pep-modal-container::-webkit-scrollbar-thumb:hover {
	background: rgba(15, 23, 42, 0.3);
}

.wc-pep-modal-close {
	position: absolute;
	top: 1.25em;
	right: 1.25em;
	background: rgba(15, 23, 42, 0.05);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #64748b;
	transition: all 0.2s ease;
}

.wc-pep-modal-close:hover {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	transform: rotate(90deg);
}

.wc-pep-modal-header {
	padding: 2.25em 2.25em 1em 2.25em;
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.wc-pep-modal-header h2 {
	margin: 0 0 0.25em 0 !important;
	font-size: 1.6em;
	font-weight: 700;
	color: #0f172a;
}

.wc-pep-modal-sub {
	margin: 0;
	color: #64748b;
	font-size: 0.95em;
}

.wc-pep-modal-body {
	padding: 1.5em 2.25em 2.25em 2.25em;
}

/* Glassmorphic Product Info Card */
.wc-pep-form-product-summary {
	background: rgba(15, 23, 42, 0.03);
	border: 1px solid rgba(15, 23, 42, 0.06);
	border-radius: 12px;
	padding: 1.25em;
	margin-bottom: 1.5em;
}

.wc-pep-summary-item {
	margin-bottom: 0.5em;
	font-size: 0.95em;
}

.wc-pep-summary-item:last-child {
	margin-bottom: 0;
}

.wc-pep-summary-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em;
	margin-bottom: 0.5em;
}

.wc-pep-summary-item .label {
	color: #64748b;
	font-weight: 500;
	margin-right: 0.5em;
}

.wc-pep-summary-item .value {
	color: #0f172a;
	font-weight: 600;
}

.wc-pep-qty-item {
	border-top: 1px dashed rgba(15, 23, 42, 0.08);
	padding-top: 0.5em;
	margin-top: 0.5em;
}

/* Form Styles */
.wc-pep-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25em;
}

@media (max-width: 480px) {
	.wc-pep-form-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.wc-pep-form-group {
	margin-bottom: 1.25em;
}

.wc-pep-form-group label {
	display: block;
	font-size: 0.9em;
	font-weight: 600;
	color: #334155;
	margin-bottom: 0.5em;
}

.wc-pep-form-group input[type="text"],
.wc-pep-form-group input[type="email"],
.wc-pep-form-group input[type="tel"],
.wc-pep-form-group textarea {
	width: 100%;
	padding: 0.75em 1em;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	font-size: 0.95em;
	background: #ffffff;
	color: #0f172a;
	box-sizing: border-box;
	transition: all 0.2s ease;
}

.wc-pep-form-group input:focus,
.wc-pep-form-group textarea:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
	outline: none;
}

.wc-pep-form-submit-row {
	margin-top: 1.5em;
	text-align: right;
}

.wc-pep-form-submit-row button {
	width: 100%;
	display: inline-flex;
	justify-content: center;
}

/* Status Notifications */
.wc-pep-response-message {
	padding: 1em;
	border-radius: 8px;
	margin-top: 1em;
	font-size: 0.95em;
	font-weight: 500;
	animation: wcPepFadeIn 0.2s ease-out;
}

.wc-pep-response-message.success {
	background-color: rgba(34, 197, 94, 0.1);
	color: #15803d;
	border: 1px solid rgba(34, 197, 94, 0.25);
}

.wc-pep-response-message.error {
	background-color: rgba(239, 68, 68, 0.1);
	color: #b91c1c;
	border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Spinner anim */
.btn-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: wcPepSpin 0.8s linear infinite;
	margin-left: 0.5em;
}

/* Price placeholders */
.wc-pep-price-placeholder {
	font-weight: 600;
	color: #64748b;
	font-size: 0.9em;
}

/* Animations */
@keyframes wcPepSlideUp {
	from {
		transform: translateY(24px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes wcPepFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes wcPepSpin {
	to {
		transform: rotate(360deg);
	}
}

/* AJAX Search Widget Styles */
.wc-pep-search-widget {
	position: relative;
	width: 100%;
	max-width: 600px;
	margin: 1.5em auto;
	box-sizing: border-box;
}

.wc-pep-search-box-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.wc-pep-search-input {
	width: 100%;
	padding: 0.85em 1em 0.85em 2.75em !important;
	border: 1.5px solid #cbd5e1 !important;
	border-radius: 9999px !important;
	font-size: 1em !important;
	outline: none !important;
	background: #ffffff !important;
	color: #0f172a !important;
	box-sizing: border-box;
	transition: all 0.2s ease-in-out !important;
	box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
}

.wc-pep-search-input:focus {
	border-color: #3b82f6 !important;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.wc-pep-search-icon {
	position: absolute;
	left: 14px;
	display: flex;
	align-items: center;
	color: #94a3b8;
	pointer-events: none;
}

.wc-pep-search-spinner {
	position: absolute;
	right: 14px;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(15, 23, 42, 0.1);
	border-radius: 50%;
	border-top-color: #3b82f6;
	animation: wcPepSpin 0.6s linear infinite;
}

/* Search results dropdown panel */
.wc-pep-search-results-overlay {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 16px;
	margin-top: 10px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	z-index: 9999;
	max-height: 380px;
	overflow-y: auto;
	padding: 0.5em;
	box-sizing: border-box;
	animation: wcPepSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Results panel scrollbar */
.wc-pep-search-results-overlay::-webkit-scrollbar {
	width: 6px;
}
.wc-pep-search-results-overlay::-webkit-scrollbar-track {
	background: transparent;
}
.wc-pep-search-results-overlay::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.1);
	border-radius: 9999px;
}

.wc-pep-search-results-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wc-pep-search-result-row {
	display: flex;
	align-items: center;
	padding: 0.65em;
	border-radius: 8px;
	text-decoration: none !important;
	color: #0f172a !important;
	transition: background 0.15s ease;
	box-sizing: border-box;
}

.wc-pep-search-result-row:hover {
	background: rgba(15, 23, 42, 0.04);
}

.wc-pep-search-result-img {
	width: 40px;
	height: 40px;
	border-radius: 6px;
	overflow: hidden;
	margin-right: 12px;
	flex-shrink: 0;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wc-pep-search-result-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wc-pep-search-result-info {
	flex-grow: 1;
	min-width: 0;
}

.wc-pep-search-result-title {
	font-weight: 600;
	font-size: 0.9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 2px;
	color: #0f172a;
}

.wc-pep-search-result-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 0.75em;
	color: #64748b;
}

.wc-pep-search-result-meta span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wc-pep-search-result-price-action {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: 12px;
	flex-shrink: 0;
}

.wc-pep-search-result-price {
	font-size: 0.85em;
	font-weight: 600;
	color: #0f172a;
}

.wc-pep-search-result-action-btn {
	font-size: 0.75em;
	font-weight: 600;
	background: #0f172a;
	color: #ffffff;
	padding: 4px 10px;
	border-radius: 6px;
	transition: background 0.15s;
	display: inline-block;
}

.wc-pep-search-result-row:hover .wc-pep-search-result-action-btn {
	background: #3b82f6;
}

.wc-pep-search-no-results {
	padding: 1.5em;
	text-align: center;
	color: #64748b;
	font-size: 0.9em;
	font-weight: 500;
}

