/* Versandkosten-Einblendung (inc/versand.php, assets/js/versand.js, Vorlagenteil parts/versandinfo.html) */

/* Auslöser: gepunktet unterstrichen, damit klar ist, dass hier etwas aufgeht */
[data-ghm-versand] {
	text-decoration-line: underline;
	text-decoration-style: dotted;
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
	cursor: pointer;
}

.ghm-versand-pop[hidden] { display: none !important; }

.ghm-versand-pop {
	position: fixed;
	z-index: 100001; /* über Kopf, Mini-Warenkorb und Cookie-Hinweis */
	top: 0; left: 0;
	box-sizing: border-box;
	width: min(360px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	overflow: auto;
	padding: 1rem 1.15rem 1.05rem;
	border: 1px solid var(--wp--preset--color--sand);
	border-radius: 14px;
	background: var(--wp--preset--color--karte);
	color: var(--wp--preset--color--tinte);
	font-family: var(--wp--preset--font-family--jost);
	font-size: .9rem;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
	white-space: normal;
	box-shadow: 0 18px 40px -16px rgba(28, 23, 19, .45), 0 2px 6px rgba(28, 23, 19, .08);
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .16s ease, transform .16s ease;
}
.ghm-versand-pop.is-offen { opacity: 1; transform: none; }
.ghm-versand-pop:focus { outline: none; }
.ghm-versand-pop:focus-visible { outline: 2px solid var(--wp--preset--color--gold-tief); outline-offset: 2px; }

/* Pfeil zum Auslöser (nur am Computer) */
.ghm-versand-pop::before {
	content: "";
	position: absolute;
	left: var(--ghm-pfeil, 50%);
	top: -7px;
	width: 12px; height: 12px;
	margin-left: -6px;
	background: inherit;
	border-left: 1px solid var(--wp--preset--color--sand);
	border-top: 1px solid var(--wp--preset--color--sand);
	transform: rotate(45deg);
}
.ghm-versand-pop.is-oben::before { top: auto; bottom: -7px; transform: rotate(225deg); }

.ghm-versand-pop__kopf {
	display: flex; align-items: center; justify-content: space-between; gap: .75rem;
	margin-bottom: .45rem;
}
.ghm-versand-pop__titel {
	margin: 0;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 1.15rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--wp--preset--color--tinte);
}
.ghm-versand-pop__zu {
	flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; padding: 0;
	border: 1px solid var(--wp--preset--color--sand);
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--tinte-2);
	font: 400 1.25rem/1 var(--wp--preset--font-family--jost);
	cursor: pointer;
}
.ghm-versand-pop__zu:hover,
.ghm-versand-pop__zu:focus-visible { background: var(--wp--preset--color--sand); color: var(--wp--preset--color--tinte); }
.ghm-versand-pop__zu:focus-visible { outline: 2px solid var(--wp--preset--color--gold-tief); outline-offset: 2px; }
/* Beim Drüberfahren ist kein Schließen-Knopf nötig */
.ghm-versand-pop.is-hover .ghm-versand-pop__zu { visibility: hidden; }

.ghm-versand-pop .screen-reader-text,
.ghm-versand-tabelle .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Inhalt (Vorlagenteil) – gilt in der Einblendung und überall, wo der Vorlagenteil steht */
.ghm-versand-inhalt > * { margin-top: 0; margin-bottom: .55rem; }
.ghm-versand-inhalt > *:last-child { margin-bottom: 0; }
.ghm-versand-inhalt p { font-size: inherit; color: inherit; }
.ghm-versand-inhalt .ghm-versand-klein { font-size: .8rem; color: var(--wp--preset--color--tinte-3); line-height: 1.45; }

.ghm-versand-tabelle {
	width: 100%;
	margin: .25rem 0 .6rem;
	border-collapse: collapse;
	font-size: inherit;
	font-variant-numeric: tabular-nums;
}
.ghm-versand-tabelle th,
.ghm-versand-tabelle td {
	padding: .42rem 0;
	border: 0;
	border-bottom: 1px dashed rgba(135, 90, 18, .28);
	background: none;
	vertical-align: baseline;
	text-align: left;
	font-weight: 400;
}
.ghm-versand-tabelle tr:last-child th,
.ghm-versand-tabelle tr:last-child td { border-bottom: 0; }
.ghm-versand-tabelle td { padding-left: 1rem; text-align: right; white-space: nowrap; font-weight: 600; color: var(--wp--preset--color--tinte); }

/* Handy: Blatt von unten, Hintergrund abgedunkelt */
@media (max-width: 639px) {
	.ghm-versand-pop {
		top: auto !important; left: 0 !important; right: 0; bottom: 0;
		width: 100%;
		max-height: 80vh;
		padding: 1.1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
		border-radius: 18px 18px 0 0;
		border-width: 1px 0 0;
		font-size: .95rem;
		box-shadow: 0 0 0 100vmax rgba(28, 23, 19, .4), 0 -8px 24px -12px rgba(28, 23, 19, .4);
		transform: translateY(16px);
	}
	.ghm-versand-pop::before { display: none; }
	.ghm-versand-pop.is-hover .ghm-versand-pop__zu { visibility: visible; }
	.ghm-versand-pop__zu { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	.ghm-versand-pop { transition: none; transform: none; }
}

/* Im Fuß sieht der Link aus wie die anderen Fuß-Links */
.ghm-foot [data-ghm-versand] { text-decoration: none; }
.ghm-foot [data-ghm-versand]:hover { text-decoration: underline; }
