/* ==========================================================================
   Product Quick View for WooCommerce Stores
   Public Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Quick View Trigger Button
   -------------------------------------------------------------------------- */
.storzen-qv-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 8px;
	padding: 8px 16px;
	background: #fff;
	color: #111;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	border: 1px solid #ddd;
	border-radius: 3px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	width: 100%;
	text-align: center;
}

.storzen-qv-trigger:hover,
.storzen-qv-trigger:focus {
	background: #111;
	color: #fff;
	border-color: #111;
	outline: none;
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */
.storzen-qv-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.6);
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

/* Only use flex layout when overlay is actually shown */
.storzen-qv-overlay[style*="display: block"],
.storzen-qv-overlay[style*="display:block"] {
	display: flex !important;
}

.storzen-qv-overlay.is-visible {
	opacity: 1;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.storzen-qv-modal {
	position: relative;
	background: #fff;
	border-radius: 6px;
	width: 100%;
	max-width: 860px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	transform: translateY(16px);
	transition: transform 0.25s ease;
}

.storzen-qv-overlay.is-visible .storzen-qv-modal {
	transform: translateY(0);
}

/* Close button */
.storzen-qv-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 4px 8px;
	z-index: 10;
	transition: color 0.15s ease;
}

.storzen-qv-close:hover {
	color: #111;
}

/* --------------------------------------------------------------------------
   Content area
   -------------------------------------------------------------------------- */
.storzen-qv-content {
	padding: 32px;
}

/* --------------------------------------------------------------------------
   Spinner
   -------------------------------------------------------------------------- */
.storzen-qv-spinner {
	width: 40px;
	height: 40px;
	margin: 40px auto;
	border: 3px solid #eee;
	border-top-color: #111;
	border-radius: 50%;
	animation: storzen-qv-spin 0.7s linear infinite;
}

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

/* --------------------------------------------------------------------------
   Product layout (two columns)
   -------------------------------------------------------------------------- */
.storzen-qv-product {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}

/* Image column */
.storzen-qv-image {
	flex: 0 0 45%;
	max-width: 45%;
}

.storzen-qv-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

/* Details column */
.storzen-qv-details {
	flex: 1;
	min-width: 0;
}

/* --------------------------------------------------------------------------
   Product details
   -------------------------------------------------------------------------- */
.storzen-qv-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 10px;
	line-height: 1.3;
	color: #111;
}

.storzen-qv-price {
	font-size: 20px;
	font-weight: 600;
	color: #111;
	margin-bottom: 10px;
}

.storzen-qv-price del {
	color: #999;
	font-weight: 400;
	font-size: 16px;
}

.storzen-qv-price ins {
	text-decoration: none;
	color: #e63946;
}

.storzen-qv-rating {
	margin-bottom: 14px;
}

.storzen-qv-excerpt {
	font-size: 14px;
	color: #444;
	line-height: 1.6;
	margin-bottom: 20px;
}

.storzen-qv-excerpt p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Cart / CTA
   -------------------------------------------------------------------------- */
.storzen-qv-cart-form {
	margin-bottom: 14px;
}

.storzen-qv-add-to-cart,
.storzen-qv-view-product {
	display: inline-block;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 3px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.storzen-qv-add-to-cart {
	background: #111;
	color: #fff !important;
	border: none;
}

.storzen-qv-add-to-cart:hover {
	background: #333;
}

.storzen-qv-view-product {
	background: #f5f5f5;
	color: #111 !important;
	border: 1px solid #ddd;
}

.storzen-qv-view-product:hover {
	background: #e8e8e8;
}


.storzen-qv-out-of-stock {
	color: #e63946;
	font-weight: 600;
	margin-bottom: 14px;
}

.storzen-qv-full-link {
	font-size: 13px;
	color: #666;
	text-decoration: underline;
}

.storzen-qv-full-link:hover {
	color: #111;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
	.storzen-qv-product {
		flex-direction: column;
	}

	.storzen-qv-image {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.storzen-qv-content {
		padding: 20px 16px;
	}

	.storzen-qv-title {
		font-size: 18px;
	}

	.storzen-qv-modal {
		max-height: 95vh;
	}
}

/* --------------------------------------------------------------------------
   Product category badge  (v1.2.0)
   -------------------------------------------------------------------------- */
.storzen-qv-category {
	margin-bottom: 8px;
}

.storzen-qv-category a {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #555;
	background: #f3f3f3;
	border-radius: 3px;
	padding: 3px 8px;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.storzen-qv-category a:hover {
	background: #e8e8e8;
	color: #111;
}

/* --------------------------------------------------------------------------
   Rating row — star widget + review count  (v1.2.0)
   -------------------------------------------------------------------------- */
.storzen-qv-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.storzen-qv-review-count {
	font-size: 12px;
	color: #666;
}

a.storzen-qv-review-count {
	text-decoration: underline;
}

a.storzen-qv-review-count:hover {
	color: #111;
}

.storzen-qv-review-count--none {
	color: #aaa;
	font-style: italic;
}

/* --------------------------------------------------------------------------
   Quantity selector  (v1.2.0)
   -------------------------------------------------------------------------- */
.storzen-qv-qty-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.storzen-qv-qty-selector {
	display: inline-flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 3px;
	overflow: hidden;
	flex-shrink: 0;
}

.storzen-qv-qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 40px;
	background: #f8f8f8;
	border: none;
	cursor: pointer;
	color: #444;
	transition: background 0.15s ease, color 0.15s ease;
	flex-shrink: 0;
}

.storzen-qv-qty-btn:hover {
	background: #eee;
	color: #111;
}

.storzen-qv-qty-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.storzen-qv-qty-input {
	width: 48px;
	height: 40px;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: #111;
	appearance: textfield;
	-moz-appearance: textfield;
	outline: none;
	background: #fff;
	padding: 0;
}

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

.storzen-qv-qty-input:focus {
	background: #fafafa;
}

/* Add to Cart button fills remaining space */
.storzen-qv-qty-wrap .storzen-qv-add-to-cart {
	flex: 1;
	min-width: 120px;
	text-align: center;
	padding: 10px 16px;
}

/* --------------------------------------------------------------------------
   Responsive — qty selector on narrow modal
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
	.storzen-qv-qty-wrap {
		flex-direction: column;
		align-items: stretch;
	}

	.storzen-qv-qty-wrap .storzen-qv-add-to-cart {
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   Product gallery thumbnail strip  (v1.1.3)
   -------------------------------------------------------------------------- */

/* Main image wrapper — relative so a future zoom overlay can sit inside */
.storzen-qv-main-image-wrap {
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	background: #f8f8f8;
}

.storzen-qv-main-img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	transition: opacity 0.2s ease;
}

.storzen-qv-main-img.is-loading {
	opacity: 0.5;
}

/* Thumbnail strip */
.storzen-qv-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

/* Individual thumbnail button */
.storzen-qv-thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	background: #f3f3f3;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s ease, opacity 0.15s ease;
	outline: none;
}

.storzen-qv-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 2px;
}

.storzen-qv-thumb:hover {
	border-color: #aaa;
}

.storzen-qv-thumb:focus-visible {
	border-color: #111;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
}

/* Active / selected state */
.storzen-qv-thumb.is-active {
	border-color: #111;
	opacity: 1;
}

/* --------------------------------------------------------------------------
   Stock / availability badge  (v1.1.3)
   -------------------------------------------------------------------------- */
.storzen-qv-stock {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 3px;
	margin-bottom: 12px;
}

/* In stock — green */
.storzen-qv-stock--in {
	background: #eaf6ee;
	color: #1a6e35;
}

.storzen-qv-stock--in::before {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22a44e;
	flex-shrink: 0;
}

/* Low stock — amber urgency */
.storzen-qv-stock--low {
	background: #fff8e6;
	color: #8a5700;
}

.storzen-qv-stock--low::before {
	content: '';
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #e6a817;
	flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Responsive — gallery on mobile (larger thumbs, full-width strip)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
	.storzen-qv-gallery {
		gap: 5px;
		margin-top: 8px;
	}

	.storzen-qv-thumb {
		width: 48px;
		height: 48px;
	}
}

/* --------------------------------------------------------------------------
   Modal open animations  (v1.1.4)

   Four presets controlled by a class on .storzen-qv-modal:
     .sqv-anim-fade      — opacity only
     .sqv-anim-slide-up  — slide up + fade (default)
     .sqv-anim-zoom-in   — scale up from 95% + fade
     .sqv-anim-none      — instant, no transition

   The animation runs once when .is-visible is added to the overlay.
   -------------------------------------------------------------------------- */

/* Remove the default translateY transition — animations take over */
.storzen-qv-modal.sqv-anim-fade,
.storzen-qv-modal.sqv-anim-slide-up,
.storzen-qv-modal.sqv-anim-zoom-in,
.storzen-qv-modal.sqv-anim-none {
	transform: none;
	transition: none;
}

/* --- Fade --- */
@keyframes sqv-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.storzen-qv-overlay.is-visible .storzen-qv-modal.sqv-anim-fade {
	animation: sqv-fade-in 0.25s ease forwards;
}

/* --- Slide up --- */
@keyframes sqv-slide-up-in {
	from { opacity: 0; transform: translateY(28px); }
	to   { opacity: 1; transform: translateY(0); }
}

.storzen-qv-overlay.is-visible .storzen-qv-modal.sqv-anim-slide-up {
	animation: sqv-slide-up-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* --- Zoom in --- */
@keyframes sqv-zoom-in {
	from { opacity: 0; transform: scale(0.94); }
	to   { opacity: 1; transform: scale(1); }
}

.storzen-qv-overlay.is-visible .storzen-qv-modal.sqv-anim-zoom-in {
	animation: sqv-zoom-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- None — instant display, no motion --- */
.storzen-qv-overlay.is-visible .storzen-qv-modal.sqv-anim-none {
	opacity: 1;
	transform: none;
	animation: none;
}

/* Close transition — always gentle fade out regardless of open animation */
.storzen-qv-modal {
	transition: opacity 0.2s ease;
}

.storzen-qv-overlay:not(.is-visible) .storzen-qv-modal {
	opacity: 0;
}

/* --------------------------------------------------------------------------
   Hover trigger mode  (v1.1.4)
   No extra CSS needed — hover binding is handled entirely in JS.
   The button appearance is unchanged in both click and hover modes.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Variable product variation form  (v1.1.5)
   -------------------------------------------------------------------------- */
.storzen-qv-variation-wrap {
	margin-top: 4px;
}

/* Variations table — attribute label + dropdown rows */
.storzen-qv-variations-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 14px;
}

.storzen-qv-variations-table td {
	padding: 5px 0;
	vertical-align: middle;
}

.storzen-qv-variations-table td.label {
	width: 36%;
	padding-right: 10px;
}

.storzen-qv-variations-table td.label label {
	font-size: 13px;
	font-weight: 500;
	color: #444;
	white-space: nowrap;
}

/* Variation attribute dropdown */
.storzen-qv-variations-table td.value select {
	width: 100%;
	max-width: 220px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-size: 13px;
	color: #333;
	background: #fff;
	appearance: auto;
	cursor: pointer;
}

.storzen-qv-variations-table td.value select:focus {
	outline: none;
	border-color: #888;
}

/* Clear link */
.storzen-qv-variations-table .reset_variations {
	display: inline-block;
	margin-left: 8px;
	font-size: 11px;
	color: #999;
	text-decoration: underline;
	vertical-align: middle;
}

.storzen-qv-variations-table .reset_variations:hover {
	color: #555;
}

/* WooCommerce single_variation block — price + stock message */
.storzen-qv-variation-form .single_variation_wrap .woocommerce-variation {
	margin-bottom: 12px;
	min-height: 28px;
}

.storzen-qv-variation-form .woocommerce-variation-price .price {
	font-size: 18px;
	font-weight: 600;
	color: #111;
}

.storzen-qv-variation-form .woocommerce-variation-availability {
	font-size: 13px;
	margin-top: 4px;
}

/* Disabled Add to Cart — before a variation is selected */
.storzen-qv-variation-form .single_add_to_cart_button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Shortcode button  (v1.1.5)
   -------------------------------------------------------------------------- */

/* Inherits all .storzen-qv-trigger styles; inline-flex for placement in prose */
.storzen-qv-trigger.storzen-qv-shortcode {
	display: inline-flex;
}

/* --------------------------------------------------------------------------
   Next / Previous navigation arrows  (v1.1.6)
   -------------------------------------------------------------------------- */

/* Arrows sit outside the modal content area, centred vertically */
.storzen-qv-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	display: none; /* shown by JS when a neighbour exists */
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 50%;
	cursor: pointer;
	color: #333;
	box-shadow: 0 2px 8px rgba(0,0,0,.10);
	transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	z-index: 10;
	padding: 0;
}

.storzen-qv-nav:hover {
	background: #111;
	color: #fff;
	border-color: #111;
	box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.storzen-qv-nav:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

/* Position: outside the modal on wider viewports */
.storzen-qv-nav--prev { left:  -56px; }
.storzen-qv-nav--next { right: -56px; }

/* On narrower viewports sit flush against the modal edges */
@media (max-width: 860px) {
	.storzen-qv-nav--prev { left:  -18px; }
	.storzen-qv-nav--next { right: -18px; }
}

@media (max-width: 600px) {
	/* On mobile move arrows to bottom of overlay as a strip */
	.storzen-qv-nav {
		position: fixed;
		top: auto;
		bottom: 16px;
		transform: none;
		width: 44px;
		height: 44px;
	}
	.storzen-qv-nav--prev { left:  calc(50% - 52px); }
	.storzen-qv-nav--next { right: calc(50% - 52px); }
}

/* --------------------------------------------------------------------------
   Popup display mode: Drawer / Sidebar  (v1.1.7)

   .sqv-mode-modal  → default centered overlay (existing behaviour)
   .sqv-mode-drawer → slide-in panel from the right edge of the screen

   The drawer renders the same PHP/AJAX content; only the CSS layout changes.
   Nav arrows are hidden in drawer mode (no room beside the panel).
   -------------------------------------------------------------------------- */

/* --- Drawer overlay — full-height right-edge panel --- */
.storzen-qv-overlay.sqv-mode-drawer {
	align-items: stretch;
	justify-content: flex-end;
	background: rgba(0, 0, 0, 0.45);
}

/* Drawer panel — fixed width, full viewport height */
.sqv-mode-drawer .storzen-qv-modal {
	width: min(460px, 92vw);
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	border-radius: 0;
	margin: 0;
	overflow-y: auto;
	overflow-x: hidden;
	/* Slide-in from right */
	transform: translateX(100%);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	animation: none !important; /* override modal animations in drawer mode */
	opacity: 1 !important;
}

/* Animate in when overlay becomes visible */
.sqv-mode-drawer.is-visible .storzen-qv-modal {
	transform: translateX(0);
}

/* Close × button — top-right of drawer panel */
.sqv-mode-drawer .storzen-qv-close {
	position: sticky;
	top: 0;
	float: right;
	z-index: 2;
	margin: 12px 12px 0 0;
	background: var(--surface-1, #f8f8f8);
}

/* Drawer content — single column, full width */
.sqv-mode-drawer .storzen-qv-product {
	flex-direction: column;
}

.sqv-mode-drawer .storzen-qv-image,
.sqv-mode-drawer .storzen-qv-details {
	width: 100%;
	max-width: 100%;
}

/* Hide nav arrows in drawer — no space beside the panel */
.sqv-mode-drawer .storzen-qv-nav {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Mobile full-screen popup  (v1.1.7)

   On screens ≤ 480px the modal expands to fill the entire viewport.
   Fixes the broken mobile display that competitors have 3-star reviews for.
   Works in both modal and drawer modes.
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {

	/* Full-screen overlay */
	.storzen-qv-overlay {
		padding: 0;
		align-items: stretch;
		justify-content: stretch;
	}

	/* Modal becomes full-screen panel */
	.storzen-qv-modal {
		width: 100% !important;
		max-width: 100% !important;
		height: 100% !important;
		max-height: 100% !important;
		border-radius: 0 !important;
		margin: 0 !important;
		overflow-y: auto;
		/* Override desktop slide animations */
		animation: sqv-fade-in 0.2s ease forwards !important;
	}

	/* Stack image + details vertically */
	.storzen-qv-product {
		flex-direction: column;
	}

	.storzen-qv-image,
	.storzen-qv-details {
		width: 100%;
		max-width: 100%;
	}

	/* Sticky top bar with close button */
	.storzen-qv-close {
		position: sticky;
		top: 0;
		float: right;
		z-index: 10;
		margin: 12px 12px 0 0;
		background: rgba(255, 255, 255, 0.92);
		backdrop-filter: blur(4px);
	}

	/* Hide nav arrows on mobile — use close + reopen */
	.storzen-qv-nav {
		display: none !important;
	}

	/* Drawer on mobile = same as modal (full-screen) */
	.sqv-mode-drawer .storzen-qv-modal {
		transform: translateY(100%);
		transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.sqv-mode-drawer.is-visible .storzen-qv-modal {
		transform: translateY(0);
	}
}
