/* Cuboss Wishlist — default styles, easily overridable by the theme. */

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.cuboss-wishlist-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	line-height: 1;
}

.cuboss-wishlist-btn .cw-heart path {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	transition: fill 0.15s ease;
}

.cuboss-wishlist-btn.is-wishlisted .cw-heart path {
	fill: #e2401c;
	stroke: #e2401c;
}

.cuboss-wishlist-btn--single {
	margin: 10px 0;
	font-size: 0.95em;
}

/* Card button: corner of the product image. */
.products .product,
.product-small {
	position: relative;
}

.cuboss-wishlist-btn--card {
	position: absolute;
	top: 8px;
	right: 8px;
	/* Above Flatsome's .badge-container, whose .z-1 utility is z-index: 21. */
	z-index: 22;
	width: 34px;
	height: 34px;
	justify-content: center;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cuboss-wishlist-btn--card .cw-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Wishlist page                                                       */
/* ------------------------------------------------------------------ */

.cuboss-wishlist.cw-loading {
	opacity: 0.5;
	pointer-events: none;
}

.cuboss-wishlist-toolbar {
	margin-bottom: 12px;
	text-align: right;
}

/* Size the sort dropdown to its content instead of the theme's full width. */
.cuboss-wishlist-toolbar .cw-sort {
	display: inline-block;
	width: auto;
	min-width: 0;
	max-width: 100%;
}

.cuboss-wishlist-table {
	width: 100%;
	border-collapse: collapse;
}

.cuboss-wishlist-table th,
.cuboss-wishlist-table td {
	padding: 10px 8px;
	vertical-align: middle;
	border-bottom: 1px solid #eee;
	text-align: left;
}

.cuboss-wishlist-table .cw-col-image img {
	width: 64px;
	height: auto;
	display: block;
}

/* Sale highlighting — override in your theme as needed. The white-to-green
   gradient lets white product-image backgrounds blend in on the left. */
.cuboss-wishlist-row.cuboss-wishlist-on-sale {
	background: linear-gradient(90deg, #fff 0%, #e6f4e6 100%);
	box-shadow: inset 3px 0 0 #4caf50;
}

/* Tilted "ON SALE!" badge (text comes from the data-sale attribute). */
.cuboss-wishlist-table .cw-col-image {
	position: relative;
}

.cuboss-wishlist-on-sale .cw-col-image::after {
	content: attr(data-sale);
	position: absolute;
	top: 4px;
	left: -2px;
	transform: rotate(-8deg);
	background: #4caf50;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1;
	padding: 3px 7px;
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	pointer-events: none;
	white-space: nowrap;
}

.cuboss-wishlist-row.cw-removing {
	opacity: 0.4;
}

.cw-stock {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 0.85em;
	white-space: nowrap;
}

.cw-stock--in-stock {
	background: #e5f5e0;
	color: #2e7d32;
}

.cw-stock--low-stock {
	background: #fff3cd;
	color: #8a6d1a;
}

.cw-stock--out-of-stock {
	background: #fdecea;
	color: #b71c1c;
}

.cw-stock--discontinued {
	background: #ececec;
	color: #555;
}

.cw-col-price del {
	opacity: 0.6;
	margin-right: 6px;
}

.cw-remove-item {
	background: none;
	border: none;
	color: #b71c1c;
	cursor: pointer;
	padding: 4px 6px;
	font-size: 0.9em;
}

.cw-variation-select {
	max-width: 220px;
}

/* Share + prefs boxes */
.cuboss-wishlist-share,
.cuboss-wishlist-prefs {
	margin-top: 28px;
	padding: 16px;
	border: 1px solid #eee;
	border-radius: 4px;
}

.cw-share-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cw-share-row .cw-share-url {
	flex: 1 1 260px;
	min-width: 0;
}

/* Email notification prefs flow horizontally to save space. */
.cw-pref-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
}

.cw-pref-label {
	margin: 0;
	white-space: nowrap;
}

.cuboss-wishlist-recs {
	margin-top: 36px;
}

.cw-guest-note {
	margin-top: 12px;
	font-size: 0.9em;
	opacity: 0.8;
}

/* Responsive: compact two-line layout on small screens.
   Line 1: image | name + variation. Line 2: price + stock | actions. */
@media (max-width: 700px) {
	.cuboss-wishlist-table thead {
		display: none;
	}

	.cuboss-wishlist-table,
	.cuboss-wishlist-table tbody {
		display: block;
	}

	.cuboss-wishlist-table tr {
		display: grid;
		grid-template-columns: 72px auto 1fr auto;
		grid-template-areas:
			"img name name name"
			"img var var var"
			"price stock stock actions";
		align-items: center;
		gap: 2px 10px;
		border-bottom: 2px solid #ddd;
		padding: 10px 4px;
	}

	.cuboss-wishlist-table td {
		display: block;
		border: none;
		padding: 0;
	}

	.cuboss-wishlist-table .cw-col-image {
		grid-area: img;
		align-self: start;
	}

	.cuboss-wishlist-table .cw-col-image img {
		width: 72px;
	}

	.cuboss-wishlist-table .cw-col-name {
		grid-area: name;
		font-weight: 600;
	}

	.cuboss-wishlist-table .cw-col-variation {
		grid-area: var;
		align-self: start;
	}

	.cuboss-wishlist-table .cw-col-price {
		grid-area: price;
		margin-top: 8px;
	}

	.cuboss-wishlist-table .cw-col-stock {
		grid-area: stock;
		margin-top: 8px;
	}

	.cuboss-wishlist-table .cw-col-actions {
		grid-area: actions;
		margin-top: 8px;
		text-align: right;
		white-space: nowrap;
	}
}
