/* ============================================================
 * Ubiquiti Kenya — Wishlist + Compare
 * Depends on the palette tokens defined in catalogue.css.
 * ============================================================ */

/* ---------- Icon buttons on product cards ---------- */

.woocommerce ul.products li.product { position: relative; }

.ubq-card-actions {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 6px;
	/* Hidden until the card is hovered on pointer devices; always visible on
	   touch, where there is no hover to reveal them (see media query below). */
	opacity: 0;
	transform: translateX(6px);
	transition: opacity .18s ease, transform .18s ease;
}

.woocommerce ul.products li.product:hover .ubq-card-actions,
.ubq-card-actions:focus-within { opacity: 1; transform: none; }

.ubq-card-act {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--nv-line);
	border-radius: 50%;
	background: #fff;
	color: var(--nv-muted);
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
	transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.ubq-card-act svg { width: 17px; height: 17px; }
.ubq-card-act:hover { color: var(--nv-blue); border-color: var(--nv-blue); }

.ubq-card-act.is-active {
	color: #fff;
	background: var(--nv-blue);
	border-color: var(--nv-blue);
}
.ubq-wl-btn.is-active svg { fill: currentColor; }

/* Touch devices have no hover — show the actions permanently. */
@media (hover: none) {
	.ubq-card-actions { opacity: 1; transform: none; }
}

/* ---------- Header wishlist counter ---------- */

.ubq-hdr-wishlist .ubq-hdr-ic { position: relative; }

.ubq-wl-count {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 9px;
	background: var(--nv-blue);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

/* ---------- Floating compare bar ---------- */

.ubq-cmp-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 900;
	background: #fff;
	border-top: 1px solid var(--nv-line);
	box-shadow: 0 -2px 14px rgba(17, 24, 39, .12);
}

.ubq-cmp-bar-inner {
	max-width: 1170px;
	margin: 0 auto;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 16px;
}

.ubq-cmp-bar-items {
	display: flex;
	gap: 10px;
	flex: 1 1 auto;
	overflow-x: auto;
	min-width: 0;
}

.ubq-cmp-bar-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 26px 6px 6px;
	border: 1px solid var(--nv-line);
	border-radius: var(--nv-radius);
	background: var(--nv-bg);
	flex: 0 0 auto;
	max-width: 220px;
}

.ubq-cmp-bar-item img,
.ubq-cmp-bar-ph {
	width: 34px;
	height: 34px;
	object-fit: contain;
	background: #fff;
	border-radius: 2px;
	flex: 0 0 34px;
}

.ubq-cmp-bar-name {
	font-size: 12.5px;
	color: var(--nv-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ubq-cmp-bar-x {
	position: absolute;
	top: 4px;
	right: 6px;
	border: 0;
	background: none;
	color: var(--nv-muted);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 2px;
}
.ubq-cmp-bar-x:hover { color: #d33; }

.ubq-cmp-bar-cta {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.ubq-cmp-clear {
	border: 0;
	background: none;
	color: var(--nv-muted);
	font-size: 13.5px;
	cursor: pointer;
	padding: 8px 4px;
}
.ubq-cmp-clear:hover { color: #d33; }

.ubq-cmp-go {
	display: inline-flex;
	align-items: center;
	height: 42px;
	padding: 0 22px;
	border-radius: var(--nv-radius);
	background: var(--nv-blue);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}
.ubq-cmp-go:hover { background: var(--nv-blue-dark); }

@media (max-width: 600px) {
	.ubq-cmp-bar-inner { padding: 8px 10px; gap: 10px; }
	.ubq-cmp-bar-name { display: none; }
	.ubq-cmp-bar-item { padding: 6px 22px 6px 6px; }
	.ubq-cmp-go { height: 38px; padding: 0 14px; font-size: 13px; }
}

/* ---------- Wishlist / Compare pages ---------- */

.ubq-list-loading,
.ubq-list-empty {
	padding: 48px 20px;
	text-align: center;
	color: var(--nv-muted);
}

.ubq-list-empty p { margin: 0 0 16px; font-size: 15px; }

.ubq-list-empty .button {
	background: var(--nv-blue) !important;
	color: #fff !important;
}

/* ---------- Comparison table ---------- */

/* The table can exceed the viewport with 4 columns, so it scrolls inside its
   own container rather than making the page scroll sideways. */
.ubq-cmp-wrap { overflow-x: auto; margin: 0 0 40px; }

.ubq-cmp-table {
	width: 100%;
	min-width: 620px;
	border-collapse: collapse;
	background: #fff;
}

.ubq-cmp-table th,
.ubq-cmp-table td {
	border: 1px solid var(--nv-line);
	padding: 14px;
	text-align: left;
	vertical-align: middle;
	font-size: 14px;
}

.ubq-cmp-table thead th {
	position: relative;
	vertical-align: top;
	background: var(--nv-bg);
	min-width: 180px;
}

.ubq-cmp-rowhead {
	width: 170px;
	background: var(--nv-bg);
	font-weight: 700;
	color: var(--nv-navy);
	white-space: nowrap;
}

.ubq-cmp-thumb { display: block; margin-bottom: 10px; }
.ubq-cmp-thumb img { width: 100%; height: auto; max-width: 150px; }

.ubq-cmp-name {
	display: block;
	font-weight: 600;
	color: var(--nv-ink) !important;
	line-height: 1.35;
	text-decoration: none;
}
.ubq-cmp-name:hover { color: var(--nv-blue) !important; }

.ubq-cmp-remove {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: none;
	color: var(--nv-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}
.ubq-cmp-remove:hover { color: #d33; }

.ubq-cmp-price .price { font-weight: 700; color: var(--nv-navy); }

.ubq-cmp-table .ubq-stock { margin: 0; font-size: 13px; font-weight: 600; }
.ubq-cmp-table .ubq-stock.is-in { color: var(--nv-green); }
.ubq-cmp-table .ubq-stock.is-out { color: #d33; }

.ubq-cmp-add {
	display: inline-block;
	background: var(--nv-blue) !important;
	color: #fff !important;
	width: 100%;
	text-align: center;
}
.ubq-cmp-add:hover { background: var(--nv-blue-dark) !important; }

/* ---------- Toast ---------- */

.ubq-toast {
	position: fixed;
	left: 50%;
	bottom: 96px;
	z-index: 1000;
	transform: translate(-50%, 12px);
	max-width: min(90vw, 380px);
	padding: 12px 18px;
	border-radius: var(--nv-radius);
	background: var(--nv-navy);
	color: #fff;
	font-size: 13.5px;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 4px 18px rgba(17, 24, 39, .25);
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}

.ubq-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
	.ubq-card-actions,
	.ubq-toast { transition: none; }
}
