/* =============================================================================
 * Table of Contents
 *
 * 1. Variables / Custom Properties
 * 2. Base / Wrapper
 * 3. Components
 * 4. States & Modifiers
 * 5. Responsive / Media Queries
 * 6. RTL Support
 * ============================================================================= */

/* ── Wishlist Button ───────────────────────────────────────────── */
.convixo-wl-btn {
	--szwl-color: #7c3aed;
	--szwl-heart: #e11d48;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	padding: 10px 18px;
	border-radius: 7px;
	cursor: pointer;
	transition: all .15s;
	text-decoration: none;
	margin-top: 10px;
}

.convixo-wl-btn--outline {
	background: transparent;
	color: var(--szwl-color);
	border: 2px solid var(--szwl-color);
}

.convixo-wl-btn--outline:hover {
	background: var(--szwl-color);
	color: #fff;
}

.convixo-wl-btn--solid {
	background: var(--szwl-color);
	color: #fff;
	border: 2px solid var(--szwl-color);
}

.convixo-wl-btn--solid:hover {
	opacity: .88;
}

.convixo-wl-btn--text {
	background: transparent;
	color: var(--szwl-color);
	border: none;
	padding: 6px 0;
}

.convixo-wl-btn.is-wishlisted .convixo-wl-btn__icon {
	color: var(--szwl-heart);
}

.convixo-wl-btn--loop {
	font-size: 12px;
	padding: 7px 12px;
	margin-top: 6px;
}

/* ── Wishlist Page ─────────────────────────────────────────────── */
.convixo-wl-page {
	min-height: 200px;
}

/* Loading */
.convixo-wl-page__loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 40px 0;
	color: #6b7280;
	font-size: 15px;
}

.convixo-wl-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #e5e7eb;
	border-top-color: #7c3aed;
	border-radius: 50%;
	animation: convixo-wl-spin .7s linear infinite;
	flex-shrink: 0;
}

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

/* ── Table layout (CSS Grid) ───────────────────────────────────── */
/*
 * Shared column track definition. Header and every data row use the
 * exact same grid template, so all columns line up perfectly.
 *   remove | name (flexible) | price | stock | action
 */
.convixo-wl-thead,
.convixo-wl-row {
	display: grid;
	/* remove | name | price | stock | action — evenly distributed */
	grid-template-columns: 48px 2fr 1fr 1fr 1.2fr;
	align-items: center;
	column-gap: 20px;
}

.convixo-wl-table {
	width: 100%;
	margin-top: 8px;
}

/* Header row */
.convixo-wl-thead {
	padding: 0 16px 14px;
	border-bottom: 2px solid #e5e7eb;
}

.convixo-wl-th {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #6b7280;
}

/* Data rows */
.convixo-wl-row {
	padding: 18px 16px;
	border-bottom: 1px solid #f1f1f3;
	transition: background .12s;
}

.convixo-wl-row:hover {
	background: #faf9ff;
}

/* Remove button */
.convixo-wl-td--remove {
	display: flex;
	align-items: center;
	justify-content: center;
}

.convixo-wl-row__remove {
	width: 26px;
	height: 26px;
	background: transparent;
	border: 1.5px solid #d1d5db;
	border-radius: 50%;
	cursor: pointer;
	font-size: 11px;
	color: #9ca3af;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: all .15s;
	line-height: 1;
	flex-shrink: 0;
}

.convixo-wl-row__remove:hover {
	background: #fee2e2;
	color: #dc2626;
	border-color: #fca5a5;
}

.convixo-wl-row__remove.is-busy {
	opacity: .5;
	cursor: wait;
	pointer-events: none;
}

/* Name cell: image + text */
.convixo-wl-td--name {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.convixo-wl-row__img-link {
	display: block;
	flex-shrink: 0;
}

.convixo-wl-row__img-link img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #f1f1f3;
	display: block;
}

/* Name + date wrapper */
.convixo-wl-row__name-wrap {
	min-width: 0;
}

.convixo-wl-row__name {
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
	text-decoration: none;
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.convixo-wl-row__name:hover {
	color: #7c3aed;
}

.convixo-wl-row__date {
	display: block;
	font-size: 11px;
	color: #9ca3af;
	margin-top: 3px;
}

/* Price */
.convixo-wl-td--price {
	font-size: 15px;
	font-weight: 700;
	color: #7c3aed;
}

.convixo-wl-row__price del {
	color: #9ca3af;
	font-weight: 400;
	margin-right: 4px;
}

.convixo-wl-row__price ins {
	text-decoration: none;
}

/* Stock badge */
.convixo-wl-td--stock {
	display: flex;
}

.convixo-wl-stock {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	white-space: nowrap;
}

.convixo-wl-stock--in {
	background: #d1fae5;
	color: #065f46;
}

.convixo-wl-stock--out {
	background: #fee2e2;
	color: #991b1b;
}

/* ATC button */
.convixo-wl-td--action {
	display: flex;
}

.convixo-wl-row__atc {
	display: inline-block;
	width: 100%;
	max-width: 170px;
	padding: 10px 14px;
	background: #7c3aed;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: background .15s;
	white-space: nowrap;
}

.convixo-wl-row__atc:hover {
	background: #6d28d9;
	color: #fff;
}

.convixo-wl-row__atc--view {
	background: #f3f4f6;
	color: #374151;
}

.convixo-wl-row__atc--view:hover {
	background: #e5e7eb;
	color: #374151;
}

.convixo-wl-row__atc--incart {
	background: #dc2626;
	color: #fff;
}

.convixo-wl-row__atc--incart:hover {
	background: #dc2626;
	color: #fff;
}

.convixo-wl-row__atc.is-busy {
	opacity: .7;
	cursor: wait;
	pointer-events: none;
}

/* Empty state */
.convixo-wl-empty {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
	font-size: 15px;
}

.convixo-wl-empty::before {
	content: '🤍';
	display: block;
	font-size: 40px;
	margin-bottom: 12px;
}

/* ── Tablet: tighten the gap below 1100px ────────────────────── */
@media(max-width:1100px) {

	.convixo-wl-thead,
	.convixo-wl-row {
		grid-template-columns: 40px 2fr 1fr 1fr 1.2fr;
		column-gap: 14px;
	}
}

/* ── Mobile: stack to cards below 600px ──────────────────────── */
@media(max-width:600px) {
	.convixo-wl-thead {
		display: none;
	}

	.convixo-wl-row {
		grid-template-columns: 48px 1fr auto;
		grid-template-areas:
			"remove name name"
			"remove price stock"
			"remove action action";
		row-gap: 10px;
		column-gap: 14px;
		padding: 16px 12px;
	}

	.convixo-wl-td--remove {
		grid-area: remove;
		align-self: start;
	}

	.convixo-wl-td--name {
		grid-area: name;
	}

	.convixo-wl-td--price {
		grid-area: price;
		align-items: center;
	}

	.convixo-wl-td--stock {
		grid-area: stock;
		justify-content: flex-end;
	}

	.convixo-wl-td--action {
		grid-area: action;
	}

	.convixo-wl-row__img-link img {
		width: 48px;
		height: 48px;
	}
}

@media(prefers-reduced-motion:reduce) {

	.convixo-wl-btn,
	.convixo-wl-row,
	.convixo-wl-row__atc,
	.convixo-wl-row__remove {
		transition: none;
	}

	.convixo-wl-spinner {
		animation: none;
	}
}