/* ALEX-PC Store Core — фронтенд
   Дизайн-система з макетів: світлий фон, сині акценти, м'які тіні, округлення. */

:root {
	--alexpc-blue: #2563eb;
	--alexpc-blue-dark: #1d4ed8;
	--alexpc-ink: #0f172a;
	--alexpc-muted: #64748b;
	--alexpc-line: #e2e8f0;
	--alexpc-bg-soft: #f8fafc;
	--alexpc-ok: #16a34a;
	--alexpc-bad: #dc2626;
	--alexpc-radius: 12px;
	--alexpc-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
}

/* --- Smart Device Finder --- */

.alexpc-finder {
	background: #fff;
	border: 1px solid var(--alexpc-line);
	border-radius: var(--alexpc-radius);
	padding: 24px;
	box-shadow: var(--alexpc-shadow);
	position: relative;
}

.alexpc-finder__title {
	margin: 0 0 16px;
	font-size: clamp( 20px, 2.2vw, 28px );
	color: var(--alexpc-ink);
}

.alexpc-finder__steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr) auto;
	gap: 12px;
	align-items: end;
}

.alexpc-finder__step {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--alexpc-bg-soft);
	border: 1px solid var(--alexpc-line);
	border-radius: 10px;
	padding: 12px 14px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.alexpc-finder__step:focus-within {
	border-color: var(--alexpc-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.alexpc-finder__num {
	position: absolute;
	top: -10px;
	left: 14px;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--alexpc-blue);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}

.alexpc-finder__step label {
	font-size: 12px;
	color: var(--alexpc-muted);
	text-transform: uppercase;
	letter-spacing: .03em;
}

.alexpc-finder__step select {
	width: 100%;
	border: 0;
	background: transparent;
	font-size: 15px;
	color: var(--alexpc-ink);
	padding: 2px 0;
}

.alexpc-finder__step select:disabled {
	color: #94a3b8;
	cursor: not-allowed;
}

.alexpc-finder__submit {
	background: var(--alexpc-blue);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 14px 24px;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s ease, transform .1s ease;
}

.alexpc-finder__submit:hover:not(:disabled) {
	background: var(--alexpc-blue-dark);
}

.alexpc-finder__submit:active:not(:disabled) {
	transform: translateY(1px);
}

.alexpc-finder__submit:disabled {
	background: #cbd5e1;
	cursor: not-allowed;
}

.alexpc-finder__remember {
	margin-top: 14px;
	font-size: 14px;
	color: var(--alexpc-muted);
}

.alexpc-finder.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .6);
	border-radius: var(--alexpc-radius);
}

@media (max-width: 900px) {
	.alexpc-finder__steps {
		grid-template-columns: 1fr 1fr;
	}

	.alexpc-finder__submit {
		grid-column: 1 / -1;
	}
}

@media (max-width: 560px) {
	.alexpc-finder {
		padding: 18px 16px;
	}

	.alexpc-finder__steps {
		grid-template-columns: 1fr;
	}
}

/* --- Ваш пристрій --- */

.alexpc-my-device {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--alexpc-line);
	border-radius: 10px;
	padding: 12px 14px;
}

.alexpc-my-device__label {
	font-size: 12px;
	color: var(--alexpc-muted);
	text-transform: uppercase;
	letter-spacing: .03em;
	width: 100%;
}

.alexpc-my-device__name {
	font-weight: 600;
	color: var(--alexpc-ink);
	text-decoration: none;
}

.alexpc-my-device__change,
.alexpc-my-device__pick {
	background: none;
	border: 0;
	padding: 0;
	color: var(--alexpc-blue);
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
}

/* --- Сумісність у картці товару --- */

.alexpc-compat {
	margin: 20px 0;
	padding: 16px;
	background: var(--alexpc-bg-soft);
	border-radius: var(--alexpc-radius);
}

.alexpc-compat__title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 600;
}

.alexpc-compat__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.alexpc-compat__item a {
	display: inline-block;
	padding: 6px 12px;
	background: #fff;
	border: 1px solid var(--alexpc-line);
	border-radius: 999px;
	font-size: 13px;
	color: var(--alexpc-ink);
	text-decoration: none;
	transition: border-color .2s ease, color .2s ease;
}

.alexpc-compat__item a:hover {
	border-color: var(--alexpc-blue);
	color: var(--alexpc-blue);
}

.alexpc-compat__more {
	margin-top: 10px;
	background: none;
	border: 0;
	padding: 0;
	color: var(--alexpc-blue);
	font-size: 13px;
	cursor: pointer;
}

/* --- Кнопки обраного та порівняння --- */

.alexpc-product-actions {
	display: flex;
	gap: 10px;
	margin: 16px 0;
}

.alexpc-wishlist-btn,
.alexpc-compare-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--alexpc-line);
	border-radius: 10px;
	padding: 10px 16px;
	font-size: 14px;
	color: var(--alexpc-muted);
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.alexpc-wishlist-btn:hover,
.alexpc-compare-btn:hover {
	border-color: var(--alexpc-blue);
	color: var(--alexpc-blue);
}

.alexpc-wishlist-btn.is-active {
	color: var(--alexpc-bad);
	border-color: currentColor;
}

.alexpc-compare-btn.is-active {
	color: var(--alexpc-blue);
	border-color: currentColor;
	background: rgba(37, 99, 235, .06);
}

.alexpc-wishlist-btn__icon {
	font-size: 16px;
	line-height: 1;
}

/* Кнопка обраного поверх картки в каталозі. */

.woocommerce ul.products li.product {
	position: relative;
}

.woocommerce ul.products li.product .alexpc-wishlist-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 8px;
	border-radius: 50%;
	z-index: 2;
}

/* --- Порівняння --- */

.alexpc-compare__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.alexpc-compare__clear {
	background: none;
	border: 1px solid var(--alexpc-line);
	border-radius: 8px;
	padding: 8px 16px;
	color: var(--alexpc-bad);
	cursor: pointer;
}

.alexpc-compare__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.alexpc-compare__table {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

.alexpc-compare__table th,
.alexpc-compare__table td {
	border: 1px solid var(--alexpc-line);
	padding: 12px;
	text-align: left;
	vertical-align: top;
	font-size: 14px;
}

.alexpc-compare__table tbody th {
	background: var(--alexpc-bg-soft);
	font-weight: 500;
	color: var(--alexpc-muted);
	width: 180px;
	position: sticky;
	left: 0;
}

.alexpc-compare__product {
	position: relative;
	text-align: center;
	min-width: 180px;
}

.alexpc-compare__product img {
	max-width: 120px;
	height: auto;
	margin: 0 auto 8px;
	display: block;
}

.alexpc-compare__name {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--alexpc-ink);
	margin-bottom: 6px;
}

.alexpc-compare__price {
	display: block;
	font-weight: 600;
	color: var(--alexpc-ink);
	margin-bottom: 8px;
}

.alexpc-compare__remove {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: var(--alexpc-bg-soft);
	color: var(--alexpc-muted);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.alexpc-compare__dash {
	color: #cbd5e1;
}

.alexpc-in-stock { color: var(--alexpc-ok); }
.alexpc-out-stock { color: var(--alexpc-bad); }

/* --- Повідомити про появу --- */

.alexpc-stock-notify {
	margin: 20px 0;
	padding: 16px;
	background: var(--alexpc-bg-soft);
	border-radius: var(--alexpc-radius);
}

.alexpc-stock-notify__status {
	margin: 0 0 10px;
	font-weight: 600;
	color: var(--alexpc-bad);
}

.alexpc-stock-notify__row {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}

.alexpc-stock-notify__row input {
	flex: 1;
	border: 1px solid var(--alexpc-line);
	border-radius: 8px;
	padding: 10px 12px;
}

.alexpc-stock-notify__message.is-ok { color: var(--alexpc-ok); }
.alexpc-stock-notify__message.is-error { color: var(--alexpc-bad); }

/* --- Порожні стани --- */

.alexpc-empty {
	text-align: center;
	padding: 48px 16px;
	color: var(--alexpc-muted);
}

/* --- Toast --- */

.alexpc-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translate(-50%, 16px);
	background: var(--alexpc-ink);
	color: #fff;
	padding: 12px 20px;
	border-radius: 10px;
	font-size: 14px;
	opacity: 0;
	transition: opacity .3s ease, transform .3s ease;
	z-index: 9999;
}

.alexpc-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* --- Мобільна нижня навігація --- */

@media (max-width: 767px) {
	.alexpc-bottom-nav {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		background: #fff;
		border-top: 1px solid var(--alexpc-line);
		padding: 8px 0 max(8px, env(safe-area-inset-bottom));
		z-index: 900;
	}

	.alexpc-bottom-nav a {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		font-size: 11px;
		color: var(--alexpc-muted);
		text-decoration: none;
	}

	.alexpc-bottom-nav a.is-active {
		color: var(--alexpc-blue);
	}

	body.has-alexpc-bottom-nav {
		padding-bottom: 64px;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
