/**
 * Quick View, Wishlist & Compare — front-end styles.
 *
 * Structural only — colors/spacing use CSS variables so store owners
 * can override without editing the plugin. Visual polish comes in a
 * dedicated design pass.
 */

.qvwc-actions {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.35em;
	margin-top: 0.5em;
}

.qvwc-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.qvwc-btn {
	/* Defensive resets — themes often apply global button/link styles
	   (box-shadow, text-transform, font, line-height) that would
	   otherwise distort these icon buttons. */
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	background: var( --qvwc-button-bg, #fff );
	border: 1px solid var( --qvwc-button-border, #ddd );
	border-radius: 50%;
	cursor: pointer;
}

.qvwc-btn:hover {
	background: var( --qvwc-button-bg-hover, #f5f5f5 );
}

.qvwc-btn.is-active {
	background: var( --qvwc-button-active-bg, #eee );
	border-color: var( --qvwc-button-active-border, #999 );
}

/*
 * Filled red heart when wishlisted, colored bars when compared —
 * a clear, standard "already added" indicator, not just the subtle
 * background/border change above. The heart's <path> has no fill of
 * its own (only stroke), so it inherits fill from the SVG — setting
 * fill: currentColor here is what turns it solid. The compare icon's
 * <rect> elements already use fill="currentColor" directly in the
 * markup, so just changing color here is enough to recolor them.
 */
.qvwc-btn--wishlist.is-active .qvwc-btn__icon svg {
	color: var( --qvwc-wishlist-active-color, #e2384d );
	fill: currentColor;
}

.qvwc-btn--compare.is-active .qvwc-btn__icon svg {
	color: var( --qvwc-compare-active-color, #2271b1 );
}

.qvwc-btn__icon {
	width: 16px;
	height: 16px;
	display: inline-flex;
}

.qvwc-btn__icon svg {
	width: 100%;
	height: 100%;
	color: var( --qvwc-icon-color, #333 );
}

/*
 * Hover mode: buttons overlay the thumbnail and are hidden until the
 * product card is hovered (mouse/trackpad) or a button inside it
 * receives keyboard focus. The overlay is positioned relative to
 * .qvwc-image-wrap (a container the JS creates around just the <img>
 * element), not the whole product card — that's what keeps it pinned
 * to the image regardless of whether a theme's markup wraps the
 * image, title, and price in one shared link or in separate ones.
 */
.qvwc-image-wrap {
	position: relative;
	display: block;
}

body.qvwc-display-hover .qvwc-actions,
body.qvwc-display-always .qvwc-actions {
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translateX( -50% );
	margin-top: 0;
	z-index: 10;
	/*
	 * Initial opacity/visibility/transition are set via inline style
	 * by the JS (see injectButtons() in qvwc-frontend.js) — but only
	 * for hover mode. In "always visible" mode, no inline style ever
	 * gets applied, so the overlay just renders immediately in this
	 * same position at its default opacity (visible), with none of
	 * the hover-triggered show/hide behavior.
	 * Show/hide is controlled entirely by JS now — mutating a CSS
	 * class on the product element itself turned out to trigger
	 * unwanted side effects on Interactivity-API-managed blocks
	 * (Product Collection and similar), where hovering one product
	 * could incorrectly reveal buttons on sibling products sharing
	 * the same reactive namespace. Direct inline styles on our own
	 * wrapper element avoid touching anything the framework manages.
	 */
}

/*
 * Touch devices have no hover state, so "hover mode" would otherwise
 * make the buttons unreachable — fall back to always-visible here
 * regardless of the store owner's chosen display style. The JS
 * checks the same (hover: hover) and (pointer: fine) condition
 * before ever setting inline styles, so on touch devices it simply
 * never hides the overlay in the first place — this rule is a CSS-
 * only backstop for that same behavior.
 */
@media ( hover: none ), ( pointer: coarse ) {
	body.qvwc-display-hover .qvwc-actions {
		position: static;
		transform: none;
		opacity: 1;
		visibility: visible;
		margin-top: 0.5em;
	}
}

.qvwc-modal[hidden] {
	display: none;
}

.qvwc-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qvwc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.qvwc-modal__content {
	position: relative;
	background: #fff;
	max-width: 860px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 36px 32px 28px;
	box-sizing: border-box;
	border-radius: 6px;
}

.qvwc-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.75em;
	line-height: 1;
	cursor: pointer;
	color: #555;
}

.qvwc-modal__close:hover {
	color: #000;
}

.qvwc-modal__body[hidden],
.qvwc-modal__loading[hidden],
.qvwc-modal__error[hidden] {
	display: none;
}

.qvwc-modal__loading,
.qvwc-modal__error {
	text-align: center;
	padding: 3em 0;
}

html.qvwc-modal-open {
	overflow: hidden;
}

/* ============================================================
   Quick View modal body — ported from All-In-One Product Slider
   Carousel's proven Quick View implementation, classes renamed
   from i13-qv-* to qvwc-qv-* to avoid collisions if both plugins
   are active on the same site.
   ============================================================ */

.qvwc-qv-inner {
	display: flex;
	gap: 28px;
	flex-wrap: wrap;
}

.qvwc-qv-images {
	flex: 0 0 42%;
	min-width: 200px;
}

.qvwc-qv-main-img img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
	object-fit: contain;
	max-height: 340px;
}

.qvwc-qv-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.qvwc-qv-thumb {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 3px;
	border: 2px solid #e0e0e0;
	cursor: pointer;
	transition: border-color 0.15s;
}

.qvwc-qv-thumb:hover,
.qvwc-qv-thumb-active {
	border-color: var( --qvwc-accent, #96588a );
}

.qvwc-qv-details {
	flex: 1;
	min-width: 220px;
}

.qvwc-qv-title {
	font-size: 1.25em;
	margin: 0 0 8px;
	line-height: 1.35;
}

.qvwc-qv-title a {
	text-decoration: none;
	color: inherit;
}

.qvwc-qv-title a:hover {
	color: var( --qvwc-accent, #96588a );
}

.qvwc-qv-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.qvwc-qv-stars {
	display: flex;
	gap: 2px;
}

.qvwc-qv-star {
	display: inline-block;
	width: 14px;
	height: 14px;
	background-color: #d3d3d3;
	clip-path: polygon(
		50% 0%, 61% 35%, 98% 35%, 68% 57%,
		79% 91%, 50% 70%, 21% 91%, 32% 57%,
		2% 35%, 39% 35%
	);
}

.qvwc-qv-star.is-full {
	background-color: #f5a623;
}

.qvwc-qv-star.is-half {
	background: linear-gradient( 90deg, #f5a623 50%, #d3d3d3 50% );
}

.qvwc-qv-review-count {
	font-size: 0.8em;
	color: #777;
}

.qvwc-qv-price {
	font-size: 1.3em;
	font-weight: 600;
	color: #333;
	margin: 10px 0;
}

.qvwc-qv-price del {
	color: #aaa;
	font-size: 0.85em;
}

.qvwc-qv-price ins {
	text-decoration: none;
	color: #c00;
}

.qvwc-qv-desc {
	font-size: 0.9em;
	color: #555;
	margin-bottom: 14px;
	line-height: 1.55;
}

.qvwc-qv-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.82em;
	color: #666;
	margin-bottom: 16px;
}

.qvwc-qv-meta span {
	display: block;
}

.qvwc-qv-meta a {
	color: var( --qvwc-accent, #96588a );
}

.qvwc-qv-stock.in-stock {
	color: #46b450;
}

.qvwc-qv-stock.out-of-stock {
	color: #c00;
}

.qvwc-qv-add-to-cart {
	margin-bottom: 14px;
}

.qvwc-qv-add-to-cart .quantity {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-right: 8px;
}

.qvwc-qv-qty {
	width: 60px;
	text-align: center;
	border: 1px solid #ccc;
	border-radius: 3px;
	padding: 9px 6px;
	font-size: 0.9em;
	height: auto;
}

.qvwc-qv-add-to-cart .single_add_to_cart_button,
.qvwc-qv-atc-var,
.qvwc-qv-atc-simple {
	background: var( --qvwc-accent, #96588a );
	color: #fff;
	border: none;
	padding: 10px 22px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 0.95em;
	transition: background 0.15s;
	vertical-align: middle;
	display: inline-block;
}

.qvwc-qv-add-to-cart .single_add_to_cart_button:hover,
.qvwc-qv-atc-var:hover,
.qvwc-qv-atc-simple:hover {
	background: var( --qvwc-accent-hover, #7a4370 );
}

.qvwc-qv-atc-var.disabled,
.qvwc-qv-atc-simple:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.qvwc-qv-var-qty {
	display: inline-flex;
	align-items: center;
	margin-right: 8px;
	vertical-align: middle;
}

.qvwc-qv-atc-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.qvwc-qv-var-msg[hidden],
.qvwc-qv-simple-msg[hidden] {
	display: none;
}

.qvwc-qv-var-msg,
.qvwc-qv-simple-msg {
	font-size: 0.85em;
	margin-top: 6px;
}

.qvwc-qv-full-link {
	display: inline-block;
	font-size: 0.85em;
	color: var( --qvwc-accent, #96588a );
	text-decoration: none;
}

.qvwc-qv-full-link:hover {
	text-decoration: underline;
}

@media ( max-width: 560px ) {
	.qvwc-qv-inner {
		flex-direction: column;
	}
	.qvwc-qv-images {
		flex: 0 0 100%;
	}
}

/* ============================================================
   Toast notifications
   ============================================================ */

.qvwc-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translate( -50%, 12px );
	background: #333;
	color: #fff;
	padding: 12px 20px;
	border-radius: 4px;
	font-size: 0.9em;
	z-index: 100001;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.2 );
}

.qvwc-toast--visible {
	opacity: 1;
	transform: translate( -50%, 0 );
}

.qvwc-toast__link {
	color: #fff;
	text-decoration: underline;
	white-space: nowrap;
	font-weight: 600;
}

/* ============================================================
   Compare page ([qvwc_compare_table] shortcode)
   ============================================================ */

.qvwc-compare-empty,
.qvwc-compare-loading {
	text-align: center;
	padding: 2em 0;
	color: #777;
}

.qvwc-compare-table {
	width: 100%;
	border-collapse: collapse;
}

.qvwc-compare-table td {
	border: 1px solid #eee;
	padding: 14px;
	text-align: center;
	vertical-align: top;
	min-width: 160px;
}

.qvwc-compare-label {
	text-align: left;
	font-weight: 600;
	color: #555;
	background: #fafafa;
	min-width: 120px;
	white-space: nowrap;
}

.qvwc-compare-row--attribute td:not( .qvwc-compare-label ) {
	font-size: 0.92em;
}

.qvwc-compare-diff {
	background: #fff8e1;
	font-weight: 600;
	position: relative;
}

.qvwc-compare-row--image td {
	position: relative;
}

.qvwc-compare-table img {
	max-width: 100%;
	height: auto;
}

.qvwc-compare-remove {
	position: absolute;
	top: 6px;
	right: 6px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 50%;
	width: 26px;
	height: 26px;
	line-height: 1;
	cursor: pointer;
	font-size: 1.1em;
	color: #666;
}

.qvwc-compare-remove:hover {
	color: #c00;
	border-color: #c00;
}

.qvwc-compare-row--name a {
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.qvwc-compare-row--stock.in-stock {
	color: #46b450;
}

.qvwc-compare-row--stock.out-of-stock {
	color: #c00;
}

@media ( max-width: 700px ) {
	.qvwc-compare-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}

/* ============================================================
   Wishlist page ([qvwc_wishlist_table] shortcode)
   ============================================================ */

.qvwc-wishlist-empty,
.qvwc-wishlist-loading {
	text-align: center;
	padding: 2em 0;
	color: #777;
}

.qvwc-wishlist-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 24px;
}

.qvwc-wishlist-item {
	position: relative;
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 16px;
	text-align: center;
}

.qvwc-wishlist-item__image img {
	max-width: 100%;
	height: auto;
	margin-bottom: 10px;
}

.qvwc-wishlist-item__name {
	font-size: 1em;
	margin: 0 0 6px;
}

.qvwc-wishlist-item__name a {
	text-decoration: none;
	color: inherit;
}

.qvwc-wishlist-item__price {
	margin-bottom: 12px;
	font-weight: 600;
}

.qvwc-wishlist-remove {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 50%;
	width: 26px;
	height: 26px;
	line-height: 1;
	cursor: pointer;
	font-size: 1.1em;
	color: #666;
	z-index: 1;
}

.qvwc-wishlist-remove:hover {
	color: #c00;
	border-color: #c00;
}

/* ============================================================
   Notify Me inline signup form
   ============================================================ */

.qvwc-notify-form {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 6px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 4px;
}

.qvwc-notify-email {
	border: none;
	outline: none;
	font-size: 0.8em;
	padding: 4px 6px;
	width: 160px;
}

.qvwc-notify-submit {
	background: #333;
	color: #fff;
	border: none;
	border-radius: 3px;
	padding: 5px 10px;
	font-size: 0.8em;
	cursor: pointer;
	white-space: nowrap;
}

.qvwc-notify-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.qvwc-notify-cancel {
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	font-size: 1em;
	line-height: 1;
	padding: 0 4px;
}

.qvwc-notify-cancel:hover {
	color: #333;
}

/* ============================================================
   Wishlist pagination
   ============================================================ */

.qvwc-wishlist-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 24px;
}

.qvwc-wishlist-page-nav {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 8px 16px;
	cursor: pointer;
	font-size: 0.9em;
}

.qvwc-wishlist-page-nav:hover:not( :disabled ) {
	background: #f5f5f5;
}

.qvwc-wishlist-page-nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.qvwc-wishlist-page-status {
	font-size: 0.85em;
	color: #777;
}

/* ============================================================
   Wishlist "Add All to Cart"
   ============================================================ */

.qvwc-wishlist-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}

.qvwc-wishlist-add-all:disabled,
.qvwc-wishlist-add-all-clear:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.qvwc-wishlist-add-all-clear {
	background: #fff;
	border: 1px solid #ccc;
}

.qvwc-wishlist-add-all-status[hidden] {
	display: none;
}

.qvwc-wishlist-add-all-status {
	font-size: 0.85em;
	color: #555;
	margin: 0;
}

/* ============================================================
   Single product page actions (below Add to Cart)
   ============================================================ */

.qvwc-product-page-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0;
	margin-top: 16px;
}

/*
 * Plain icon + text links, not boxed buttons — no background, no
 * border, uppercase muted-gray label with a thin vertical divider
 * between items, matching common WooCommerce theme conventions for
 * this exact placement (below Add to Cart).
 */
.qvwc-product-page-actions .qvwc-btn {
	all: unset;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	color: var( --qvwc-product-actions-color, #767676 );
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 4px 14px;
}

.qvwc-product-page-actions .qvwc-btn:first-child {
	padding-left: 0;
}

.qvwc-product-page-actions .qvwc-btn:hover {
	color: var( --qvwc-product-actions-hover-color, #222 );
}

.qvwc-product-page-actions .qvwc-btn.is-active {
	color: var( --qvwc-product-actions-active-color, #222 );
}

.qvwc-product-page-actions .qvwc-btn--wishlist.is-active {
	color: var( --qvwc-wishlist-active-color, #e2384d );
}

.qvwc-product-page-actions .qvwc-btn--wishlist.is-active .qvwc-btn__icon svg {
	fill: currentColor;
}

.qvwc-product-page-actions .qvwc-btn--compare.is-active {
	color: var( --qvwc-compare-active-color, #2271b1 );
}

.qvwc-product-page-actions .qvwc-btn + .qvwc-btn {
	position: relative;
}

.qvwc-product-page-actions .qvwc-btn + .qvwc-btn::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY( -50% );
	width: 1px;
	height: 14px;
	background: #ccc;
}

.qvwc-product-page-actions .qvwc-btn__icon {
	width: 16px;
	height: 16px;
	display: inline-flex;
}

.qvwc-product-page-actions .qvwc-btn__icon svg {
	width: 100%;
	height: 100%;
	color: inherit;
}

.qvwc-product-page-actions .qvwc-btn__label {
	position: static;
	width: auto;
	height: auto;
	padding: 0;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: nowrap;
	border: 0;
}

.qvwc-product-page-actions .qvwc-notify-form {
	margin-left: 6px;
	margin-top: 4px;
}
