/* ============================================================
 * Конфигуратор ПК — стили.
 * Использует CSS-переменные из main.css (--pc-bg, --pc-accent и т.д.).
 * ============================================================ */

.pc-config {
	max-width: 1320px;
	margin: 0 auto;
	padding: 48px 20px 80px;
	color: var(--pc-text);
}

/* === HEADER === */

.pc-config__head {
	margin-bottom: 40px;
	max-width: 720px;
}

.pc-config__eyebrow {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: var(--pc-accent);
	margin: 0 0 14px;
}

.pc-config__title {
	font-size: clamp(32px, 5vw, 52px);
	font-weight: 800;
	line-height: 1.05;
	margin: 0 0 16px;
	color: var(--pc-text);
	letter-spacing: -0.02em;
}

.pc-config__lead {
	font-size: 17px;
	line-height: 1.55;
	color: var(--pc-text-dim);
	margin: 0;
}

.pc-config__hours {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	line-height: 1.55;
	color: var(--pc-text-muted, #8d8d92);
	margin: 12px 0 0;
	padding: 12px 14px;
	background: rgba(255, 42, 42, 0.06);
	border: 1px solid rgba(255, 42, 42, 0.22);
	border-radius: 8px;
	max-width: 720px;
}
.pc-config__hours-icon {
	flex: 0 0 auto;
	font-size: 15px;
	line-height: 1.55;
	color: var(--pc-accent, #ff2a2a);
}
.pc-config__hours-text {
	flex: 1 1 auto;
	min-width: 0;
}
.pc-config__hours strong {
	color: #ffffff;
	font-weight: 700;
	white-space: nowrap;
}
@media (max-width: 480px) {
	.pc-config__hours {
		font-size: 12.5px;
		padding: 10px 12px;
	}
}

/* === GRID: слоты + summary === */

.pc-config__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 32px;
	align-items: start;
}

@media (max-width: 960px) {
	.pc-config__grid {
		grid-template-columns: 1fr;
	}
}

/* === ЛЕВАЯ КОЛОНКА: СЛОТЫ === */

.pc-config__slots {
	display: grid;
	gap: 12px;
}

.pc-slot {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: 16px;
	padding: 16px 18px;
	background: var(--pc-bg-card);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-md);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	position: relative;
}

.pc-slot:hover {
	border-color: var(--pc-border-strong, #2c3340);
}

.pc-slot.is-filled {
	border-color: var(--pc-border-strong, #2c3340);
}

.pc-slot.is-invalid {
	border-color: #ff6b6b;
	box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.3);
}

/* Иконка слота */
.pc-slot__icon {
	width: 56px;
	height: 56px;
	border-radius: 10px;
	background: var(--pc-bg-elevated);
	border: 1px solid var(--pc-border);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--pc-text-dim);
	flex-shrink: 0;
}

.pc-slot__icon svg {
	width: 28px;
	height: 28px;
}

.pc-slot.is-filled .pc-slot__icon {
	color: var(--pc-accent);
	border-color: var(--pc-accent-dim, rgba(232, 65, 66, 0.35));
	background: rgba(232, 65, 66, 0.06);
}

/* Тело слота */
.pc-slot__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: center;
}

.pc-slot__head {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.pc-slot__label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--pc-text-dim);
}

.pc-slot__optional {
	font-size: 11px;
	color: var(--pc-text-muted, #6c7280);
	font-style: italic;
}

/* Empty state */
.pc-slot__empty {
	display: flex;
}

.pc-slot__pick {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	background: transparent !important;
	color: var(--pc-text) !important;
	border: 1px solid var(--pc-border) !important;
	border-radius: var(--pc-radius-sm) !important;
	cursor: pointer;
	transition: all 0.15s ease;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

.pc-slot__pick:hover,
.pc-slot__pick:focus {
	border-color: var(--pc-accent) !important;
	color: var(--pc-accent) !important;
	background: rgba(232, 65, 66, 0.06) !important;
}

/* Filled state */
.pc-slot__filled {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
}

.pc-slot__product {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.pc-slot__brand {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--pc-text-muted, #6c7280);
}

.pc-slot__name {
	font-size: 15px;
	font-weight: 600;
	color: var(--pc-text);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pc-slot__specs {
	font-size: 12px;
	color: var(--pc-text-dim);
	line-height: 1.3;
}

.pc-slot__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.pc-slot__price {
	font-size: 16px;
	font-weight: 700;
	color: var(--pc-text);
	white-space: nowrap;
}

.pc-slot__actions {
	display: flex;
	gap: 6px;
}

.pc-slot__change,
.pc-slot__remove {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	background: transparent;
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-sm);
	color: var(--pc-text-dim);
	cursor: pointer;
	font-size: 12px;
	transition: all 0.15s ease;
}

.pc-slot__change:hover {
	color: var(--pc-accent);
	border-color: var(--pc-accent);
}

.pc-slot__remove:hover {
	color: #ff6b6b;
	border-color: #ff6b6b;
}

/* Несовместимость */
.pc-slot__warning {
	grid-column: 1 / -1;
	margin-top: 8px;
	padding: 8px 12px;
	background: rgba(255, 107, 107, 0.08);
	border: 1px solid rgba(255, 107, 107, 0.3);
	border-radius: var(--pc-radius-sm);
	color: #ffb3b3;
	font-size: 12.5px;
	line-height: 1.4;
}

/* === ПРАВАЯ КОЛОНКА: SUMMARY === */

.pc-config__summary {
	position: sticky;
	top: calc(var(--pc-header-height, 80px) + 20px);
}

@media (max-width: 960px) {
	.pc-config__summary {
		position: static;
	}
}

.pc-summary {
	background: var(--pc-bg-card);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-md);
	padding: 24px;
}

.pc-summary__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--pc-border);
}

.pc-summary__title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: var(--pc-text);
}

.pc-summary__reset {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 8px;
	background: transparent;
	border: none;
	color: var(--pc-text-dim);
	font-size: 12px;
	cursor: pointer;
	border-radius: var(--pc-radius-sm);
	transition: color 0.15s ease;
}

.pc-summary__reset:hover {
	color: var(--pc-accent);
}

.pc-summary__included {
	/* v1.13.411: flex-start чтобы свг сверху, текст с переносом не «колонками». */
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 14px;
	padding: 10px 12px;
	background: rgba(76, 175, 80, 0.08);
	border: 1px solid rgba(76, 175, 80, 0.25);
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--pc-text);
}

.pc-summary__included svg {
	flex-shrink: 0;
	color: #4caf50;
	margin-top: 2px;
}

/* v1.13.411: один flex-item на весь текст — иначе несколько <strong>
 * + текст между ними flex рендерил каждый как отдельную колонку. */
.pc-summary__included-text {
	flex: 1;
	min-width: 0;
}

.pc-summary__included strong {
	font-weight: 600;
	white-space: nowrap;
}

.pc-summary__list {
	list-style: none;
	padding: 0;
	margin: 0 0 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 60px;
}

.pc-summary__empty {
	color: var(--pc-text-dim);
	font-size: 13px;
	line-height: 1.5;
	padding: 10px 0;
	font-style: italic;
}

.pc-summary__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	font-size: 13px;
	line-height: 1.4;
}

.pc-summary__item-name {
	color: var(--pc-text-dim);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-summary__item-price {
	color: var(--pc-text);
	font-weight: 600;
	white-space: nowrap;
}

.pc-summary__validation {
	margin-bottom: 16px;
	padding: 10px 12px;
	background: rgba(255, 107, 107, 0.08);
	border: 1px solid rgba(255, 107, 107, 0.3);
	border-radius: var(--pc-radius-sm);
	color: #ffb3b3;
	font-size: 12.5px;
	line-height: 1.5;
}

.pc-summary__validation ul {
	margin: 4px 0 0;
	padding: 0 0 0 18px;
}

.pc-summary__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 14px 0;
	border-top: 1px solid var(--pc-border);
	margin-bottom: 16px;
}

.pc-summary__total-label {
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--pc-text-dim);
}

.pc-summary__total-value {
	font-size: 26px;
	font-weight: 800;
	color: var(--pc-text);
	letter-spacing: -0.01em;
}

.pc-summary__submit {
	width: 100%;
	padding: 14px !important;
	font-size: 14px !important;
	margin-bottom: 12px !important;
}

.pc-summary__submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.pc-summary__note {
	font-size: 12px;
	color: var(--pc-text-dim);
	text-align: center;
	margin: 0;
	line-height: 1.5;
}

/* === INFO BLOCK === */

.pc-config__info {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 18px;
	margin-top: 56px;
	padding-top: 40px;
	border-top: 1px solid var(--pc-border);
}

.pc-config__info-card {
	padding: 20px;
	background: var(--pc-bg-card);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-md);
}

.pc-config__info-card h3 {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--pc-accent);
	margin: 0 0 8px;
}

.pc-config__info-card p {
	font-size: 13px;
	line-height: 1.55;
	color: var(--pc-text-dim);
	margin: 0;
}

/* ============================================================
 * МОДАЛКА — выбор компонента и форма заявки.
 * ============================================================ */

.pc-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pc-modal[hidden] {
	display: none !important;
}

.pc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
}

.pc-modal__dialog {
	position: relative;
	background: var(--pc-bg-card);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-md);
	width: min(900px, 100%);
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	animation: pc-modal-in 0.18s ease-out;
}

.pc-modal__dialog--narrow {
	width: min(480px, 100%);
}

@keyframes pc-modal-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--pc-border);
	flex-shrink: 0;
}

.pc-modal__title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: var(--pc-text);
}

.pc-modal__close {
	background: transparent;
	border: none;
	color: var(--pc-text-dim);
	cursor: pointer;
	padding: 6px;
	border-radius: var(--pc-radius-sm);
	transition: color 0.15s ease;
}

.pc-modal__close:hover {
	color: var(--pc-accent);
}

.pc-modal__filters {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	padding: 16px 24px;
	border-bottom: 1px solid var(--pc-border);
	flex-shrink: 0;
}

@media (max-width: 600px) {
	.pc-modal__filters {
		grid-template-columns: 1fr;
	}
}

.pc-modal__search {
	width: 100%;
	padding: 10px 14px;
	background: var(--pc-bg-elevated);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-sm);
	color: var(--pc-text);
	font-size: 14px;
}

.pc-modal__search:focus {
	border-color: var(--pc-accent);
	outline: none;
}

.pc-modal__sort label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--pc-text-dim);
	white-space: nowrap;
}

.pc-modal__sort select {
	padding: 8px 12px;
	background: var(--pc-bg-elevated);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-sm);
	color: var(--pc-text);
	font-size: 13px;
	cursor: pointer;
}

.pc-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pc-modal__foot {
	padding: 12px 24px;
	border-top: 1px solid var(--pc-border);
	font-size: 12.5px;
	color: var(--pc-text-dim);
	flex-shrink: 0;
}

/* Карточка компонента в списке выбора */
.pc-pick-card {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 16px;
	align-items: center;
	padding: 14px 16px;
	background: var(--pc-bg-elevated);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-sm);
	transition: border-color 0.15s ease, transform 0.1s ease;
	cursor: pointer;
}

.pc-pick-card:hover {
	border-color: var(--pc-accent);
	transform: translateY(-1px);
}

.pc-pick-card.is-incompatible {
	opacity: 0.45;
	border-style: dashed;
}

.pc-pick-card.is-selected {
	border-color: var(--pc-accent);
	background: rgba(232, 65, 66, 0.08);
}

/* Out-of-stock — комплектующее существует, но временно недоступно.
   Полностью неинтерактивно: grayscale + lower opacity + cursor not-allowed. */
.pc-pick-card.is-disabled {
	opacity: 0.55;
	filter: grayscale(0.6);
	cursor: not-allowed;
	pointer-events: auto; /* оставляем чтобы tooltip "Нет в наличии" работал */
}

.pc-pick-card.is-disabled:hover {
	transform: none;
	border-color: var(--pc-border, #232830);
}

.pc-pick-card.is-disabled .pc-pick-card__select {
	opacity: 0.6;
	cursor: not-allowed;
	background: var(--pc-bg-card-hover, #20262e) !important;
	color: var(--pc-text-muted, #9aa0a6) !important;
	border-color: var(--pc-border, #232830) !important;
}

.pc-pick-card.is-disabled .pc-pick-card__select:hover {
	background: var(--pc-bg-card-hover, #20262e) !important;
	color: var(--pc-text-muted, #9aa0a6) !important;
}

.pc-pick-card__oos {
	grid-column: 1 / -1;
	margin-top: 8px;
	padding: 6px 10px;
	background: rgba(154, 160, 166, 0.12);
	color: var(--pc-text-muted, #9aa0a6);
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-align: center;
}

.pc-pick-card__main {
	min-width: 0;
}

.pc-pick-card__brand {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--pc-text-muted, #6c7280);
}

.pc-pick-card__name {
	font-size: 15px;
	font-weight: 600;
	color: var(--pc-text);
	line-height: 1.3;
	margin: 2px 0 4px;
}

.pc-pick-card__specs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 12px;
	color: var(--pc-text-dim);
}

.pc-pick-card__spec {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.pc-pick-card__spec strong {
	color: var(--pc-text);
	font-weight: 600;
}

.pc-pick-card__price {
	font-size: 16px;
	font-weight: 700;
	color: var(--pc-text);
	white-space: nowrap;
}

.pc-pick-card__select {
	padding: 8px 14px !important;
	font-size: 12px !important;
}

.pc-pick-card__incompat {
	grid-column: 1 / -1;
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px dashed var(--pc-border);
	font-size: 11.5px;
	color: #ffb3b3;
}

.pc-modal__empty {
	padding: 40px 0;
	text-align: center;
	color: var(--pc-text-dim);
	font-size: 14px;
}

/* === ФОРМА ЗАЯВКИ === */

.pc-quote-form {
	padding: 22px 24px 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pc-quote-form__row label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	color: var(--pc-text-dim);
}

.pc-quote-form__row label span em {
	color: var(--pc-accent);
	font-style: normal;
	margin-left: 2px;
}

.pc-quote-form__row input,
.pc-quote-form__row textarea {
	width: 100%;
	padding: 10px 14px;
	background: var(--pc-bg-elevated);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius-sm);
	color: var(--pc-text);
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.15s ease;
}

.pc-quote-form__row input:focus,
.pc-quote-form__row textarea:focus {
	border-color: var(--pc-accent);
	outline: none;
}

.pc-quote-form__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 12px 14px;
	background: var(--pc-bg-elevated);
	border-radius: var(--pc-radius-sm);
	margin-top: 4px;
}

.pc-quote-form__total span {
	font-size: 13px;
	color: var(--pc-text-dim);
}

.pc-quote-form__total strong {
	font-size: 18px;
	color: var(--pc-text);
	font-weight: 800;
}

.pc-quote-form__message {
	padding: 10px 14px;
	border-radius: var(--pc-radius-sm);
	font-size: 13px;
	line-height: 1.5;
}

.pc-quote-form__message.is-success {
	background: rgba(80, 200, 120, 0.08);
	border: 1px solid rgba(80, 200, 120, 0.4);
	color: #9be7b3;
}

.pc-quote-form__message.is-error {
	background: rgba(255, 107, 107, 0.08);
	border: 1px solid rgba(255, 107, 107, 0.4);
	color: #ffb3b3;
}

.pc-quote-form__submit {
	width: 100%;
	padding: 14px !important;
	font-size: 14px !important;
}

.pc-quote-form__submit.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.pc-quote-form__privacy {
	font-size: 11.5px;
	color: var(--pc-text-dim);
	text-align: center;
	margin: 0;
	line-height: 1.5;
}

.pc-quote-form__privacy a {
	color: var(--pc-text);
}

.pc-quote-form__privacy a:hover {
	color: var(--pc-accent);
}

/* === Body lock when modal open === */
body.pc-modal-open {
	overflow: hidden;
}

/* === Мобильный адаптив === */
@media (max-width: 640px) {
	.pc-config {
		padding: 32px 16px 60px;
	}

	.pc-slot {
		grid-template-columns: 44px 1fr;
		padding: 14px;
	}

	.pc-slot__icon {
		width: 44px;
		height: 44px;
	}

	.pc-slot__icon svg {
		width: 22px;
		height: 22px;
	}

	.pc-slot__filled {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.pc-slot__meta {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.pc-pick-card {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.pc-pick-card__select {
		width: 100%;
	}
}
