/*
 * Gravipack « Accessoires compatibles » on bag pages (templates/product-addons.php, addons.js). Loaded only where the
 * list renders, without blocking rendering (gp_style_defer()): the list is inside a closed <details>.
 * The product page follows the visitor's scheme (dark by default, light under prefers-color-scheme or the header
 * button), so colours come from the theme tokens
 * --ink, --muted, --line, --accent-ink and --danger, with fallbacks.
 *
 * Layout: a vertical list of bordered rows, 48 px image | name, type, price | « Ajouter » ghost button (46 px).
 * ≤ 400 px: 40 px image, tighter gaps. Names and type lines wrap, never cut; no horizontal scroller.
 * Motion: the busy button fades to .7 (150 ms) and « Ajouté » fades in (200 ms); opacity and translate only,
 * nothing under reduced motion (the theme's global switch also stops them).
 */

.gp-addons {
	--gp-a-line: var(--line, color-mix(in srgb, currentColor 16%, transparent));
	--gp-a-muted: var(--muted, color-mix(in srgb, currentColor 72%, transparent));
}

/* The <details> box, its summary and the title are styled by pdp-critical.css (inlined, first screen): this sheet
   loads without blocking rendering and only styles what shows once the disclosure is open. */
.gp-addons *,
.gp-addons *::before,
.gp-addons *::after {
	box-sizing: inherit;
}

.gp-addons__intro {
	margin: 0 0 10px;
	font-size: .85rem;
	line-height: 1.4;
	color: var(--gp-a-muted);
}

.gp-addons__list {
	display: grid;
	gap: 8px;
	margin: 0 0 .75rem;
	padding: 0;
	list-style: none;
}

.gp-addons__item {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--gp-a-line);
	border-radius: var(--radius-s, 12px);
}

.gp-addons__media {
	display: block;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--bg-2, #121418);
}

.gp-addons__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gp-addons__body {
	display: grid;
	gap: 1px;
	min-width: 0;
	line-height: 1.3;
}

/* The name is its own target: 24 px tall without moving the text. */
.gp-addons__name {
	justify-self: start;
	/* 44 px touch target without moving the lines around it: the list is open by default since the review of 10 Nov 2026 */
	display: inline-flex;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
	margin-block: -10px;
	padding-block: 4px;
	color: inherit;
	font-size: .94rem;
	font-weight: 700;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.gp-addons__name:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.gp-addons__type {
	font-size: .8rem;
	color: var(--gp-a-muted);
	overflow-wrap: anywhere;
}

.gp-addons__price {
	font-size: .88rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.gp-addons__price small {
	font-size: .78rem;
	font-weight: 400;
	color: var(--gp-a-muted);
}

.gp-addons__price del {
	color: var(--gp-a-muted);
	font-weight: 400;
}

.gp-addons__price ins {
	text-decoration: none;
}

.gp-addons__form {
	margin: 0;
}

/* The compact ghost button of the commerce pages (woo.css), 46 px. Two classes, so it wins over .gp-btn whatever the
   print order. Capitals come from small caps rather than text-transform, so the accessible name stays
   « Ajouter Light Pads » (the font has no small caps: Chrome and Safari draw capitals at 70 %). */
.gp-addons .gp-addons__add {
	position: relative; /* containing block of its screen-reader text */
	gap: 0;
	min-width: 44px;
	min-height: 46px;
	margin: 0 0 4px; /* room for the 4 px edge */
	padding: .55em 1em .5em;
	border-radius: 12px;
	font-size: calc(.82rem / .7);
	font-variant-caps: all-small-caps;
	text-transform: none;
	white-space: nowrap;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	cursor: pointer;
	transition: none;
}

.gp-addons .gp-addons__add[aria-busy="true"] {
	opacity: .7;
	cursor: progress;
}

.gp-addons__status {
	margin: 10px 0 0;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.gp-addons__status.is-error {
	color: var(--danger, #b42318);
}

.gp-addons__cart {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.gp-addons__cart:hover {
	text-decoration-thickness: 2px;
}

.gp-addons a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 4px;
}

@media (max-width: 400px) {
	.gp-addons__item {
		grid-template-columns: 40px minmax(0, 1fr) auto;
		gap: 10px;
	}

	.gp-addons__media {
		width: 40px;
		height: 40px;
	}

	.gp-addons .gp-addons__add {
		padding-inline: .8em;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.gp-addons .gp-addons__add {
		transition: opacity 150ms var(--ease-out, cubic-bezier(.16, 1, .3, 1)), translate 150ms var(--ease-out, cubic-bezier(.16, 1, .3, 1));
	}

	.gp-addons__add.is-added .gp-addons__label {
		animation: gp-addons-in 200ms var(--ease-out, cubic-bezier(.16, 1, .3, 1)) both;
	}
}

@keyframes gp-addons-in {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gp-addons .gp-addons__add,
	.gp-addons__add .gp-addons__label {
		transition: none;
		animation: none;
	}

	.gp-addons .gp-addons__add:is(:hover, :active) {
		translate: none;
	}
}
