/* ==========================================================================
   Compare page (/product-compare), 2026-11-15, Claude.
   Markup: inc/compare-page.php (via woocommerce/yith-compare-table.php).
   The cards, toolbar and spec table use css/handheld-selector.css as they
   are (the area is wrapped in .ec-hs); this file only adds what the compare
   page needs on top. Loaded on the compare page only.
   ========================================================================== */

/* YITH's floating "Select at least 2 products / View Compare" bar: not needed
   on the compare page itself (it also miscounted). YITH's script sets an
   inline display, hence !important. */
#yith-woocompare-preview-bar { display: none !important; }

.ec-cmp { margin-bottom: 56px; }

/* Toolbar: Copy link + Clear all on the left, product count on the right. */
.ec-hs .ec-cmp-actions a.ec-hs-btn--ghost,
.ec-hs .ec-cmp-actions a.ec-hs-btn--ghost:hover,
.ec-hs .ec-cmp-actions a.ec-hs-btn--ghost:focus { color: var(--hs-ink); text-decoration: none; }
.ec-cmp-actions__count {
	margin-left: auto; padding: 0 10px;
	font-family: var(--hs-mono); font-size: 11px; font-weight: 500;
	letter-spacing: .14em; text-transform: uppercase; color: var(--hs-muted);
}

/* Remove link on each card, top right. The wrapper carries YITH's
   "compare-list" class only so YITH's own remove handler picks the link up;
   any table styling that class gets elsewhere is reset here. */
.ec-cmp-card .ec-cmp-card__remove {
	position: absolute; top: 10px; right: 10px; z-index: 2;
	display: block; width: auto; margin: 0; padding: 0; border: 0; background: none;
}
.ec-cmp-card .ec-cmp-card__remove .remove { display: block; margin: 0; padding: 0; }
.ec-cmp-card .ec-cmp-card__remove a {
	display: inline-flex; align-items: center; gap: 4px;
	min-height: 32px; padding: 4px 10px; border-radius: 16px;
	background: rgba(255, 255, 255, .85);
	font-family: var(--hs-mono); font-size: 10px; font-weight: 500; line-height: 1;
	letter-spacing: .14em; text-transform: uppercase; color: var(--hs-muted); text-decoration: none;
}
.ec-cmp-card .ec-cmp-card__remove a:hover,
.ec-cmp-card .ec-cmp-card__remove a:focus { background: #fff; color: var(--hs-accent); }
.ec-cmp-card .ec-cmp-card__remove a > span[aria-hidden] { font-size: 15px; line-height: 1; }

.ec-cmp-more { margin: 14px 0 0; font-size: 14px; color: var(--hs-muted); }
.ec-cmp-empty p { margin: 0; }

/* "Not sure it's the one? ... Help me choose" row. Same look as the product
   page row (css/product-single.css .ec-hs-pdp-link, which does not load
   here); copied until the finder modules share one stylesheet. */
.ec-hs-pdp-link {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 14px; background: #f5f5f5; border-radius: 6px;
	color: #333e48; font-size: 12px; line-height: 1.35; text-decoration: none;
	transition: background .15s;
}
.ec-hs-pdp-link:hover,
.ec-hs-pdp-link:focus { background: #efefef; color: #333e48; text-decoration: none; }
.ec-hs-pdp-link__icon {
	flex: 0 0 20px; width: 20px; height: 20px;
	fill: none; stroke: #ce1d76; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ec-hs-pdp-link__text { flex: 1 1 auto; }
.ec-hs-pdp-link__text strong { font-weight: 700; }
.ec-hs-pdp-link__cta {
	flex: 0 0 auto;
	font-family: "DM Mono", ui-monospace, Consolas, monospace; font-size: 11px; font-weight: 500;
	letter-spacing: .14em; text-transform: uppercase; color: #ce1d76; white-space: nowrap;
}
@media (max-width: 479px) {
	.ec-hs-pdp-link { flex-wrap: wrap; }
	.ec-hs-pdp-link__text { flex-basis: calc(100% - 30px); }
	.ec-hs-pdp-link__cta { margin-left: 30px; }
}
.ec-cmp .ec-cmp-finder { margin: 24px 0; }

/* Spec table: sits in the page column, below the first finder row. */
.ec-cmp .ec-hs-compare--page { max-width: none; margin: 40px 0 0; }

/* Related products: one row of compact cards, the summary cards' look
   (grey panel, image, label, name, price + stock), 2 across on phones,
   4 from tablet up. */
.ec-cmp-related { margin-top: 48px; }
.ec-hs .ec-cmp__title,
.ec-hs .ec-hs-compare--page .ec-hs-compare__title { margin: 0 0 22px; font-size: 32px; line-height: 1.05; letter-spacing: .01em; }
.ec-cmp-related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ec-cmp-mini {
	display: grid; grid-template-rows: auto 1fr auto;
	padding: 12px; background: var(--hs-panel); border-radius: var(--hs-radius);
}
.ec-cmp-mini__img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; margin: -12px -12px 8px; overflow: hidden; border-radius: var(--hs-radius) var(--hs-radius) 0 0; }
.ec-cmp-mini__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.ec-cmp-mini__img.is-cutout img { padding: 8%; mix-blend-mode: normal; }
.ec-cmp-mini__body { min-width: 0; }
.ec-hs .ec-cmp-mini .ec-hs-card__name,
.ec-hs .ec-cmp-mini .ec-hs-card__name a { font-size: 14px; }
.ec-cmp-mini .ec-hs-card__price { font-size: 15px; }
.ec-cmp-mini__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #dcdcdf; }
.ec-hs .ec-cmp-mini__actions a {
	display: inline-flex; align-items: center; gap: 5px; min-height: 32px;
	font-family: var(--hs-mono); font-size: 10px; font-weight: 500; line-height: 1.2;
	letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
}
.ec-hs .ec-cmp-mini__actions .ec-hs-ico { width: 15px; height: 15px; }
.ec-hs .ec-cmp-mini__add { color: var(--hs-ink); }
.ec-hs .ec-cmp-mini__see { margin-left: auto; color: var(--hs-accent); }
.ec-hs .ec-cmp-mini__actions a:hover,
.ec-hs .ec-cmp-mini__actions a:focus { color: var(--hs-accent-dim); text-decoration: underline; text-underline-offset: 3px; }
/* YITH greys out compare links once the 3-product limit is reached. */
.ec-hs .ec-cmp-mini__add.disabled { opacity: .45; pointer-events: none; }
@media (min-width: 640px) {
	.ec-cmp-related__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Off-screen buffer for the Copy link fallback (js/compare-page.js). */
.ec-cmp-copybuf { position: absolute; left: -9999px; top: 0; }

@media (min-width: 640px) {
	.ec-hs .ec-cmp__title,
	.ec-hs .ec-hs-compare--page .ec-hs-compare__title { font-size: 38px; }
}
@media (min-width: 960px) {
	.ec-cmp-cards[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
