/* ==========================================================================
   لنالند - استایل فرم درخواست پیش‌فاکتور
   ========================================================================== */

.llq-wrap {
	--llq-primary: #0b7285;
	--llq-primary-dark: #095c6b;
	--llq-accent: #f59f00;
	--llq-bg: #ffffff;
	--llq-border: #e2e8ea;
	--llq-text: #2d3436;
	--llq-muted: #6b7780;
	--llq-radius: 12px;
	--llq-shadow: 0 4px 24px rgba(11, 114, 133, 0.08);
	font-family: inherit;
	color: var(--llq-text);
	max-width: 880px;
	margin: 0 auto;
}

.llq-wrap * {
	box-sizing: border-box;
}

.llq-form-card {
	background: var(--llq-bg);
	border: 1px solid var(--llq-border);
	border-radius: var(--llq-radius);
	box-shadow: var(--llq-shadow);
	overflow: hidden;
}

.llq-form-header {
	background: linear-gradient(135deg, var(--llq-primary), var(--llq-primary-dark));
	color: #fff;
	padding: 22px 26px;
}

.llq-form-header h3 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	color: #fff;
}

.llq-form-header p {
	margin: 0;
	font-size: 13px;
	opacity: 0.9;
	line-height: 1.7;
}

#llq-form {
	padding: 24px 26px;
}

.llq-section {
	margin-bottom: 22px;
}

.llq-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 7px;
	color: var(--llq-text);
}

.llq-req {
	color: #e03131;
}

.llq-hint {
	font-size: 12px;
	color: var(--llq-muted);
	margin: 7px 0 0;
}

/* اتوکمپلیت */
.llq-autocomplete {
	position: relative;
}

#llq-product-search,
.llq-field input,
.llq-field textarea,
#llq-discount {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--llq-border);
	border-radius: 9px;
	font-size: 14px;
	font-family: inherit;
	color: var(--llq-text);
	transition: border-color 0.15s, box-shadow 0.15s;
	background: #fff;
}

#llq-product-search:focus,
.llq-field input:focus,
.llq-field textarea:focus {
	outline: none;
	border-color: var(--llq-primary);
	box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.12);
}

.llq-suggestions {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	left: 0;
	background: #fff;
	border: 1px solid var(--llq-border);
	border-radius: 10px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
	max-height: 320px;
	overflow-y: auto;
	z-index: 50;
	display: none;
}

.llq-suggestions.active {
	display: block;
}

.llq-suggestion {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f1f3f4;
	transition: background 0.12s;
}

.llq-suggestion:last-child {
	border-bottom: none;
}

.llq-suggestion:hover,
.llq-suggestion.highlight {
	background: #eef6f8;
}

.llq-suggestion img {
	width: 38px;
	height: 38px;
	object-fit: cover;
	border-radius: 7px;
	flex-shrink: 0;
}

.llq-suggestion-thumb-ph {
	width: 38px;
	height: 38px;
	border-radius: 7px;
	background: #eef0f2;
	flex-shrink: 0;
}

.llq-suggestion-info {
	flex: 1;
	min-width: 0;
}

.llq-suggestion-name {
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.llq-suggestion-meta {
	font-size: 11.5px;
	color: var(--llq-muted);
	margin-top: 2px;
}

.llq-suggestion-price {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--llq-primary);
	flex-shrink: 0;
}

.llq-suggestion-manual {
	color: var(--llq-primary);
	font-weight: 600;
	justify-content: center;
}

.llq-suggestion-empty {
	padding: 16px;
	text-align: center;
	color: var(--llq-muted);
	font-size: 13px;
}

/* جدول آیتم‌ها */
.llq-items-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--llq-border);
	border-radius: 10px;
	overflow: hidden;
}

.llq-items-table thead th {
	background: #f7f9fa;
	font-size: 12px;
	font-weight: 600;
	color: var(--llq-muted);
	padding: 11px 10px;
	text-align: right;
	border-bottom: 1px solid var(--llq-border);
}

.llq-items-table td {
	padding: 9px 10px;
	border-bottom: 1px solid #f1f3f4;
	font-size: 13px;
	vertical-align: middle;
}

.llq-items-table tbody tr:last-child td {
	border-bottom: none;
}

.llq-empty-row td {
	text-align: center;
	color: var(--llq-muted);
	padding: 22px;
	font-size: 13px;
}

.llq-col-qty { width: 90px; }
.llq-col-unit { width: 110px; }
.llq-col-price { width: 110px; }
.llq-col-total { width: 120px; }
.llq-col-action { width: 44px; }

.llq-qty-input {
	width: 72px;
	padding: 6px 8px;
	border: 1.5px solid var(--llq-border);
	border-radius: 7px;
	font-size: 13px;
	text-align: center;
	font-family: inherit;
}

.llq-qty-input:focus {
	outline: none;
	border-color: var(--llq-primary);
}

.llq-unit-select {
	width: 100%;
	padding: 6px 8px;
	border: 1.5px solid var(--llq-border);
	border-radius: 7px;
	font-size: 13px;
	font-family: inherit;
	background: #fff;
}

.llq-item-name {
	font-weight: 600;
}

.llq-item-sku {
	font-size: 11px;
	color: var(--llq-muted);
}

.llq-remove-btn {
	background: #fff0f0;
	color: #e03131;
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	transition: background 0.12s;
}

.llq-remove-btn:hover {
	background: #ffe3e3;
}

/* جمع‌بندی */
.llq-summary {
	background: #f7f9fa;
	border: 1px solid var(--llq-border);
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 22px;
	max-width: 340px;
	margin-right: auto;
	margin-left: 0;
}

.llq-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 0;
	font-size: 13.5px;
}

.llq-summary-row span:last-child {
	font-weight: 600;
}

.llq-summary-row #llq-discount {
	width: 110px;
	padding: 5px 8px;
	font-size: 13px;
	text-align: center;
}

.llq-summary-row.llq-grand {
	border-top: 2px solid var(--llq-border);
	margin-top: 6px;
	padding-top: 10px;
	font-size: 16px;
	color: var(--llq-primary);
}

.llq-summary-row.llq-grand span {
	font-weight: 800;
}

/* فیلدها */
.llq-fields-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.llq-field {
	margin: 0;
}

.llq-col-half {
	flex: 1 1 calc(50% - 8px);
	min-width: 220px;
}

.llq-col-full {
	flex: 1 1 100%;
}

/* honeypot */
.llq-hp {
	position: absolute;
	left: -9999px;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

/* دکمه ثبت */
.llq-actions {
	margin-top: 8px;
}

.llq-submit-btn {
	width: 100%;
	background: linear-gradient(135deg, var(--llq-primary), var(--llq-primary-dark));
	color: #fff;
	border: none;
	padding: 14px 24px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
	box-shadow: 0 4px 14px rgba(11, 114, 133, 0.25);
}

.llq-submit-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(11, 114, 133, 0.32);
}

.llq-submit-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

/* پیام‌ها */
.llq-message {
	margin-top: 14px;
	padding: 0;
	font-size: 13.5px;
	border-radius: 9px;
	display: none;
}

.llq-message.show {
	display: block;
	padding: 12px 16px;
}

.llq-message.error {
	background: #fff0f0;
	color: #c92a2a;
	border: 1px solid #ffc9c9;
}

.llq-message.success {
	background: #ebfbee;
	color: #2b8a3e;
	border: 1px solid #b2f2bb;
}

/* مودال پیش‌نمایش */
.llq-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.llq-modal.active {
	display: block;
}

.llq-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.llq-modal-content {
	position: relative;
	background: #f0f2f4;
	max-width: 860px;
	margin: 30px auto;
	border-radius: 14px;
	max-height: calc(100vh - 60px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.llq-modal-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: #fff;
	border-bottom: 1px solid var(--llq-border);
}

.llq-modal-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--llq-text);
}

.llq-modal-buttons {
	display: flex;
	gap: 8px;
	align-items: center;
}

.llq-btn-pdf,
.llq-btn-print {
	background: var(--llq-primary);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
	transition: background 0.12s;
}

.llq-btn-pdf:hover,
.llq-btn-print:hover {
	background: var(--llq-primary-dark);
	color: #fff;
}

.llq-btn-print {
	background: #495057;
}

.llq-btn-print:hover {
	background: #343a40;
}

.llq-btn-close {
	background: #f1f3f4;
	color: #495057;
	border: none;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.llq-btn-close:hover {
	background: #e9ecef;
}

.llq-invoice-preview {
	padding: 24px;
	overflow-y: auto;
	background: #f0f2f4;
}

.llq-invoice-preview .llq-invoice {
	background: #fff;
	padding: 30px;
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* اسپینر */
.llq-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: llq-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-left: 8px;
}

@keyframes llq-spin {
	to { transform: rotate(360deg); }
}

/* واکنش‌گرا */
@media (max-width: 600px) {
	#llq-form {
		padding: 18px 16px;
	}

	.llq-items-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.llq-summary {
		max-width: 100%;
	}

	.llq-col-half {
		flex: 1 1 100%;
	}

	.llq-modal-content {
		margin: 0;
		border-radius: 0;
		max-height: 100vh;
		height: 100vh;
	}

	.llq-modal-title {
		font-size: 13px;
	}

	.llq-btn-pdf,
	.llq-btn-print {
		padding: 7px 10px;
		font-size: 12px;
	}
}
