/**
 * Quote Request — cart page + form page styles.
 * @package WPAIC
 */

/* === Price on request (product pages) === */

.wpaic-price-on-request {
	font-style: italic;
	color: #666;
	font-size: 14px;
}

/* =============================================
 * CART PAGE [wpaic_quote_cart]
 * ============================================= */

.wpaic-cart { max-width: 960px; margin: 0 auto; }

.wpaic-cart__empty {
	text-align: center;
	padding: 60px 20px;
	color: #666;
}

.wpaic-cart__table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 24px;
}

.wpaic-cart__table th {
	background: #f5f5f5;
	padding: 12px;
	text-align: left;
	font-size: 13px;
	font-weight: 600;
	border-bottom: 2px solid #ddd;
	white-space: nowrap;
}

.wpaic-cart__th-img { width: 70px; }
.wpaic-cart__th-price,
.wpaic-cart__th-subtotal { text-align: right !important; }
.wpaic-cart__th-qty { text-align: center !important; width: 120px; }
.wpaic-cart__th-remove { width: 40px; }

.wpaic-cart__row td {
	padding: 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.wpaic-cart__row:hover { background: #fafafa; }

.wpaic-cart__cell-img img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #eee;
}

.wpaic-cart__cell-name a {
	color: #1e1e1e;
	text-decoration: none;
	font-weight: 500;
}
.wpaic-cart__cell-name a:hover { color: #2271b1; }

.wpaic-cart__sku {
	display: block;
	font-size: 12px;
	color: #888;
	margin-top: 2px;
}

.wpaic-cart__cell-price,
.wpaic-cart__cell-subtotal {
	text-align: right;
	white-space: nowrap;
}

.wpaic-cart__cell-qty { text-align: center; }

/* Qty control */
.wpaic-cart__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #ccc;
	border-radius: 5px;
	overflow: hidden;
}

.wpaic-cart__qty-btn {
	width: 32px;
	height: 32px;
	border: none;
	background: #f5f5f5;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wpaic-cart__qty-btn:hover { background: #e0e0e0; }

.wpaic-cart__qty-input {
	width: 50px;
	height: 32px;
	text-align: center;
	border: none;
	border-left: 1px solid #ccc;
	border-right: 1px solid #ccc;
	font-size: 14px;
	-moz-appearance: textfield;
}
.wpaic-cart__qty-input::-webkit-inner-spin-button,
.wpaic-cart__qty-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Remove button */
.wpaic-cart__remove {
	background: none;
	border: none;
	font-size: 22px;
	color: #cc1818;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	opacity: 0.6;
}
.wpaic-cart__remove:hover { opacity: 1; }

/* Cart footer */
.wpaic-cart__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	padding: 20px 0;
	border-top: 2px solid #e0e0e0;
}

.wpaic-cart__total {
	font-size: 18px;
}
.wpaic-cart__total strong { font-size: 22px; }
.wpaic-cart__count { color: #888; font-size: 14px; margin-left: 4px; }

.wpaic-cart__actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

/* Buttons */
.wpaic-cart__btn {
	display: inline-block;
	padding: 14px 28px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 6px;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	border: none;
	transition: background 0.2s, transform 0.1s;
}
.wpaic-cart__btn:hover { transform: translateY(-1px); }

.wpaic-cart__btn--shop {
	background: #f0f0f0;
	color: #333;
}
.wpaic-cart__btn--shop:hover { background: #e0e0e0; color: #333; }

.wpaic-cart__btn--quote {
	background: #2271b1;
	color: #fff;
}
.wpaic-cart__btn--quote:hover { background: #135e96; color: #fff; }


/* =============================================
 * FORM PAGE [wpaic_quote_request_form]
 * ============================================= */

.wpaic-quote-form { max-width: 900px; margin: 0 auto; padding: 0 15px; }

/* Products mini-table */
.wpaic-quote-form__products { margin-bottom: 30px; }

.wpaic-quote-form__products-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.wpaic-quote-form__products-table th {
	background: #f5f5f5;
	padding: 10px 12px;
	text-align: left;
	font-weight: 600;
	font-size: 13px;
	border-bottom: 2px solid #ddd;
}

.wpaic-quote-form__products-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.wpaic-quote-form__td-img img {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #eee;
}

.wpaic-quote-form__total-row {
	font-weight: 700;
	background: #f9f9f9;
}
.wpaic-quote-form__total-row td {
	padding: 12px;
	border-top: 2px solid #ddd;
}

/* Form section titles */
.wpaic-quote-form__section-title {
	font-size: 17px;
	font-weight: 600;
	color: #1e1e1e;
	margin: 32px 0 18px;
	padding: 12px 16px;
	background: #f8f9fa;
	border-left: 3px solid #2271b1;
	border-bottom: none;
	border-radius: 0 6px 6px 0;
}

/* 2-column grid */
.wpaic-quote-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.wpaic-quote-form__field { margin-bottom: 16px; }
.wpaic-quote-form__field--full { grid-column: 1 / -1; }

.wpaic-quote-form__label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 6px;
	color: #1e1e1e;
}
.wpaic-required { color: #d63638; margin-left: 2px; }

.wpaic-quote-form__input,
.wpaic-quote-form__select,
.wpaic-quote-form__textarea {
	display: block;
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	border: 1.5px solid #d0d5dd;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wpaic-quote-form__input:focus,
.wpaic-quote-form__select:focus,
.wpaic-quote-form__textarea:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34,113,177,.12);
	outline: none;
}

.wpaic-quote-form__textarea { min-height: 80px; resize: vertical; }

.has-error {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 1px #d63638 !important;
}

.wpaic-quote-form__error {
	color: #d63638;
	font-size: 12px;
	margin-top: 4px;
	min-height: 16px;
}

/* Biz details — 3-column grid */
.wpaic-quote-form__biz-row {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 20px;
}

/* Radio groups */
.wpaic-quote-form__radio-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.wpaic-quote-form__radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1.5px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	transition: border-color 0.2s, background 0.2s;
}
.wpaic-quote-form__radio-label:hover {
	border-color: #2271b1;
	background: #f0f6fc;
}
.wpaic-quote-form__radio-label:has(input:checked) {
	border-color: #2271b1;
	background: #f0f6fc;
}
.wpaic-quote-form__radio-label input[type="radio"] { margin: 0; }

/* File upload zone */
.wpaic-quote-form__file-zone {
	border: 2px dashed #ccc;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
	position: relative;
}
.wpaic-quote-form__file-zone:hover { border-color: #2271b1; background: #f0f6fc; }
.wpaic-quote-form__file-zone.has-file { border-color: #00a32a; background: #f0f9f1; }

.wpaic-quote-form__file-text { color: #666; font-size: 13px; }

.wpaic-quote-form__file-input {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Submit */
.wpaic-quote-form__submit {
	display: block;
	width: 100%;
	padding: 16px 24px;
	font-size: 17px;
	font-weight: 600;
	color: #fff;
	background: #2271b1;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	margin-top: 24px;
	box-shadow: 0 2px 8px rgba(34,113,177,.25);
	transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.wpaic-quote-form__submit:hover { background: #135e96; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(34,113,177,.35); }
.wpaic-quote-form__submit:disabled { background: #a0c4e4; cursor: not-allowed; transform: none; }
.wpaic-quote-form__submit.is-loading { position: relative; color: transparent; }
.wpaic-quote-form__submit.is-loading::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 20px; height: 20px;
	margin: -10px 0 0 -10px;
	border: 3px solid rgba(255,255,255,.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wpaic-spin .8s linear infinite;
}

/* Success */
.wpaic-quote-form__success { text-align: center; padding: 60px 20px; }
.wpaic-quote-form__success-icon {
	display: inline-flex;
	align-items: center; justify-content: center;
	width: 64px; height: 64px;
	background: #00a32a;
	border-radius: 50%;
	margin-bottom: 16px;
}
.wpaic-quote-form__success-icon svg { width: 32px; height: 32px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wpaic-quote-form__success-title { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.wpaic-quote-form__success-text { font-size: 15px; color: #555; margin: 0 0 20px; }
.wpaic-quote-form__success-link {
	display: inline-block;
	padding: 12px 28px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
}
.wpaic-quote-form__success-link:hover { background: #135e96; color: #fff; }

/* Global error */
.wpaic-quote-form__global-error {
	background: #fcf0f1;
	border: 1px solid #d63638;
	border-radius: 5px;
	padding: 12px 16px;
	color: #d63638;
	margin-bottom: 16px;
}

/* Empty cart */
.wpaic-quote-form__empty {
	text-align: center;
	padding: 40px 20px;
	color: #888;
}

/* Spinner */
@keyframes wpaic-spin { to { transform: rotate(360deg); } }

/* =============================================
 * RESPONSIVE
 * ============================================= */

@media (max-width: 768px) {

	/* --- FORM PAGE --- */

	.wpaic-quote-form { padding: 0 10px 80px; }
	.wpaic-quote-form__row { grid-template-columns: 1fr; gap: 0; }
	.wpaic-quote-form__biz-row { grid-template-columns: 1fr; }

	.wpaic-quote-form__section-title {
		margin: 20px 0 14px;
		font-size: 15px;
		padding: 10px 12px;
	}

	.wpaic-quote-form__field { margin-bottom: 12px; }
	.wpaic-quote-form__input,
	.wpaic-quote-form__select,
	.wpaic-quote-form__textarea {
		padding: 10px 12px;
		font-size: 14px;
	}

	.wpaic-quote-form__radio-label { padding: 8px 12px; font-size: 13px; }

	.wpaic-quote-form__submit { font-size: 15px; padding: 14px 20px; margin-top: 20px; }

	/* Form products table — hide image, compact */
	.wpaic-quote-form__products-table .wpaic-quote-form__td-img { display: none; }
	.wpaic-quote-form__products-table th,
	.wpaic-quote-form__products-table td { padding: 8px; font-size: 13px; }

	/* --- CART PAGE — card layout --- */

	.wpaic-cart { padding: 0 10px 80px; }

	.wpaic-cart__table { display: block; border: none; }
	.wpaic-cart__table thead { display: none; }
	.wpaic-cart__table tbody { display: block; }

	.wpaic-cart__row {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto;
		gap: 6px 8px;
		padding: 14px 12px;
		margin-bottom: 10px;
		border: 1px solid #eee;
		border-radius: 10px;
		background: #fff;
		box-shadow: 0 1px 4px rgba(0,0,0,.04);
	}
	.wpaic-cart__row td {
		display: block;
		padding: 0;
		border: none;
	}

	/* Row 1, col 1: product image + name */
	.wpaic-cart__cell-img { display: none !important; }

	.wpaic-cart__cell-name {
		grid-column: 1 / 2;
		grid-row: 1;
	}
	.wpaic-cart__cell-name a { font-size: 14px; font-weight: 600; line-height: 1.3; }
	.wpaic-cart__sku { font-size: 11px; }

	/* Row 1, col 2: remove button */
	.wpaic-cart__cell-remove {
		grid-column: 2 / 3;
		grid-row: 1;
		text-align: right;
	}
	.wpaic-cart__remove { padding: 0; font-size: 20px; }

	/* Row 2: price, qty, subtotal — horizontal layout */
	.wpaic-cart__cell-price {
		grid-column: 1 / -1;
		grid-row: 2;
		display: flex;
		align-items: center;
		gap: 8px;
		font-size: 13px;
		color: #666;
		white-space: normal;
	}
	.wpaic-cart__cell-price::before { content: 'Цена: '; font-weight: 400; color: #888; }

	.wpaic-cart__cell-qty {
		grid-column: 1 / 2;
		grid-row: 3;
		text-align: left;
	}

	.wpaic-cart__cell-subtotal {
		grid-column: 2 / 3;
		grid-row: 3;
		text-align: right;
		font-weight: 700;
		font-size: 15px;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		white-space: normal;
	}

	/* Compact qty control */
	.wpaic-cart__qty-btn { width: 30px; height: 30px; font-size: 15px; }
	.wpaic-cart__qty-input { width: 52px; height: 30px; font-size: 13px; padding: 4px 6px !important; }

	/* Footer — extra bottom padding so buttons clear bottom menu + chat */
	.wpaic-cart__footer {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		padding: 16px 0 100px;
		gap: 12px;
	}
	.wpaic-cart__total { font-size: 16px; }
	.wpaic-cart__total strong { font-size: 20px; }
	.wpaic-cart__actions { flex-direction: column; gap: 10px; }
	.wpaic-cart__btn { width: 100%; padding: 12px 20px; font-size: 14px; }
}

/* =============================================
 * "ADD TO QUOTE" BUTTON (product pages + catalog)
 * Block 60.5
 * ============================================= */

.wpaic-add-to-quote-btn {
	display: inline-block;
	padding: 8px 16px;
	border: 2px solid #2271b1;
	background: transparent;
	color: #2271b1;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.2s ease;
	text-decoration: none;
	text-align: center;
}
.wpaic-add-to-quote-btn:hover {
	background: #2271b1;
	color: #fff;
}
.wpaic-add-to-quote-btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}
.wpaic-add-to-quote-btn.wpaic-added {
	background: #00a32a;
	border-color: #00a32a;
	color: #fff;
}

/* Loop (catalog) variant */
.wpaic-add-to-quote-btn--loop {
	font-size: 13px;
	padding: 6px 12px;
	margin-top: 4px;
	width: 100%;
	box-sizing: border-box;
}

/* Mini quote counter */
.wpaic-quote-counter {
	display: inline-block;
	background: #2271b1;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	border-radius: 9px;
	margin-left: 4px;
}
