/* Quick Variation Cart Popup — Frontend
   All colors/sizes come from CSS custom properties set inline by the plugin
   (see class-qvcp-frontend.php) so store owners can theme it from wp-admin. */

.qvcp-trigger {
	cursor: pointer;
}

body.qvcp-open {
	overflow: hidden;
}

.qvcp-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: var( --qvcp-overlay, rgba(17,17,17,0.55) );
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s ease;
}

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

.qvcp-modal {
	background: var( --qvcp-modal-bg, #fff );
	color: var( --qvcp-text, #1a1a1a );
	font-family: var( --qvcp-font, inherit );
	border-radius: var( --qvcp-modal-radius, 18px );
	width: 100%;
	max-width: var( --qvcp-modal-max-width, 480px );
	max-height: min(88vh, 780px);
	overflow: hidden;
	position: relative;
	display: flex;
	flex-direction: column;
	transform: translateY(10px) scale(0.98);
	transition: transform 0.18s ease;
	box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.qvcp-overlay.is-open .qvcp-modal {
	transform: translateY(0) scale(1);
}

.qvcp-modal-inner {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 26px;
}

.qvcp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: rgba(0,0,0,0.06);
	color: var( --qvcp-text, #1a1a1a );
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qvcp-close:hover {
	background: rgba(0,0,0,0.12);
}

.qvcp-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 240px;
}

.qvcp-spinner {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 3px solid rgba(0,0,0,0.1);
	border-top-color: var( --qvcp-accent, #d1442f );
	animation: qvcp-spin 0.7s linear infinite;
}

@keyframes qvcp-spin {
	to { transform: rotate(360deg); }
}

.qvcp-content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.qvcp-top {
	display: flex;
	gap: 16px;
}

.qvcp-image-wrap {
	flex: 0 0 120px;
	width: 120px;
	height: 120px;
	border-radius: calc(var( --qvcp-modal-radius, 18px ) * 0.55);
	overflow: hidden;
	background: #f4f4f4;
}

.qvcp-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.15s ease;
}

.qvcp-meta {
	flex: 1;
	min-width: 0;
}

.qvcp-title {
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 6px;
	line-height: 1.3;
}

.qvcp-price {
	font-size: 16px;
	color: var( --qvcp-price, #1a1a1a );
	font-weight: 600;
}

.qvcp-price ins {
	text-decoration: none;
	color: var( --qvcp-sale-price, #d1442f );
}

.qvcp-price del {
	color: var( --qvcp-muted, #767676 );
	opacity: 0.7;
	font-weight: 400;
	font-size: 14px;
	margin-right: 4px;
}

.qvcp-short-desc {
	font-size: 13px;
	color: var( --qvcp-muted, #767676 );
	margin-top: 8px;
	line-height: 1.5;
}

.qvcp-attribute {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.qvcp-attribute-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --qvcp-muted, #767676 );
}

.qvcp-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.qvcp-swatch {
	appearance: none;
	border: 1.5px solid var( --qvcp-swatch-border, #e2e2e2 );
	background: #fff;
	border-radius: 8px;
	padding: 7px 14px;
	font-size: 13px;
	color: var( --qvcp-text, #1a1a1a );
	cursor: pointer;
	transition: border-color 0.12s ease, color 0.12s ease;
}

.qvcp-swatch:hover {
	border-color: var( --qvcp-swatch-selected, #1a1a1a );
}

.qvcp-swatch.is-selected {
	border-color: var( --qvcp-swatch-selected, #1a1a1a );
	background: var( --qvcp-swatch-selected, #1a1a1a );
	color: #fff;
}

.qvcp-swatch.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	text-decoration: line-through;
}

.qvcp-swatch.qvcp-color-swatch {
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 50%;
	position: relative;
}

.qvcp-swatch.qvcp-color-swatch.is-selected::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 1.5px solid var( --qvcp-swatch-selected, #1a1a1a );
}

.qvcp-select {
	width: 100%;
	border: 1.5px solid var( --qvcp-swatch-border, #e2e2e2 );
	border-radius: 8px;
	padding: 9px 10px;
	font-size: 13px;
	color: var( --qvcp-text, #1a1a1a );
	background: #fff;
}

.qvcp-info-row {
	display: flex;
	gap: 16px;
	font-size: 12.5px;
	color: var( --qvcp-muted, #767676 );
	flex-wrap: wrap;
}

.qvcp-info-row strong {
	color: var( --qvcp-text, #1a1a1a );
	font-weight: 600;
}

.qvcp-stock.in-stock {
	color: #2e7d32;
}

.qvcp-stock.out-of-stock {
	color: var( --qvcp-accent, #d1442f );
}

.qvcp-qty-row {
	display: flex;
	align-items: center;
	gap: 14px;
}

.qvcp-qty-stepper {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid var( --qvcp-swatch-border, #e2e2e2 );
	border-radius: 8px;
	overflow: hidden;
}

.qvcp-qty-stepper button {
	appearance: none;
	border: none;
	background: transparent;
	width: 34px;
	height: 34px;
	font-size: 16px;
	cursor: pointer;
	color: var( --qvcp-text, #1a1a1a );
}

.qvcp-qty-stepper button:hover {
	background: rgba(0,0,0,0.04);
}

.qvcp-qty-stepper input {
	width: 42px;
	text-align: center;
	border: none;
	border-left: 1.5px solid var( --qvcp-swatch-border, #e2e2e2 );
	border-right: 1.5px solid var( --qvcp-swatch-border, #e2e2e2 );
	height: 34px;
	font-size: 14px;
	-moz-appearance: textfield;
}

.qvcp-qty-stepper input::-webkit-outer-spin-button,
.qvcp-qty-stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.qvcp-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}

.qvcp-btn {
	flex: 1;
	appearance: none;
	border: none;
	border-radius: var( --qvcp-btn-radius, 8px );
	padding: 13px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.12s ease, transform 0.06s ease;
	text-align: center;
}

.qvcp-btn:active {
	transform: scale(0.98);
}

.qvcp-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.qvcp-btn-atc {
	background: var( --qvcp-atc-bg, #1a1a1a );
	color: var( --qvcp-atc-text, #fff );
}

.qvcp-btn-buynow {
	background: var( --qvcp-buynow-bg, #d1442f );
	color: var( --qvcp-buynow-text, #fff );
}

.qvcp-notice {
	font-size: 13px;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba(0,0,0,0.05);
	color: var( --qvcp-text, #1a1a1a );
	display: none;
}

.qvcp-notice.is-visible {
	display: block;
}

.qvcp-notice.is-error {
	background: rgba(209,68,47,0.1);
	color: var( --qvcp-accent, #d1442f );
}

.qvcp-notice.is-success {
	background: rgba(46,125,50,0.1);
	color: #2e7d32;
}

/* Mobile: turn the modal into a bottom sheet for smooth thumb reach + touch scroll */
@media (max-width: 640px) {
	.qvcp-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.qvcp-modal {
		max-width: 100%;
		width: 100%;
		max-height: 90vh;
		border-radius: var( --qvcp-modal-radius, 18px ) var( --qvcp-modal-radius, 18px ) 0 0;
		transform: translateY(100%);
	}

	.qvcp-overlay.is-open .qvcp-modal {
		transform: translateY(0);
	}

	.qvcp-modal::before {
		content: "";
		position: absolute;
		top: 10px;
		left: 50%;
		transform: translateX(-50%);
		width: 36px;
		height: 4px;
		border-radius: 999px;
		background: rgba(0,0,0,0.15);
	}

	.qvcp-modal-inner {
		padding: 28px 20px 20px;
	}

	.qvcp-actions {
		position: sticky;
		bottom: 0;
		background: var( --qvcp-modal-bg, #fff );
		padding-top: 10px;
	}
}
