/**
 * HostingTags — Compare Cart Styles
 *
 * @package HostingTags
 * @since   4.0.0
 */

/* ── Add to Compare Button (on single posts) ── */
.ht-add-compare {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	margin: 20px 0;
	background: var(--ht-gray-50, #f9fafb);
	color: var(--ht-gray-700, #374151);
	border: 1px solid var(--ht-gray-200, #e5e7eb);
	border-radius: var(--ht-radius, 10px);
	cursor: pointer;
	font-weight: 600;
	font-family: inherit;
	font-size: inherit;
	transition: all var(--ht-transition, .2s ease);
}

.ht-add-compare:hover {
	border-color: var(--ht-primary, #124187);
	color: var(--ht-primary, #124187);
	background: var(--ht-primary-lighter, #eff6ff);
}

.ht-add-compare--active {
	background: var(--ht-primary, #124187);
	color: #fff;
	border-color: var(--ht-primary, #124187);
}

.ht-add-compare--active:hover {
	background: var(--ht-primary-dark, #0f3470);
	color: #fff;
}

.ht-add-compare svg {
	flex-shrink: 0;
}

/* ── Floating Compare Bar ── */
.ht-compare-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9998;
	background: var(--ht-gray-900, #111827);
	border-top: 1px solid var(--ht-gray-700, #374151);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
	animation: htCompareSlideUp 0.3s ease both;
}

@keyframes htCompareSlideUp {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

.ht-compare-bar__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 12px 20px;
}

/* Items Row */
.ht-compare-bar__items {
	display: flex;
	gap: 10px;
	flex: 1;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ht-compare-bar__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: var(--ht-gray-800, #1f2937);
	border: 1px solid var(--ht-gray-700, #374151);
	border-radius: var(--ht-radius-sm, 6px);
	white-space: nowrap;
	flex-shrink: 0;
}

.ht-compare-bar__item--empty {
	border-style: dashed;
	border-color: var(--ht-gray-600, #4b5563);
	color: var(--ht-gray-600, #4b5563);
	min-width: 60px;
	justify-content: center;
}

.ht-compare-bar__logo {
	width: 32px;
	height: 32px;
	border-radius: var(--ht-radius-sm, 6px);
	object-fit: contain;
	background: #fff;
	padding: 2px;
}

.ht-compare-bar__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: var(--ht-primary, #124187);
	color: #fff;
	border-radius: var(--ht-radius-sm, 6px);
	font-weight: 700;
}

.ht-compare-bar__name {
	color: var(--ht-gray-200, #e5e7eb);
	font-weight: 500;
}

.ht-compare-bar__remove {
	background: none;
	border: none;
	color: var(--ht-gray-500, #6b7280);
	cursor: pointer;
	padding: 0 4px;
	font-family: inherit;
	font-size: calc(var(--ht-body-size, 14px) * 1.29);
	line-height: 1;
	transition: color var(--ht-transition, .2s ease);
}

.ht-compare-bar__remove:hover {
	color: var(--ht-danger, #dc2626);
}

/* Actions */
.ht-compare-bar__actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.ht-compare-bar__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border: none;
	border-radius: var(--ht-radius-sm, 6px);
	font-weight: 600;
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
	transition: all var(--ht-transition, .2s ease);
	white-space: nowrap;
}

.ht-compare-bar__btn--go {
	background: linear-gradient(135deg, var(--ht-primary, #124187), var(--ht-primary-dark, #0f3470));
	color: #fff;
	box-shadow: 0 2px 8px rgba(var(--ht-primary-rgb, 18, 65, 135), 0.3);
}

.ht-compare-bar__btn--go:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(var(--ht-primary-rgb, 18, 65, 135), 0.4);
}

.ht-compare-bar__btn--go:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ht-compare-bar__btn--clear {
	background: var(--ht-gray-700, #374151);
	color: var(--ht-gray-400, #9ca3af);
	padding: 10px;
}

.ht-compare-bar__btn--clear:hover {
	background: var(--ht-danger, #dc2626);
	color: #fff;
}

/* ── Responsive ── */
@media (max-width: 768px) {
	.ht-compare-bar__inner {
		padding: 10px 12px;
		gap: 10px;
	}

	.ht-compare-bar__name {
		display: none;
	}

	.ht-compare-bar__btn--go span {
		display: none;
	}

	.ht-compare-bar__btn--go {
		padding: 10px;
	}
}

/* ── RTL ── */
[dir="rtl"] .ht-compare-bar__items {
	direction: rtl;
}
