/*
 * Gravipack commerce components: free-shipping bar, gift cue and picker, preorder card badge, reassurance box,
 * staging test payment, the delivery lines of the cart, checkout and drawer (D4), and the drawer's applied-code rows.
 * The checkout upsell's own rules are in upsell.css (it keeps the shared tokens below); the product page preorder box
 * is in pdp-critical.css.
 * Render-blocking on the cart and the checkout only (shipping-bar.php); elsewhere it styles the closed drawer and
 * loads without blocking rendering (gp_style_defer()).
 * Works on the light "paper" view (cart, checkout) and the dark view (product, drawer): colours come from
 * currentColor and the theme tokens, with fallbacks so the components stay usable while the theme changes.
 */

.gp-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* .gp-cmp: add it to the root of any new commerce component to get these tokens, box-sizing and focus ring. */
:where(.gp-shipbar, .gp-giftbox, .gp-upsell, .gp-reassure, .gp-testpay, .gp-cmp) {
	--gp-c-line: color-mix(in srgb, currentColor 16%, transparent);
	--gp-c-soft: color-mix(in srgb, currentColor 6%, transparent);
	--gp-c-muted: color-mix(in srgb, currentColor 72%, transparent);
	box-sizing: border-box;
	font-family: var(--font-body, inherit);
}

:where(.gp-shipbar, .gp-giftbox, .gp-upsell, .gp-reassure, .gp-cmp) *,
:where(.gp-shipbar, .gp-giftbox, .gp-upsell, .gp-reassure, .gp-cmp) *::before,
:where(.gp-shipbar, .gp-giftbox, .gp-upsell, .gp-reassure, .gp-cmp) *::after {
	box-sizing: inherit;
}

/* .gp-btn keeps the theme's accent ring: its currentColor is its own text, white on a dark button over a white box. */
:where(.gp-giftbox, .gp-upsell, .gp-reassure, .gp-cmp) :is(a, button):not(.gp-btn):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

:where(.gp-giftbox__title, .gp-upsell__title):focus {
	outline: none;
}

:where(.gp-giftbox__title, .gp-upsell__title):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* ---------- Free-shipping bar ---------- */

.gp-shipbar {
	margin: 0 0 1rem;
	padding: .75rem 1rem .85rem;
	border: 1px solid var(--gp-c-line);
	border-radius: var(--radius-s, 12px);
	background: var(--gp-c-soft);
}

.gp-shipbar[hidden] {
	display: none;
}

.gp-shipbar__text {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: 0 0 .55rem;
	font-size: .95rem;
	line-height: 1.4;
}

.gp-shipbar__icon {
	flex: none;
}

.gp-shipbar__track {
	position: relative;
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--gp-c-line);
}

.gp-shipbar__fill {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: currentColor;
	transform: scaleX(var(--gp-progress, 0));
	transform-origin: left center;
}

/* The bar follows its surface, not the page: ink on paper (cart, checkout, and the drawer even when it opens
   over a dark page), the accent only on a dark surface. light-dark() reads the color-scheme the paper scope sets.
   Reached: same fill, plus the inset ring below. */
.gp-shipbar__fill {
	background: var(--ink, currentColor);
	background: light-dark(var(--ink, currentColor), var(--accent, #d4ff3a));
}

.gp-shipbar.is-reached .gp-shipbar__track {
	box-shadow: inset 0 0 0 1px currentColor;
}

.gp-shipbar--drawer {
	margin: 12px 24px 0; /* same 24 px inset as the drawer's items, total and buttons (main.css) */
	padding: .6rem .8rem .7rem;
}

.gp-shipbar--drawer .gp-shipbar__text {
	font-size: .875rem;
}

.gp-shipbar--checkout {
	margin-bottom: .75rem;
}

/* Under the bar's text in a cart holding a preorder: which items can still complete it (shipping-bar.php). */
.gp-shipbar__note {
	display: block;
	margin-top: .2rem;
	font-size: .9em;
	color: var(--gp-c-muted);
}

/* ---------- Gift cue (drawer, top of the cart): the bar's surface, one line of text and a link ---------- */

.gp-giftcue {
	container-type: inline-size;
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr) auto;
	align-items: center;
	gap: .5rem;
	margin: 0 0 1rem;
	padding: .6rem .8rem;
	border: 1px solid var(--gp-c-line);
	border-radius: var(--radius-s, 12px);
	background: var(--gp-c-soft);
	font-size: .95rem;
	line-height: 1.4;
}

.gp-giftcue[hidden] {
	display: none;
}

.gp-giftcue--drawer {
	margin: 8px 24px 0; /* the shipping bar's 24 px inset */
	font-size: .875rem;
}

.gp-giftcue__icon {
	flex: none;
	align-self: start;
	margin-top: calc((1.4em - 18px) / 2); /* centred on the first line of text */
}

.gp-giftcue__text {
	margin: 0;
	text-wrap: pretty;
}

/* 44 px to tap; the negative margins keep the line as tall as the text. */
.gp-giftcue__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-block: -10px;
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.gp-giftcue .gp-giftcue__link:focus-visible {
	outline: 2px solid var(--accent-ink, currentColor);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Narrow (the drawer, phones): the link goes under the text. */
@container (max-width: 34rem) {
	.gp-giftcue__text,
	.gp-giftcue__link {
		grid-column: 2 / -1;
		justify-self: start;
	}
}

/* ---------- Gift picker ---------- */

.gp-giftbox {
	margin: 1.25rem 0;
	padding: 1rem;
	border: 1px solid var(--gp-c-line);
	border-radius: var(--radius-s, 12px);
}

.gp-giftbox[hidden] {
	display: none;
}

.gp-giftbox__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: .25rem 1rem;
	margin-bottom: .5rem;
}

.gp-giftbox__title {
	margin: 0;
	font-family: var(--font-display, inherit);
	font-size: 1.15rem;
	line-height: 1.2;
}

.gp-giftbox__counter {
	margin: 0;
	padding: .15rem .6rem;
	border-radius: 999px;
	background: var(--gp-c-soft);
	font-size: .875rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.gp-giftbox__intro,
.gp-giftbox__note {
	margin: 0 0 .75rem;
	font-size: .925rem;
	color: var(--gp-c-muted);
}

/* Every gift chosen: « Vos accessoires offerts : … » */
.gp-giftbox__summary {
	margin: 0 0 .5rem;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.4;
}

/* « Conditions de l’offre » and « Modifier mon choix »: native disclosures, 44 px toggles, the global focus ring. */
.gp-giftbox__terms,
.gp-giftbox__edit {
	margin: 0 0 .5rem;
	border-top: 1px solid var(--gp-c-line);
}

.gp-giftbox__terms-toggle,
.gp-giftbox__edit-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	min-height: 44px;
	padding: .5rem 0;
	font-size: .925rem;
	font-weight: 600;
	line-height: 1.3;
	list-style: none;
	cursor: pointer;
}

.gp-giftbox__terms-toggle::-webkit-details-marker,
.gp-giftbox__edit-toggle::-webkit-details-marker {
	display: none;
}

.gp-giftbox__terms-toggle::after,
.gp-giftbox__edit-toggle::after {
	content: "";
	flex: none;
	width: 12px;
	height: 8px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%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 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.gp-giftbox__terms[open] > .gp-giftbox__terms-toggle::after,
.gp-giftbox__edit[open] > .gp-giftbox__edit-toggle::after {
	transform: rotate(180deg);
}

.gp-giftbox__terms-body {
	padding: 0 0 .75rem;
	font-size: .875rem;
	line-height: 1.45;
	color: var(--gp-c-muted);
}

.gp-giftbox__terms-body p {
	max-width: 70ch;
	margin: 0 0 .4rem;
}

.gp-giftbox__terms-body p:last-child {
	margin-bottom: 0;
}

.gp-giftbox__edit[open] > .gp-giftbox__edit-toggle {
	margin-bottom: .25rem;
}

.gp-giftbox__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: .5rem;
	margin: 0 0 .5rem;
	padding: 0;
	list-style: none;
}

.gp-giftbox__item {
	position: relative; /* the hidden label's containing block, so it never reaches past a scrolling list */
	display: grid;
	grid-template-columns: 56px 1fr;
	align-items: center;
	gap: .75rem;
	margin: 0;
	padding: .5rem;
	border: 1px solid var(--gp-c-line);
	border-radius: var(--radius-s, 12px);
}

.gp-giftbox__item.is-chosen {
	border-color: currentColor;
	box-shadow: inset 0 0 0 1px currentColor;
}

.gp-giftbox__media {
	display: block;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--paper-2, #ebe9e1);
}

/* Photo over two rows, name and price, then the button under them (beside them it left 4 letters of the name visible). */
.gp-giftbox__item > .gp-giftbox__media {
	grid-row: span 2;
	align-self: start;
}

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

.gp-giftbox__body {
	display: flex;
	flex-direction: column;
	gap: .15rem;
	min-width: 0;
}

.gp-giftbox__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.gp-giftbox__price {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem;
	font-size: .825rem;
	color: var(--gp-c-muted);
}

.gp-giftbox__badge,
.gp-gift-price {
	display: inline-block;
	padding: .05rem .5rem;
	border-radius: 999px;
	background: var(--accent, #d4ff3a);
	color: var(--on-accent, #0a0b0d);
	box-shadow: inset 0 0 0 1.5px var(--accent-rim, transparent); /* Pro cream on paper: olive rim (G1) */
	font-size: .8rem;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap; /* « Offert » once per line, never split */
}

.gp-giftbox__btn {
	grid-column: 2;
	justify-self: start;
	min-width: 44px;
	min-height: 44px;
	padding-inline: .9rem;
	white-space: nowrap;
}

.gp-giftbox__btn[disabled] {
	cursor: not-allowed;
	opacity: .45;
}

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

.gp-giftbox__status {
	min-height: 1.4em;
	margin: 0;
	font-size: .875rem;
	font-weight: 600;
}

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

.gp-giftbox__status:empty {
	min-height: 0;
}

.gp-gift-qty {
	display: inline-block;
	min-width: 2ch;
	text-align: center;
}

/* Every accessory of the shop: family and colours under the name, a search box and a « Famille » filter (commerce.js). */
.gp-giftbox__meta {
	display: -webkit-box;
	overflow: hidden;
	font-size: .8rem;
	line-height: 1.3;
	color: var(--gp-c-muted);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.gp-giftbox__item[hidden],
.gp-giftbox__tools[hidden],
.gp-giftbox__empty[hidden],
.gp-giftbox__more[hidden] {
	display: none;
}

.gp-giftbox__tools {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 14rem);
	align-items: end;
	gap: .5rem .75rem;
	margin: 0 0 .75rem;
}

.gp-giftbox__field {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	min-width: 0;
}

.gp-giftbox__field--search:only-of-type {
	grid-column: 1 / -1;
}

.gp-giftbox__label {
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.3;
}

/* The theme styles both fields on the cart and checkout (input.input-text, select); 44 px high, 16 px text (no zoom on iOS). */
.gp-giftbox .gp-giftbox__input,
.gp-giftbox .gp-giftbox__select {
	width: 100%;
	min-height: 44px;
	font-size: 1rem;
}

.gp-giftbox__found {
	grid-column: 1 / -1;
	margin: 0;
	font-size: .875rem;
	color: var(--gp-c-muted);
	font-variant-numeric: tabular-nums;
}

.gp-giftbox__empty {
	margin: 0 0 .75rem;
	font-size: .925rem;
}

.gp-giftbox__reset {
	min-height: 44px;
	padding: 0 .25rem;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.gp-giftbox__more {
	display: flex;
	width: 100%;
	min-height: 44px;
	margin: 0 0 .5rem;
	justify-content: center;
}

@media (max-width: 480px) {
	.gp-giftbox__tools {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The product page preorder box is styled by pdp-critical.css (inlined on product pages, first screen). */

.gp-badge--preorder {
	display: inline-block;
	padding: .1rem .55rem;
	border-radius: 999px;
	background: var(--accent, #d4ff3a);
	color: var(--on-accent, #0a0b0d);
	box-shadow: inset 0 0 0 1.5px var(--accent-rim, transparent); /* Pro cream on a light surface: olive rim (G1) */
	font-size: .75rem;
	font-weight: 700;
	line-height: 1.6;
}

/* Small screens: one gift per row. */
@media (max-width: 640px) {
	.gp-giftbox__list {
		grid-template-columns: 1fr;
	}
}

/* ---------- Reassurance (under the order button) ---------- */

.gp-reassure {
	margin: 1rem 0 0;
	padding: .9rem 1rem;
	border: 1px solid var(--gp-c-line);
	border-radius: var(--radius-s, 12px);
	background: var(--gp-c-soft);
	text-align: start;
}

.gp-reassure__title {
	margin: 0 0 .5rem;
	font-family: var(--font-display, inherit);
	font-size: .95rem;
	font-weight: 700;
}

.gp-reassure__list {
	display: grid;
	gap: .4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-reassure__item {
	display: grid;
	grid-template-columns: 16px 1fr;
	gap: .5rem;
	align-items: start;
	margin: 0;
	font-size: .875rem;
	line-height: 1.4;
}

.gp-reassure__icon {
	margin-top: .15em;
}

.gp-reassure__item a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.gp-reassure__sub {
	display: block;
	color: var(--gp-c-muted);
	font-size: .8rem;
}

/* ---------- Staging test payment ---------- */

.gp-testpay {
	margin: .5rem 0 0;
	padding: .5rem .75rem;
	border: 1px dashed currentColor;
	border-radius: 8px;
}

.gp-testpay__legend {
	padding: 0 .25rem;
	font-weight: 700;
}

.gp-testpay__option {
	display: flex;
	align-items: center;
	gap: .5rem;
	min-height: 44px;
}

.gp-testpay__option input {
	width: 20px;
	height: 20px;
	margin: 0;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
	.gp-shipbar__fill {
		transition: transform 400ms var(--ease-out, cubic-bezier(.16, 1, .3, 1));
	}

	.gp-giftbox__btn {
		transition: opacity 150ms var(--ease-out, cubic-bezier(.16, 1, .3, 1));
	}

	.gp-giftbox__terms-toggle::after,
	.gp-giftbox__edit-toggle::after {
		transition: transform 200ms var(--ease-out, cubic-bezier(.16, 1, .3, 1));
	}
}

/* ---------- Cart and checkout (D4): second line of each shipping option, note rows ---------- */

.gp-ship-eta {
	display: block;
	margin-top: .15rem;
	font-size: .875rem;
	font-weight: 400;
	line-height: 1.4;
	color: color-mix(in srgb, currentColor 80%, transparent);
	white-space: normal;
}

.gp-ship-note small {
	display: block;
	font-size: .85rem;
	line-height: 1.4;
	color: color-mix(in srgb, currentColor 80%, transparent);
}

/* ---------- Drawer (D4): one cost line under the subtotal ---------- */

.gp-drawer-ship {
	margin: .25rem 0 .75rem;
	padding-inline: 24px; /* the drawer's inset, like the subtotal above it (main.css .woocommerce-mini-cart__total) */
	font-size: .875rem;
	line-height: 1.4;
	font-variant-numeric: tabular-nums;
	color: var(--ink-2, color-mix(in srgb, currentColor 80%, transparent));
}

.gp-drawer-ship strong {
	font-weight: 600;
	color: var(--ink, inherit);
}

.gp-drawer-ship[hidden] {
	display: none;
}

/* ---------- Drawer: applied codes and the amount after discount, under the subtotal (shipping-bar.php) ---------- */

.gp-drawer-discount {
	padding: 0 24px 8px; /* the 24 px inset of the subtotal row above it (main.css) */
	line-height: 1.35;
}

.gp-drawer-discount p {
	margin: 0;
}

/* Label on the left; the amount and its « (TTC) » / « (HT) » together on the right, as in the subtotal row. */
.gp-drawer-discount__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 6px;
}

.gp-drawer-discount__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.gp-drawer-discount__amount {
	margin-left: auto;
	white-space: nowrap;
}

.gp-drawer-discount__code {
	font-size: .95rem;
}

.gp-drawer-discount__code .gp-drawer-discount__label,
.gp-drawer-discount__ttc {
	color: var(--paper-muted, color-mix(in srgb, currentColor 72%, transparent));
}

/* The amount the free-shipping bar counts: the subtotal row's size. */
.gp-drawer-discount__after {
	padding-top: 4px;
	font-size: 1.1rem;
}

.gp-drawer-discount__ttc {
	font-size: .875rem;
	text-align: right;
}

/* « Choisir » / « Retirer » (client feedback of 6 Nov 2026: the big uppercase buttons looked heavy): a compact outlined
   pill under the name, filled on hover; the theme's 3D call-to-action style stays for real calls to action. */
.gp-giftbox .gp-btn.gp-giftbox__btn {
	min-height: 38px;
	padding: .4em 1.05em;
	border: 1.5px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: var(--paper-ink, #0a0b0d);
	font-family: inherit;
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
	translate: none;
}
.gp-giftbox .gp-btn.gp-giftbox__btn:not([disabled]):hover {
	background: var(--paper-ink, #0a0b0d);
	color: #fff;
	border-color: var(--paper-ink, #0a0b0d);
	box-shadow: none;
	translate: none;
}
.gp-giftbox .gp-btn.gp-giftbox__btn.gp-btn--ghost {
	color: var(--gp-c-muted, #5b5f66);
	border-color: rgba(10, 11, 13, .25);
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
