/* HCC Compare – frontend */
:root {
	--hcc-navy: #1f3f66;
	--hcc-navy-2: #2b5486;
	--hcc-red: #b5122b;
	--hcc-ink: #1d2733;
	--hcc-muted: #6b7785;
	--hcc-line: #e3e8ee;
	--hcc-soft: #f4f7fa;
	--hcc-best: #1b7a3d;
	--hcc-best-bg: #e6f5ec;
	--hcc-worst: #b42318;
	--hcc-worst-bg: #fdeeee;
	--hcc-radius: 12px;
	--hcc-label-w: 230px;
	--hcc-col-w: 230px;
}

/* ---------- compare button ---------- */
.hcc-compare-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0;
	padding: 9px 16px;
	border: 1.5px solid var(--hcc-navy);
	border-radius: 999px;
	background: #fff;
	color: var(--hcc-navy);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background .15s, color .15s, box-shadow .15s;
}
.hcc-compare-btn:hover { background: var(--hcc-soft); color: var(--hcc-navy); }
.hcc-compare-btn:focus-visible { outline: 3px solid rgba(31, 63, 102, .35); outline-offset: 2px; }
.hcc-compare-btn.is-active { background: var(--hcc-navy); color: #fff; }
.hcc-compare-btn__icon {
	width: 18px; height: 18px; flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M17 4v16M3 8l4-4 4 4M13 16l4 4 4-4'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M17 4v16M3 8l4-4 4 4M13 16l4 4 4-4'/%3E%3C/svg%3E") center/contain no-repeat;
}
.hcc-compare-btn.is-active .hcc-compare-btn__icon {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}
/* Theme styles every button inside form.cart – win back our look. */
button.hcc-compare-btn.hcc-compare-btn--single,
form.cart button.hcc-compare-btn {
	display: inline-flex !important; width: auto !important; height: auto !important; min-height: 0 !important;
	margin: 12px 0 0 !important; padding: 10px 18px !important;
	border: 1.5px solid var(--hcc-navy) !important; border-radius: 999px !important;
	background: #fff !important; color: var(--hcc-navy) !important;
	font-size: 14px !important; font-weight: 600 !important; line-height: 1.2 !important;
	text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; float: none !important;
}
button.hcc-compare-btn.hcc-compare-btn--single:hover, form.cart button.hcc-compare-btn:hover { background: var(--hcc-soft) !important; }
button.hcc-compare-btn.hcc-compare-btn--single.is-active, form.cart button.hcc-compare-btn.is-active { background: var(--hcc-navy) !important; color: #fff !important; }
form.cart button.hcc-compare-btn { flex-basis: 100%; }
.hcc-compare-btn--loop { margin: 8px auto 0; padding: 6px 12px; font-size: 13px; }
.hcc-compare-btn--loop .hcc-compare-btn__icon { width: 15px; height: 15px; }
li.product .hcc-compare-btn--loop, .product .hcc-compare-btn--loop { display: flex; width: max-content; }

/* ---------- toast ---------- */
.hcc-toast {
	position: fixed; z-index: 99999; left: 50%; bottom: 24px;
	display: flex; align-items: center; gap: 14px;
	max-width: calc(100vw - 32px);
	padding: 12px 14px 12px 18px;
	border-radius: 12px;
	background: var(--hcc-ink); color: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
	font-size: 14px; line-height: 1.35;
	transform: translate(-50%, 140%); opacity: 0;
	transition: transform .25s ease, opacity .25s ease;
}
.hcc-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.hcc-toast--error { background: var(--hcc-worst); }
.hcc-toast__link {
	flex: none; padding: 7px 12px; border-radius: 8px;
	background: #fff; color: var(--hcc-navy) !important; font-weight: 600; text-decoration: none !important;
	white-space: nowrap;
}
.hcc-toast__close { flex: none; border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; padding: 0 2px; }
.hcc-toast__close:hover { opacity: 1; }

/* ---------- shared buttons ---------- */
.hcc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 10px 18px; border-radius: 8px; border: 1.5px solid transparent;
	font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: none !important; cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}
.hcc-btn--primary { background: var(--hcc-red); color: #fff !important; }
.hcc-btn--primary:hover { background: #930e22; }
.hcc-btn--ghost { background: #fff; border-color: var(--hcc-line); color: var(--hcc-navy) !important; }
.hcc-btn--ghost:hover { border-color: var(--hcc-navy); }
.hcc-btn--link { background: none; color: var(--hcc-muted); padding: 10px 6px; text-decoration: underline !important; }
.hcc-btn--link:hover { color: var(--hcc-worst); }
.hcc-btn--sm { padding: 7px 12px; font-size: 13px; }

/* ---------- compare page ---------- */
.hcc-compare-app { color: var(--hcc-ink); margin: 0 0 48px; }
.hcc-compare-loading { color: var(--hcc-muted); padding: 40px 0; text-align: center; }
.hcc-cmp { position: relative; }

.hcc-cmp__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.hcc-cmp__title { margin: 0 !important; font-size: 28px; color: var(--hcc-navy); }
.hcc-cmp__title span { color: var(--hcc-muted); font-weight: 400; font-size: .7em; }
.hcc-cmp__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.hcc-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--hcc-navy); margin: 0 6px 0 0; user-select: none; }
.hcc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hcc-switch__track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #c9d2dc; transition: background .15s; }
.hcc-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.hcc-switch input:checked + .hcc-switch__track { background: var(--hcc-navy); }
.hcc-switch input:checked + .hcc-switch__track::after { transform: translateX(16px); }
.hcc-switch input:focus-visible + .hcc-switch__track { outline: 3px solid rgba(31, 63, 102, .35); outline-offset: 2px; }

.hcc-cmp-note { padding: 12px 16px; margin-bottom: 16px; border-radius: 10px; background: #fff7e6; color: #7a5300; font-size: 14px; }

/* summary */
.hcc-cmp__summary { display: grid; grid-template-columns: repeat(var(--hcc-cols), minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.hcc-sum { position: relative; padding: 16px; border: 1px solid var(--hcc-line); border-radius: var(--hcc-radius); background: #fff; }
.hcc-sum.is-top { border-color: var(--hcc-best); box-shadow: 0 0 0 1px var(--hcc-best) inset, 0 8px 24px rgba(27, 122, 61, .10); }
.hcc-sum__crown { position: absolute; top: -11px; left: 14px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--hcc-best); color: #fff; font-size: 12px; font-weight: 700; }
.hcc-sum__crown svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.hcc-sum__head { display: flex; gap: 12px; align-items: center; min-height: 56px; }
.hcc-sum__head img { width: 56px; height: 56px; object-fit: contain; flex: none; border-radius: 8px; background: var(--hcc-soft); }
.hcc-sum__brand { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--hcc-muted); font-weight: 700; }
.hcc-sum__name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hcc-sum__meter { height: 8px; margin: 14px 0 6px; border-radius: 999px; background: var(--hcc-soft); overflow: hidden; }
.hcc-sum__meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hcc-navy-2), var(--hcc-best)); transition: width .5s ease; }
.hcc-sum__wins { font-size: 13px; color: var(--hcc-muted); }
.hcc-sum__wins b { color: var(--hcc-ink); font-size: 16px; }
.hcc-sum__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hcc-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: var(--hcc-soft); color: var(--hcc-navy); font-size: 12px; font-weight: 600; }
.hcc-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hcc-badge--efficiency { background: #e6f5ec; color: #1b7a3d; }
.hcc-badge--quiet { background: #eef1fb; color: #3245a0; }
.hcc-badge--cold { background: #e7f4fb; color: #0f6a94; }
.hcc-badge--price { background: #fdeef0; color: var(--hcc-red); }

.hcc-cmp__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; color: var(--hcc-muted); }
.hcc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.hcc-dot--best { background: var(--hcc-best-bg); border: 1px solid var(--hcc-best); }
.hcc-dot--worst { background: var(--hcc-worst-bg); border: 1px solid var(--hcc-worst); }

/* table */
.hcc-cmp__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--hcc-line); border-radius: var(--hcc-radius); background: #fff; }
.hcc-cmp__table { width: 100%; min-width: calc(var(--hcc-label-w) + var(--hcc-cols) * var(--hcc-col-w)); table-layout: fixed; border-collapse: separate; border-spacing: 0; margin: 0 !important; font-size: 14px; }
.hcc-cmp__table col.hcc-col-label { width: var(--hcc-label-w); }
.hcc-cmp__table th, .hcc-cmp__table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--hcc-line); text-align: center; vertical-align: middle; background: #fff; }
.hcc-cmp__table tbody tr:last-child > * { border-bottom: 0; }
.hcc-cmp__table tbody th.hcc-lbl, .hcc-cmp__corner {
	position: sticky; left: 0; z-index: 2;
	text-align: left; font-weight: 600; color: var(--hcc-ink);
	background: var(--hcc-soft) !important;
	border-right: 1px solid var(--hcc-line);
}
.hcc-cmp__corner { z-index: 3; }

.hcc-prod { position: relative; padding: 18px 14px 16px !important; vertical-align: top !important; }
.hcc-prod.is-top { box-shadow: inset 0 3px 0 var(--hcc-best); }
.hcc-prod__remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--hcc-line); background: #fff; color: var(--hcc-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.hcc-prod__remove:hover { color: var(--hcc-worst); border-color: var(--hcc-worst); }
.hcc-prod__img { display: block; margin: 0 auto 10px; }
.hcc-prod__img img { width: 140px; height: 140px; object-fit: contain; margin: 0 auto; }
.hcc-prod__brand { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--hcc-muted); font-weight: 700; }
.hcc-prod__name { display: block; margin: 2px 0 8px; color: var(--hcc-navy) !important; font-weight: 700; font-size: 15px; line-height: 1.3; text-decoration: none !important; }
.hcc-prod__name:hover { text-decoration: underline !important; }
.hcc-prod__price { font-size: 18px; font-weight: 700; color: var(--hcc-red); margin-bottom: 12px; }
.hcc-prod__price del { color: var(--hcc-muted); font-weight: 400; font-size: 14px; margin-right: 4px; }
.hcc-prod__price ins { text-decoration: none; }
.hcc-prod__actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

.hcc-grp th { padding: 10px 14px !important; text-align: left !important; background: var(--hcc-navy) !important; color: #fff !important; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hcc-grp th span { position: sticky; left: 14px; }

.hcc-lbl .hcc-dir { display: inline-flex; margin-left: 6px; vertical-align: middle; color: var(--hcc-muted); }
.hcc-dir svg, .hcc-tag svg { width: 10px; height: 10px; fill: currentColor; }

.hcc-cmp__table td { position: relative; color: var(--hcc-ink); }
.hcc-cmp__table td.is-best { background: var(--hcc-best-bg); color: var(--hcc-best); font-weight: 700; }
.hcc-cmp__table td.is-worst { background: var(--hcc-worst-bg); color: var(--hcc-worst); }
.hcc-tag { display: inline-flex; margin-left: 6px; vertical-align: middle; }
.hcc-na { color: #b4bcc6; }
.hcc-cmp__table tr.is-same td { color: var(--hcc-muted); }
.hcc-cmp__table tbody tr:not(.hcc-grp):hover td { filter: brightness(.98); }

/* sticky mini header */
.hcc-cmp__sticky { position: fixed; top: 0; z-index: 9990; display: none; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .10); border-bottom: 1px solid var(--hcc-line); }
.hcc-cmp__sticky.is-visible { display: block; }
.admin-bar .hcc-cmp__sticky { top: 32px; }
.hcc-cmp__sticky-inner { overflow: hidden; }
.hcc-cmp__table--mini th { padding: 8px 10px !important; border-bottom: 0 !important; font-size: 13px; }
.hcc-cmp__table--mini th:not(.hcc-cmp__corner) { display: table-cell; }
.hcc-cmp__table--mini img { width: 36px; height: 36px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.hcc-cmp__table--mini span { display: inline-block; max-width: calc(100% - 48px); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--hcc-navy); }
.hcc-cmp__table--mini b { display: block; color: var(--hcc-red); }

/* empty */
.hcc-cmp-empty { padding: 56px 20px; text-align: center; border: 1px dashed #c9d2dc; border-radius: var(--hcc-radius); background: var(--hcc-soft); }
.hcc-cmp-empty__icon svg { width: 48px; height: 48px; fill: none; stroke: var(--hcc-navy); stroke-width: 1.6; }
.hcc-cmp-empty__title { margin: 12px 0 4px !important; font-size: 20px; font-weight: 700; color: var(--hcc-navy); }
.hcc-cmp-empty__hint { margin: 0 0 20px !important; color: var(--hcc-muted); }

@media (max-width: 900px) {
	.hcc-cmp__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	:root { --hcc-label-w: 120px; --hcc-col-w: 168px; }
	.hcc-cmp__title { font-size: 22px; }
	.hcc-cmp__summary { grid-template-columns: 1fr; }
	.hcc-cmp__table { font-size: 13px; }
	.hcc-cmp__table th, .hcc-cmp__table td { padding: 10px 8px; }
	.hcc-prod__img img { width: 96px; height: 96px; }
	.hcc-prod__name { font-size: 13px; }
	.hcc-prod__price { font-size: 16px; }
	.hcc-toast { bottom: 12px; font-size: 13px; }
	.admin-bar .hcc-cmp__sticky { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.hcc-toast, .hcc-sum__meter span, .hcc-compare-btn { transition: none; }
}
