/*!
 * Storzen — Compare Products
 * --storzen-compare-accent is set via inline CSS variable from PHP.
 */

/* ════════════════════════════════════════════════════════════════════════
 * Compare button (on product cards + single product)
 * ════════════════════════════════════════════════════════════════════════ */
.sz-compare-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: transparent;
	border: 1px solid #e5e7eb;
	color: #4b5563;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 6px;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
	line-height: 1.2;
	font-family: inherit;
}
.sz-compare-btn:hover {
	border-color: var(--storzen-compare-accent, #FF3636);
	color: var(--storzen-compare-accent, #FF3636);
}
.sz-compare-btn:focus-visible {
	outline: 2px solid var(--storzen-compare-accent, #FF3636);
	outline-offset: 2px;
}
.sz-compare-btn.is-added {
	background: var(--storzen-compare-accent, #FF3636);
	border-color: var(--storzen-compare-accent, #FF3636);
	color: #fff;
}
.sz-compare-btn.is-added:hover {
	background: #E62E2E;
	border-color: #E62E2E;
	color: #fff;
}
.sz-compare-btn__icon {
	font-size: 14px;
	line-height: 1;
}

/* Compact variant when placed in card overlay */
.social-style-two .sz-compare-btn,
.storzen-fc__btn .sz-compare-btn {
	padding: 5px 8px;
	font-size: 11px;
	border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════════════
 * Sticky compare bar
 * ════════════════════════════════════════════════════════════════════════ */
.sz-compare-bar {
	position: fixed;
	left: 0;
	right: 0;
	background: #fff;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .1);
	z-index: 9985;
	padding: 12px 0;
	border-top: 2px solid var(--storzen-compare-accent, #FF3636);
	transform: translateY(0);
	transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .25s ease;
}
.sz-compare-bar--top {
	top: 0;
	bottom: auto;
	border-top: none;
	border-bottom: 2px solid var(--storzen-compare-accent, #FF3636);
	box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
	transform: translateY(0);
}
.sz-compare-bar--bottom {
	bottom: 0;
}
.sz-compare-bar.is-empty {
	transform: translateY(110%);
	opacity: 0;
	pointer-events: none;
}
.sz-compare-bar--top.is-empty {
	transform: translateY(-110%);
}

.sz-compare-bar__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.sz-compare-bar__label {
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
}
.sz-compare-bar__count {
	color: var(--storzen-compare-accent, #FF3636);
	margin-left: 4px;
}
.sz-compare-bar__actions {
	display: flex;
	gap: 8px;
}
.sz-compare-bar__open,
.sz-compare-bar__clear {
	background: transparent;
	border: 1px solid #e5e7eb;
	color: #4b5563;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 6px;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
	font-family: inherit;
}
.sz-compare-bar__open {
	background: var(--storzen-compare-accent, #FF3636);
	border-color: var(--storzen-compare-accent, #FF3636);
	color: #fff;
}
.sz-compare-bar__open:hover {
	background: #E62E2E;
	border-color: #E62E2E;
}
.sz-compare-bar__clear:hover {
	border-color: #dc2626;
	color: #dc2626;
}

/* ════════════════════════════════════════════════════════════════════════
 * Compare modal
 * ════════════════════════════════════════════════════════════════════════ */
.sz-compare-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	visibility: hidden;
}
.sz-compare-modal.is-open {
	pointer-events: auto;
	visibility: visible;
}
.sz-compare-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .5);
	opacity: 0;
	transition: opacity .25s ease;
}
.sz-compare-modal.is-open .sz-compare-modal__overlay {
	opacity: 1;
}
.sz-compare-modal__panel {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(.95);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
	width: 95vw;
	max-width: 1200px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .25s ease;
}
.sz-compare-modal.is-open .sz-compare-modal__panel {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
}
.sz-compare-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e5e7eb;
}
.sz-compare-modal__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #111827;
}
.sz-compare-modal__close {
	background: transparent;
	border: 0;
	font-size: 24px;
	line-height: 1;
	color: #6b7280;
	width: 32px;
	height: 32px;
	cursor: pointer;
	border-radius: 6px;
	transition: background .15s ease, color .15s ease;
}
.sz-compare-modal__close:hover {
	background: #f3f4f6;
	color: #111827;
}
.sz-compare-modal__body {
	flex: 1;
	overflow: auto;
	padding: 16px 20px 20px;
}

/* ════════════════════════════════════════════════════════════════════════
 * Compare table
 * ════════════════════════════════════════════════════════════════════════ */
.sz-compare-wrap {
	margin: 20px 0;
	overflow-x: auto;
}
.sz-compare-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
}
.sz-compare-table th,
.sz-compare-table td {
	padding: 14px 16px;
	border-bottom: 1px solid #f3f4f6;
	border-right: 1px solid #f3f4f6;
	text-align: left;
	vertical-align: top;
	color: #374151;
	line-height: 1.5;
}
.sz-compare-table th:last-child,
.sz-compare-table td:last-child {
	border-right: none;
}
.sz-compare-table tr:last-child th,
.sz-compare-table tr:last-child td {
	border-bottom: none;
}
.sz-compare-table thead th {
	background: #f9fafb;
	font-weight: 600;
	color: #1f2937;
	position: sticky;
	top: 0;
	z-index: 1;
}
.sz-compare-table__label-col {
	background: #f9fafb !important;
	font-weight: 600;
	color: #1f2937 !important;
	min-width: 160px;
	width: 200px;
}
.sz-compare-table__product-col {
	min-width: 220px;
	position: relative;
}
.sz-compare-table__name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	text-decoration: none;
	margin-top: 4px;
}
.sz-compare-table__name:hover {
	color: var(--storzen-compare-accent, #FF3636);
}
.sz-compare-table__remove {
	position: absolute;
	top: 6px;
	right: 6px;
	background: transparent;
	border: 0;
	width: 22px;
	height: 22px;
	font-size: 18px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	border-radius: 4px;
	transition: background .15s ease, color .15s ease;
}
.sz-compare-table__remove:hover {
	background: #fee2e2;
	color: #dc2626;
}
.sz-compare-table__img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
}
.sz-compare-table__missing {
	color: #9ca3af;
}

/* Different-row highlight */
.sz-compare-table__row.is-different {
	background: linear-gradient(0deg, rgba(124, 58, 237, .03), rgba(124, 58, 237, .03));
}
.sz-compare-table__row.is-different td {
	background: rgba(124, 58, 237, .04);
}

/* Stock status pill */
.sz-compare-stock {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .3px;
}
.sz-compare-stock--in   { background: #d1fae5; color: #065f46; }
.sz-compare-stock--back { background: #fef3c7; color: #92400e; }
.sz-compare-stock--out  { background: #fee2e2; color: #991b1b; }

.sz-compare-atc {
	display: inline-block;
	background: var(--storzen-compare-accent, #FF3636);
	color: #fff;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s ease;
}
.sz-compare-atc:hover {
	background: #E62E2E;
	color: #fff;
}

.sz-compare-empty {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
	font-size: 15px;
	background: #f9fafb;
	border-radius: 8px;
	border: 1px dashed #d1d5db;
	margin: 20px 0;
}

/* ════════════════════════════════════════════════════════════════════════
 * Mobile
 * ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
	.sz-compare-bar__inner {
		padding: 0 12px;
		gap: 10px;
	}
	.sz-compare-bar__label { font-size: 13px; }
	.sz-compare-bar__open,
	.sz-compare-bar__clear {
		padding: 6px 10px;
		font-size: 12px;
	}
	.sz-compare-table { font-size: 13px; }
	.sz-compare-table th,
	.sz-compare-table td { padding: 10px 12px; }
	.sz-compare-table__label-col { min-width: 120px; width: 140px; }
	.sz-compare-table__product-col { min-width: 160px; }
	.sz-compare-modal__panel { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.sz-compare-bar,
	.sz-compare-modal__overlay,
	.sz-compare-modal__panel,
	.sz-compare-btn,
	.sz-compare-bar__open,
	.sz-compare-bar__clear {
		transition: none !important;
	}
}

/* Toast notice (errors / "max reached" warnings) */
.sz-compare-toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	padding: 10px 18px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
	z-index: 10000;
	max-width: 90vw;
	text-align: center;
}

/* When compare bar is at bottom, push the toast above it */
.sz-compare-bar--bottom:not(.is-empty) ~ .sz-compare-toast {
	bottom: 80px;
}

body.sz-compare-modal-open {
	overflow: hidden;
}
