/*
 * Gravipack delivery (package D3): the product-page block (templates/delivery-estimate.php), part of the « Livraison »
 * card of the closed « Livraison et retours » accordion (theme gp_tab_delivery_v3(), card styles in shop.css): no box
 * of its own. Product pages only, loaded without blocking rendering (gp_style_defer()): the accordion is closed on
 * load. The cart, checkout and drawer lines of D4 (.gp-ship-eta, .gp-ship-note, .gp-drawer-ship) live in commerce.css.
 * 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, --ink-2, --muted, --line and --field-line, with
 * currentColor fallbacks. The focus ring is the theme's global one (2px --accent-ink, offset 3px). No motion: the
 * country panel toggles with hidden.
 */

.gp-delivery {
	--gp-d-line: var(--line, color-mix(in srgb, currentColor 16%, transparent));
	--gp-d-muted: var(--muted, color-mix(in srgb, currentColor 72%, transparent));
	box-sizing: border-box;
	margin: 0;
	font-family: var(--font-body, inherit);
	font-size: .925rem;
	line-height: 1.45;
	color: var(--ink-2, inherit);
	overflow-wrap: break-word;
}

.gp-delivery *,
.gp-delivery *::before,
.gp-delivery *::after {
	box-sizing: inherit;
}

.gp-delivery [hidden],
.gp-delivery[hidden] {
	display: none !important;
}

.gp-delivery :where(p) {
	margin: 0;
}

.gp-delivery__dest {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: .75rem;
	min-height: 44px;
}

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

.gp-delivery__change {
	min-height: 44px;
	margin: 0 -.35rem 0 0;
	padding: 0 .35rem;
	border: 0;
	background: none;
	font: inherit;
	color: var(--ink, inherit);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
	cursor: pointer;
}

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

.gp-delivery__panel {
	display: grid;
	gap: .35rem;
	margin: .25rem 0 .5rem;
}

.gp-delivery__label {
	font-size: .85rem;
	color: var(--ink-2, inherit);
}

.gp-delivery__select {
	width: 100%;
	min-height: var(--field-h-s, 44px);
	padding: .5rem .75rem;
	border: 1px solid var(--field-line, color-mix(in srgb, currentColor 40%, transparent));
	border-radius: var(--field-radius, 10px);
	background-color: var(--bg-2, transparent);
	font: inherit;
	color: var(--ink, inherit);
}

.gp-delivery__methods {
	display: grid;
	gap: .65rem;
	margin: .6rem 0 0;
	padding: .75rem 0 0;
	border-top: 1px solid var(--gp-d-line);
	list-style: none;
}

.gp-delivery__method {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: .75rem;
	align-items: baseline;
	margin: 0;
}

.gp-delivery__name {
	color: var(--ink, inherit);
}

.gp-delivery__price {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--ink, inherit);
}

.gp-delivery__when {
	grid-column: 1 / -1;
	font-size: .875rem;
	color: var(--ink-2, inherit);
}

.gp-delivery__unserved,
.gp-delivery__note,
.gp-delivery__threshold,
.gp-delivery__customs {
	margin-top: .75rem;
}

.gp-delivery__methods + .gp-delivery__unserved {
	margin-top: .6rem;
}

.gp-delivery__foot {
	margin-top: .75rem;
	font-size: .85rem;
	color: var(--gp-d-muted);
}

.gp-delivery a {
	color: var(--ink, inherit);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
}

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

.gp-delivery__test {
	display: inline-block;
	margin-top: .6rem;
	padding: .15rem .55rem;
	border: 1px dashed var(--gp-d-line);
	border-radius: 999px;
	font-size: .8rem;
	color: var(--gp-d-muted);
}

/* ≤ 400 px: « Changer de pays » goes under « Vers : France »; name and price keep one row. */
@media (max-width: 400px) {
	.gp-delivery__dest {
		flex-direction: column;
		align-items: flex-start;
	}

	.gp-delivery__dest .gp-delivery__to {
		padding-top: .35rem;
	}

	.gp-delivery__change {
		margin: 0 0 0 -.35rem;
	}
}

/* The accordion body is .gp-prose (theme main.css: bulleted, indented lists; spaced list items and paragraphs, up to
   0-1-2 specificity): the block's own spacing keeps the upper hand with two classes. */
.gp-delivery .gp-delivery__methods {
	margin: .6rem 0 0;
	padding: .75rem 0 0;
	list-style: none;
}

.gp-delivery .gp-delivery__method,
.gp-delivery .gp-delivery__to {
	margin: 0;
}

.gp-delivery .gp-delivery__unserved,
.gp-delivery .gp-delivery__note,
.gp-delivery .gp-delivery__threshold,
.gp-delivery .gp-delivery__customs,
.gp-delivery .gp-delivery__foot {
	margin: .75rem 0 0;
}

.gp-delivery .gp-delivery__methods + .gp-delivery__unserved,
.gp-delivery .gp-delivery__test {
	margin-top: .6rem;
}
