/*
 * Size picker on product cards and the "Choose a Size" popup it opens.
 *
 * Shared by every product listing (search, brand, category, feature
 * category, shop by topic, seller page, product page carousels) through
 * productCardVariantPicker() / openVariantModal() in js/app/common.js.
 * Looks the same as the home page product card and its size popup.
 */

/* ---------- Card picker ---------- */
.variant-picker {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: auto;
}

.variant-picker-btn {
	flex: 1;
	min-width: 112px;
	padding: 3px 7px;
	border: 2px solid #4CAF50;
	border-radius: 25px;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.3;
	color: white;
	background: #4CAF50;
	cursor: pointer;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	margin-bottom: 4.5px;
	gap: 7px;
}

.variant-picker-arrow {
	font-size: 14px;
	color: white;
}

@media (max-width: 376px) {
	.variant-picker-btn {
		min-width: 70px;
		padding: 2px 6px;
		border-width: 1px;
		border-radius: 8px;
		font-size: 9px;
	}

	.variant-picker-arrow {
		font-size: 12px;
	}
}

/* ---------- Popup ---------- */
.variant-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1040;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.variant-modal-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.variant-modal {
	background: white;
	border-radius: 20px;
	width: 90%;
	max-width: 450px;
	position: relative;
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.variant-modal-overlay.is-open .variant-modal {
	transform: scale(1);
}

.variant-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	background: none;
	border: none;
	font-size: 30px;
	color: #666666;
	cursor: pointer;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.variant-modal-header {
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
}

.variant-modal-image {
	width: 100px;
	height: 100px;
	border-radius: 8px;
	flex-shrink: 0;
	border: 1px solid #808080;
	overflow: hidden;
}

.variant-modal-image img {
	height: 100%;
	width: 100%;
	object-fit: contain;
}

.variant-modal-info {
	padding-top: 10px;
	padding-right: 20px;
}

.variant-modal-name {
	font-size: 18px;
	font-weight: bold;
	color: #333;
	margin-bottom: 4px;
}

.variant-modal-brand {
	font-size: 18px;
	font-weight: bold;
	color: gray;
	text-decoration: underline;
}

.variant-modal-title {
	font-size: 18px;
	font-weight: bold;
	color: #333;
	margin: 0 0 0 25px;
}

.variant-modal-body {
	padding: 20px;
	overflow-y: auto;
	max-height: 60vh;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.variant-modal-body::-webkit-scrollbar {
	display: none;
}

.variant-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 0;
	border-bottom: 1px solid #eee;
}

.variant-option:last-child {
	border-bottom: none;
}

.variant-option-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	margin-right: 15px;
}

.variant-option-name {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin-bottom: 4px;
}

.variant-option-price {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 25px;
}

.variant-price-current {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.variant-price-original {
	font-size: 14px;
	color: #888;
	text-decoration: line-through;
}

.variant-discount {
	background: #ff9500;
	color: white;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	width: 80px;
	height: 25px;
	flex-shrink: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

.variant-add-btn {
	background: #11a452;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	margin-left: 10px;
}

.variant-add-btn:hover {
	background: #e68400;
}

.variant-add-btn:disabled {
	background: #9e9e9e;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	.variant-modal {
		width: 95%;
		margin: 10px;
	}

	.variant-option {
		gap: 10px;
		padding: 10px 0;
	}

	.variant-option-info {
		margin-right: 0;
		flex: 1;
	}

	.variant-option-name {
		font-size: 13px;
	}

	.variant-option-price {
		font-size: 15px;
		gap: 10px;
	}

	.variant-discount {
		padding: 2px 3px;
		font-size: 9px;
		width: 60px;
	}

	.variant-add-btn {
		padding: 8px 12px;
		margin-left: 0;
	}

	.variant-modal-name,
	.variant-modal-brand {
		font-size: 15px;
	}
}

/* ---------- Toast shown by showToast() in common.js ---------- */
.Toast {
	position: fixed;
	top: 20px;
	right: 20px;
	background: #333;
	color: white;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	z-index: 10000;
	transform: translateX(400px);
	opacity: 0;
	transition: all 0.3s ease;
}

.Toast.Show {
	transform: translateX(0);
	opacity: 1;
}

.Toast.Success {
	background: #4CAF50;
}

.Toast.Info {
	background: white;
	color: #4CAF50;
	border: 1px solid #666666;
	font-weight: 700;
}

.Toast.Warning {
	background: #ff9500;
}
