/* ========================================
   Quick View Modal
   ======================================== */


/* -------------------------------------------------------
   DIALOG — BASE
   ------------------------------------------------------- */

.starter-quick-view {
	width: min(900px, 92vw);
	max-height: 88vh;
	padding: 0;
	border: none;
	border-radius: var(--starter-border-radius, 12px);
	box-shadow:
		0 24px 80px rgba(0, 0, 0, 0.25),
		0 8px 24px rgba(0, 0, 0, 0.1);
	background: var(--starter-color-surface, #fff);
	overflow: hidden;
}

.starter-quick-view::backdrop {
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

/* No-scroll on body when open */
body.quick-view-open {
	overflow: hidden;
}


/* -------------------------------------------------------
   DIALOG — INNER
   ------------------------------------------------------- */

.qv {
	position: relative;
	max-height: 88vh;
	overflow-y: auto;
	scrollbar-width: thin;
}


/* -------------------------------------------------------
   CLOSE BUTTON
   ------------------------------------------------------- */

.qv__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 10;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--starter-color-background, #fff);
	border: 1px solid var(--starter-color-border, #eee);
	border-radius: 50%;
	font-size: 1.3rem;
	line-height: 1;
	color: var(--starter-color-text, var(--starter-color-text, #1a1a1a));
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
}

.qv__close:hover {
	background: var(--starter-color-border, #eee);
	transform: scale(1.05);
}


/* -------------------------------------------------------
   LAYOUT — TWO COLUMN
   ------------------------------------------------------- */

.qv__layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 400px;
}


/* -------------------------------------------------------
   GALLERY
   ------------------------------------------------------- */

.qv__gallery {
	padding: 2rem;
	background: #f8f8f8;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.qv__main-image {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--starter-border-radius, 8px);
	overflow: hidden;
	position: relative;
}

.qv__main-image img {
	max-width: 100%;
	max-height: 400px;
	object-fit: contain;
	border-radius: var(--starter-border-radius, 8px);
}

.qv__no-image {
	color: var(--starter-color-text-light, #ccc);
	font-size: 0.9rem;
	padding: 4rem;
	text-align: center;
}

/* Thumbnails */
.qv__thumbs {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
}

.qv__thumb {
	width: 64px;
	height: 64px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.2s;
}

.qv__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.qv__thumb:hover,
.qv__thumb.is-active {
	border-color: var(--starter-color-accent, var(--starter-color-accent, #0073aa));
}

/* Sale badge */
.qv__badge {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	background: var(--starter-color-sale, var(--starter-color-sale, #c53030));
	color: #fff;
	padding: 0.25rem 0.6rem;
	border-radius: 4px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
}


/* -------------------------------------------------------
   DETAILS
   ------------------------------------------------------- */

.qv__details {
	padding: 2rem 2rem 2rem 1.5rem;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.qv__categories {
	font-size: 0.78rem;
	color: var(--starter-color-text-light, #999);
	margin-bottom: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.qv__categories a {
	color: var(--starter-color-text-light, #999);
}

.qv__categories a:hover {
	color: var(--starter-color-accent, var(--starter-color-accent, #0073aa));
}

.qv__title {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 0.5rem;
}

.qv__title a {
	color: var(--starter-color-heading, var(--starter-color-text, #1a1a1a));
	text-decoration: none;
}

.qv__title a:hover {
	color: var(--starter-color-accent, var(--starter-color-accent, #0073aa));
}

.qv__rating {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.75rem;
}

.qv__review-count {
	font-size: 0.82rem;
	color: var(--starter-color-text-light, #999);
}

.qv__price {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--starter-color-text, var(--starter-color-text, #1a1a1a));
	margin-bottom: 1rem;
	line-height: 1.2;
}

.qv__price del {
	color: var(--starter-color-text-light, #999);
	font-weight: 400;
	font-size: 1.1rem;
	margin-right: 0.5rem;
}

.qv__price ins {
	text-decoration: none;
	color: var(--starter-color-sale, var(--starter-color-sale, #c53030));
}

.qv__short-desc {
	font-size: 0.9rem;
	color: var(--starter-color-text-light, #666);
	line-height: 1.6;
	margin-bottom: 1rem;
}

.qv__sku {
	font-size: 0.8rem;
	color: var(--starter-color-text-light, #999);
	margin-bottom: 1.25rem;
}


/* -------------------------------------------------------
   VARIATIONS
   ------------------------------------------------------- */

.qv__variations {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.qv__variation-group {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.qv__variation-label {
	font-size: 0.82rem;
	font-weight: 600;
	text-transform: capitalize;
}

.qv__variation-select {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--starter-color-border, #ddd);
	border-radius: 6px;
	font-size: 0.9rem;
	background: #fff;
	cursor: pointer;
}

.qv__variation-select:focus {
	outline: none;
	border-color: var(--starter-color-accent, var(--starter-color-accent, #0073aa));
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}


/* -------------------------------------------------------
   ACTIONS
   ------------------------------------------------------- */

.qv__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.qv__qty-row {
	display: flex;
	gap: 0.75rem;
}

.qv__qty {
	width: 70px;
	padding: 0.6rem;
	text-align: center;
	border: 1px solid var(--starter-color-border, #ddd);
	border-radius: 6px;
	font-size: 1rem;
}

.qv__add-to-cart {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	background: var(--starter-color-accent, var(--starter-color-accent, #0073aa));
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
}

.qv__add-to-cart:hover:not(:disabled) {
	background: var(--starter-color-accent-hover, var(--starter-color-accent-hover, #005a87));
	transform: translateY(-1px);
}

.qv__add-to-cart:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.qv__add-to-cart.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.qv__add-to-cart.is-loading::after {
	content: '';
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: qv-spin 0.6s linear infinite;
	margin-left: 0.3rem;
}

.qv__add-to-cart.is-added {
	background: var(--starter-color-success, var(--starter-color-success, #1a6b3c));
}

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

.qv__view-details {
	text-align: center;
	font-size: 0.85rem;
	color: var(--starter-color-accent, var(--starter-color-accent, #0073aa));
	text-decoration: none;
}

.qv__view-details:hover {
	text-decoration: underline;
}

.qv__stock-label {
	display: block;
	text-align: center;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--starter-color-error, var(--starter-color-sale, #c53030));
	padding: 0.75rem;
}


/* -------------------------------------------------------
   INLINE ERROR
   ------------------------------------------------------- */

.qv__inline-error {
	display: none;
	background: #fde8e8;
	color: #9b1c1c;
	padding: 0.6rem 1rem;
	border-radius: 6px;
	font-size: 0.85rem;
	margin-bottom: 0.5rem;
}


/* -------------------------------------------------------
   ERROR STATE
   ------------------------------------------------------- */

.qv--error .qv__error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 2rem;
	text-align: center;
	gap: 1.5rem;
}

.qv--error .qv__error p {
	font-size: 1.1rem;
	color: var(--starter-color-text-light, #666);
	margin: 0;
}


/* -------------------------------------------------------
   SKELETON
   ------------------------------------------------------- */

.qv__skeleton {
	background: linear-gradient(110deg, #f0f0f0 8%, #e8e8e8 18%, #f0f0f0 33%);
	background-size: 200% 100%;
	animation: qv-shimmer 1.5s linear infinite;
	border-radius: 6px;
}

.qv__image.qv__skeleton {
	height: 300px;
	border-radius: var(--starter-border-radius, 8px);
}

.qv__thumb.qv__skeleton {
	width: 64px;
	height: 64px;
}

@keyframes qv-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}


/* -------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------- */

@media (max-width: 768px) {
	.starter-quick-view {
		width: 96vw;
		max-height: 92vh;
		border-radius: 12px 12px 0 0;
		margin: auto auto 0;
	}

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

	.qv__gallery {
		padding: 1.5rem 1.5rem 1rem;
	}

	.qv__main-image img {
		max-height: 250px;
	}

	.qv__details {
		padding: 1rem 1.5rem 1.5rem;
	}

	.qv__title {
		font-size: 1.2rem;
	}

	.qv__close {
		top: 0.75rem;
		right: 0.75rem;
	}
}
