/* Product card: the "glass pill" card (Jonas, 25 Nov 2026, from the tile comparison mockup, then tuned by eye).
   Collection grid cards (.shg-pc) and homepage rail cards (.qs-card) share one look:
   - quick add: a small frosted pill at the tile foot, label at the start, price at the end.
     Desktop shows it on hover (and keyboard focus) only; phones have no hover, so it is always there.
     Replaces the A3 button with the Pale Sky circle and the phone round + (3 Nov rule superseded).
   - chips: the same frosted pill; the wishlist heart is the chip's height and on its line (28px desktop, 20px phones).
   - labels 13px on desktop; 10px on phones only (approved exception to the 13px Hebrew minimum, card labels only).
   - tighter grid: 12px between cards, 10px tile to title, 2px title to price.
   Loads last (after tap.css) so it wins over buttons.css, motion.css and roll.css.
   A few !important lines beat roll.css, whose :is() list carries an ID selector. */

.shg-pc, .qs-card {
	--card-glass: var(--ink-70); /* 4.5:1 for Seashell text even over a white basket; 55% fell to 3.3:1 */
	--card-glass-hover: var(--ink);
	--card-blur: blur(6px);
}

/* ---------- grid and spacing ---------- */
.shg-grid { gap: 12px; row-gap: 28px; }
.shg-pc { gap: 2px; }
.shg-pc__t { margin-block-end: 10px; }
.shg-pc__n { font-size: 18px; line-height: 1.3; }
.shg-pc__p { font-size: 14px; color: var(--ink-70); }
.shg-pc__p s { color: var(--ink-55); }

/* ---------- chips ---------- */
.shg-pc__chips, .qs-tile .qs-chips { inset-block-start: 12px; inset-inline-start: 12px; }
.shg-pc__chips .qs-chip, .qs-tile .qs-chips .qs-chip {
	block-size: 28px; padding-inline: 12px; border: 0;
	background: var(--card-glass); color: var(--seashell);
	-webkit-backdrop-filter: var(--card-blur); backdrop-filter: var(--card-blur);
	font-size: 13px;
}
/* The heart is the chip's height, on the same line (12px in from the other corner). */
.shg-pc .shg-wl, .qs-card .shg-wl { inline-size: 28px; block-size: 28px; inset-block-start: 12px; inset-inline-end: 12px; }
.shg-pc .shg-wl svg, .qs-card .shg-wl svg { inline-size: 15px; block-size: 15px; }
.shg-pc .shg-wl::after, .qs-card .shg-wl::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }

/* ---------- quick add pill ---------- */
.qs-card .qs-tile__add { position: absolute; inset-inline: 12px; inset-block-end: 12px; display: block; line-height: 0; }
.shg-pc .shg-pc__add,
.qs-card .qs-tile__add .qs-add {
	display: flex; justify-content: space-between; align-items: center; gap: 6px;
	block-size: 40px; padding-inline: 16px;
	inset-inline: 12px; inset-block-end: 12px;
	border: 0; border-radius: var(--r-pill);
	background: var(--card-glass); color: var(--seashell);
	-webkit-backdrop-filter: var(--card-blur); backdrop-filter: var(--card-blur);
	font-size: 13px; font-weight: 400;
}
/* Rail cards: the holder (.qs-tile__add) is the positioned box; the button fills it and must not be offset itself. */
.qs-card .qs-tile__add .qs-add { inline-size: 100%; inset: auto; position: relative; }
.shg-pc .shg-pc__add .shg-pc__price,
.qs-card .qs-tile__add .qs-add__price { display: inline-flex; gap: 6px; }
/* The price is a .qs-num (left to right), so its own "start" is the left: push it with the page direction instead. */
html[dir="rtl"] :is(.shg-pc .shg-pc__price, .qs-card .qs-add__price) { margin-right: auto; }
html:not([dir="rtl"]) :is(.shg-pc .shg-pc__price, .qs-card .qs-add__price) { margin-left: auto; }
.qs-card .qs-tile__add .qs-add__price s { opacity: .7; }

/* No sky circle, no plus icon at rest; the icon slot only shows the dots (adding) and the check (added). */
.shg-pc .shg-pc__add::before,
.qs-card .qs-tile__add .qs-add::before { display: none; }
.shg-pc .shg-pc__add::after,
.qs-card .qs-tile__add .qs-add::after { display: none; inline-size: 16px; block-size: 16px; margin-inline-start: auto; background: var(--seashell) !important; }
.shg-pc .shg-pc__add:is(.loading, .added)::after,
.qs-card .qs-tile__add .qs-add:is(.loading, .added)::after { display: block; }
.shg-pc .shg-pc__add:is(.loading, .added) .shg-pc__price,
.qs-card .qs-tile__add .qs-add:is(.loading, .added) .qs-add__price { display: none; }
.shg-pc .shg-pc__add.added,
.qs-card .qs-tile__add .qs-add.added { color: var(--seashell); background: var(--card-glass-hover); }

/* No label roll and no Pale Sky sweep on this button. */
.shg-pc .shg-pc__add .shg-roll > span,
.qs-card .qs-tile__add .qs-add .shg-roll > span { transform: none !important; opacity: 1 !important; }
/* roll.js wraps the label and price in one span: let them be flex items of the pill so the price sits at the end. */
.shg-pc .shg-pc__add :is(.shg-roll, .shg-roll > span),
.qs-card .qs-tile__add .qs-add :is(.shg-roll, .shg-roll > span) { display: contents; }
.shg-pc .shg-pc__add .shg-roll::after,
.qs-card .qs-tile__add .qs-add .shg-roll::after { display: none; }

/* Touch screens: always visible. */
.shg-pc .shg-pc__add, .qs-card .qs-tile__add { opacity: 1; transform: none; }

/* Mouse: hidden until the card is hovered or focused; stays while adding and once added. */
@media (hover: hover) and (pointer: fine) {
	.shg-pc .shg-pc__add, .qs-card .qs-tile__add {
		opacity: 0; transform: translateY(6px);
		transition: opacity var(--dur-op) ease-in-out, transform 300ms ease, background-color var(--dur-fill) ease-in-out;
	}
	.shg-pc:hover .shg-pc__add, .shg-pc:focus-within .shg-pc__add, .shg-pc .shg-pc__add:is(.loading, .added),
	.qs-card:hover .qs-tile__add, .qs-card:focus-within .qs-tile__add, .qs-card .qs-tile__add:has(.loading, .added) { opacity: 1; transform: none; }
	.shg-pc .shg-pc__add:hover,
	.qs-card .qs-tile__add .qs-add:hover { background: var(--card-glass-hover) !important; color: var(--seashell) !important; }
}

/* ---------- phones ---------- */
@media (max-width: 749px) {
	.shg-grid { gap: 12px; row-gap: 24px; padding-inline: 16px; }
	.shg-pc__t { margin-block-end: 8px; }
	.shg-pc__n { font-size: 15px; line-height: 1.35; }
	.shg-pc__p { font-size: 14px; }
	.shg-pc__chips, .qs-tile .qs-chips { inset-block-start: 8px; inset-inline-start: 8px; }
	.shg-pc .shg-pc__plus { display: none; }
	.shg-pc .shg-pc__add { display: flex; }
	.shg-pc__chips .qs-chip, .qs-tile .qs-chips .qs-chip { block-size: 20px; padding-inline: 8px; font-size: 10px; }
	.shg-pc .shg-pc__add,
	.qs-card .qs-tile__add .qs-add { block-size: 28px; padding-inline: 10px; font-size: 10px; overflow: visible; }
	.shg-pc .shg-pc__add, .qs-card .qs-tile__add { inset-inline: 6px; inset-block-end: 6px; }
	.qs-card .qs-tile__add .qs-add { inset: auto; }
	/* 44px tap target (tap.css rule) around the 28px pill: an invisible hit area. */
	.shg-pc .shg-pc__add::before,
	.qs-card .qs-tile__add .qs-add::before {
		display: block; content: ""; position: absolute; inset: -8px 0; translate: none;
		inline-size: auto; block-size: auto; border-radius: var(--r-pill); background: none;
	}
	/* The heart is the chip's height (20px), on the same line; 44px tap area kept. */
	.shg-pc .shg-wl, .qs-card .shg-wl { inline-size: 20px; block-size: 20px; inset-block-start: 8px; inset-inline-end: 8px; }
	.shg-pc .shg-wl svg, .qs-card .shg-wl svg { inline-size: 12px; block-size: 12px; }
	.shg-pc .shg-wl::after, .qs-card .shg-wl::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
	.shg-pc .shg-pc__add, .qs-card .qs-tile__add, .qs-card .qs-tile__add .qs-add { transition: none; }
}
