/* ==========================================================================
   Related Products Popup  —  storefront styles
   Corporate colours: #104480 (primary) · #219BF7 (accent) · #F2F3F5 (surface)
   ========================================================================== */

/* ---- Trigger button (inserted after .button-one-click) ------------------- */
.relatedpopup-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 10px 0 0;
	padding: 11px 16px;
	box-sizing: border-box;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
	color: #219BF7;
	background: #ffffff;
	border: 2px solid #219BF7;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.relatedpopup-trigger:hover,
.relatedpopup-trigger:focus {
	background: #219BF7;
	color: #ffffff;
	box-shadow: 0 4px 12px rgba(33, 155, 247, .35);
	outline: none;
}

.relatedpopup-trigger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	border-radius: 50%;
	border: 2px solid currentColor;
}

/* ---- Overlay & modal ----------------------------------------------------- */
.relatedpopup-overlay {
	display: none;
	position: fixed;
	z-index: 99999;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px;
	box-sizing: border-box;
	background: rgba(16, 68, 128, .55);
	-webkit-overflow-scrolling: touch;
}

.relatedpopup-overlay.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
}

.relatedpopup-modal {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 760px;
	max-height: 90vh;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(16, 68, 128, .35);
	overflow: hidden;
	font-family: inherit;
	color: #2a2f36;
	animation: relatedpopup-in .2s ease;
}

@keyframes relatedpopup-in {
	from { transform: translateY(16px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* ---- Header -------------------------------------------------------------- */
.relatedpopup-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 22px;
	border-bottom: 1px solid #e6e8ec;
}

.relatedpopup-title {
	font-size: 18px;
	font-weight: 700;
	color: #104480;
}

.relatedpopup-close {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 24px;
	line-height: 30px;
	color: #8b94a3;
	background: #F2F3F5;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.relatedpopup-close:hover {
	background: #219BF7;
	color: #ffffff;
}

/* ---- Body ---------------------------------------------------------------- */
.relatedpopup-body {
	padding: 18px;
	background: #F2F3F5;
	overflow-y: auto;
}

.relatedpopup-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.relatedpopup-message {
	margin: 0;
	padding: 30px 10px;
	text-align: center;
	color: #8b94a3;
}

/* ---- Product card -------------------------------------------------------- */
.relatedpopup-card {
	background: #ffffff;
	border: 2px solid #e6e8ec;
	border-radius: 10px;
	padding: 12px;
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.relatedpopup-card:hover {
	border-color: #c4d4e6;
}

.relatedpopup-card.is-selected {
	border-color: #219BF7;
	box-shadow: 0 4px 14px rgba(33, 155, 247, .18);
}

.relatedpopup-card-top {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

/* Checkbox */
.relatedpopup-check {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	background: #ffffff;
	border: 2px solid #c4ccd6;
	border-radius: 6px;
	transition: background-color .15s ease, border-color .15s ease;
}

.relatedpopup-card.is-selected .relatedpopup-check {
	background: #219BF7;
	border-color: #219BF7;
	position: relative;
}

.relatedpopup-card.is-selected .relatedpopup-check::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Thumbnail */
.relatedpopup-thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #F2F3F5;
	border-radius: 8px;
	overflow: hidden;
}

.relatedpopup-thumb img {
	max-width: 100%;
	max-height: 100%;
}

/* Info */
.relatedpopup-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.relatedpopup-name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: #2a2f36;
	text-decoration: none;
}

.relatedpopup-name:hover {
	color: #219BF7;
	text-decoration: underline;
}

.relatedpopup-model {
	font-size: 11px;
	color: #9aa3b0;
}

.relatedpopup-price {
	margin-top: 2px;
	font-size: 14px;
	font-weight: 700;
	color: #104480;
}

.relatedpopup-per {
	font-size: 11px;
	font-weight: 400;
	color: #9aa3b0;
}

/* ---- Quantity row (visible only when the card is selected) --------------- */
.relatedpopup-qtyrow {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed #e0e3e8;
}

.relatedpopup-card.is-selected .relatedpopup-qtyrow {
	display: flex;
}

.relatedpopup-stepper {
	display: flex;
	align-items: center;
	border: 1px solid #d6dae0;
	border-radius: 6px;
	overflow: hidden;
}

.relatedpopup-minus,
.relatedpopup-plus {
	width: 30px;
	height: 32px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	color: #104480;
	background: #F2F3F5;
	border: 0;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.relatedpopup-minus:hover,
.relatedpopup-plus:hover {
	background: #219BF7;
	color: #ffffff;
}

.relatedpopup-qty {
	width: 52px;
	height: 32px;
	padding: 0 4px;
	text-align: center;
	font-size: 13px;
	color: #2a2f36;
	background: #ffffff;
	border: 0;
	border-left: 1px solid #d6dae0;
	border-right: 1px solid #d6dae0;
	-moz-appearance: textfield;
}

.relatedpopup-qty:focus {
	outline: none;
}

.relatedpopup-cardsum {
	font-size: 12px;
	color: #6b7480;
	text-align: right;
	white-space: nowrap;
}

.relatedpopup-cardsum b {
	display: block;
	font-size: 14px;
	color: #104480;
}

/* ---- Footer -------------------------------------------------------------- */
.relatedpopup-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 22px;
	border-top: 1px solid #e6e8ec;
	background: #ffffff;
}

.relatedpopup-total {
	font-size: 14px;
	color: #6b7480;
}

.relatedpopup-total b {
	font-size: 20px;
	color: #104480;
}

.relatedpopup-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.relatedpopup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 120px;
	padding: 11px 20px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.relatedpopup-btn-cancel {
	color: #4a5260;
	background: #F2F3F5;
}

.relatedpopup-btn-cancel:hover {
	background: #e4e6ea;
	color: #4a5260;
}

.relatedpopup-btn-add {
	color: #ffffff;
	background: #219BF7;
}

.relatedpopup-btn-add:hover {
	background: #1b86d6;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(33, 155, 247, .4);
}

.relatedpopup-btn-add[disabled] {
	background: #c4ccd6;
	box-shadow: none;
	cursor: not-allowed;
	opacity: .8;
}

.relatedpopup-btn.is-loading {
	pointer-events: none;
	opacity: .7;
}

/* ---- Views (list / success) --------------------------------------------- */
.relatedpopup-view {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

#relatedpopup-view-list {
	flex: 1 1 auto;
	overflow: hidden;
}

.relatedpopup-success {
	display: none;
	padding: 38px 24px;
	text-align: center;
}

.relatedpopup-overlay.is-success #relatedpopup-view-list {
	display: none;
}

.relatedpopup-overlay.is-success #relatedpopup-view-success {
	display: flex;
	align-items: center;
}

.relatedpopup-success-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	font-size: 32px;
	line-height: 64px;
	color: #ffffff;
	background: #219BF7;
	border-radius: 50%;
}

.relatedpopup-success-text {
	margin: 0 0 22px;
	font-size: 16px;
	font-weight: 600;
	color: #104480;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 600px) {
	.relatedpopup-overlay {
		padding: 0;
	}

	.relatedpopup-modal {
		max-width: 100%;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
	}

	.relatedpopup-grid {
		grid-template-columns: 1fr;
	}

	.relatedpopup-foot {
		flex-direction: column;
		align-items: stretch;
	}

	.relatedpopup-actions {
		justify-content: stretch;
	}

	.relatedpopup-btn {
		flex: 1 1 0;
		min-width: 0;
	}

	.relatedpopup-total {
		text-align: center;
	}
}
