/* ================================================
   SCHÜCHTERN SHOP – Layout & Farben
   Schrift: PT Sans Narrow (lokal installiert)
   Hauptfarben: Weiß, Grau (#555 / #9C9E9D), Akzent Hellgrün-Hintergrund (#E9F0E9)
   ================================================ */

/* ---------- Font ---------- */
@font-face {
	font-family: 'PT Sans Narrow';
	font-style: normal;
	font-weight: 400;
	src: url('/fonts/pt-sans-narrow-v17-latin-regular.woff2') format('woff2'),
	     url('/fonts/pt-sans-narrow-v17-latin-regular.woff') format('woff');
}
@font-face {
	font-family: 'PT Sans Narrow';
	font-style: normal;
	font-weight: 700;
	src: url('/fonts/pt-sans-narrow-v17-latin-700.woff2') format('woff2'),
	     url('/fonts/pt-sans-narrow-v17-latin-700.woff') format('woff');
}

/* ---------- Grundlayout ---------- */
html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	background-color: #E9F0E9;
	color: #555;
	font-size: 15px;
	line-height: 1.4;
}

/* === Header mit Logo + Claim darunter === */
header {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #fff;
	padding: 10px 0 10px 0;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	position: sticky;
	top: 0;
	z-index: 100;
	text-align: center;
}

header img.logo {
	height: 70px;           /* leicht verkleinert */
	width: auto;
	max-width: 380px;
	margin-bottom: 0;       /* Abstand zum Slogan sitzt am Slogan (margin-top), damit Shops ohne Slogan keinen Extra-Raum haben */
}

header .subtitle {
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	font-style: italic;
	color: rgba(85,85,85,0.6);
	font-size: 1.1em;
	margin: 0.4em 0 0 0;   /* Abstand zum Logo; greift nur bei Shops mit Slogan (z. B. Schüchtern) */
}

#cart-button {
	position:fixed;
	top:0; right:0;
	background:#555;
	color:#fff;
	padding:8px 12px;
	border-radius:0 0 0 8px;   /* bündig in der oberen rechten Ecke */
	cursor:pointer;
	z-index:1001;
}
#cart-button:hover { background:#777; }
#cart-button .cart-ico { width:18px; height:18px; vertical-align:-3px; margin-right:5px; }
/* Grün, sobald etwas im Warenkorb ist (auffälliger) */
#cart-button.has-items { background:#27a327; }
#cart-button.has-items:hover { background:#219a21; }

/* ---------- "Zum Warenkorb"-Button im Footer — nur Desktop (mobil reicht der Button oben rechts).
   Absolut positioniert (rechtsbündig, vertikal zentriert) → Footer-Höhe bleibt unverändert. ---------- */
#footer-cart { display: none; }
@media (min-width: 900px) {
	#footer a#footer-cart:not(.hidden) {
		display: inline-flex;
		align-items: center;
		gap: .45em;
		position: absolute;
		right: 1.2em;
		top: 50%;
		transform: translateY(-50%);
		margin: 0;
		padding: .5em 1.1em;
		background: #27a327;
		color: #fff;
		font-weight: 700;
		text-decoration: none;
		border-radius: 6px;
		line-height: 1;
	}
	#footer a#footer-cart:hover { background: #219a21; color: #fff; text-decoration: none; }
	#footer-cart .cart-ico { width: 18px; height: 18px; }
}

/* ---------- Shop-Hauptbereich ---------- */
/* --footer-h = Höhe des fixierten Footers; wird von footer.php per JS gemessen
   (variiert mit der Fensterbreite, weil die Link-/Zahlarten-Zeilen umbrechen).
   Der Wert hier ist nur der Fallback ohne JS. Mobil (Footer static) setzt JS 0px. */
:root { --footer-h: 110px; }

#shop {
	max-width: 1100px;
	margin: 2em auto;
	padding: 0 1em;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.5em;
	padding-bottom: calc(var(--footer-h) + 1.5em);
}

/* ---------- Kat-Headlines ----------- */
.cat-headline {
	grid-column: 1 / -1;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	font-weight: 700;
	font-size: 1.4em;
	color: #555;
	margin: 1em 0 0.4em 0;
	border-bottom: 2px solid #9C9E9D;
	padding-bottom: 0.2em;
}

/* ---------- Artikelkarten ---------- */
.item-card, .bundle-card {
	background: #fff;
	border-radius: 12px;
	padding: 1em;
	box-shadow: 0 2px 6px rgba(0,0,0,0.1);
	text-align: center;
	transition: transform .2s ease, box-shadow .2s ease;
}

.item-card:hover, .bundle-card:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.item-card .img-wrap {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
	border-radius: 10px;
	cursor:pointer;
}
.item-card .img-wrap img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.8s ease;
}

.bundle-card img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 10px;
	margin-bottom: 0.5em;
	cursor:pointer;
}

.item-card h3, .bundle-card h3 {
	margin: 0.4em 0;
	color: #555;
	font-weight: 700;
}

.item-card p, .bundle-card p {
	margin: 0.2em 0 0.8em 0;
	color: #555;
}

/* Karte als Flex-Spalte: alles unter der Überschrift bündig am unteren Kartenrand.
   Das Grid streckt Karten einer Reihe auf gleiche Höhe; margin-bottom:auto an der
   Überschrift schiebt Preis/Badge/Buttons als Block nach unten. */
.item-card { display: flex; flex-direction: column; }
.item-card .img-wrap { flex-shrink: 0; }
.item-card h3 { margin-bottom: auto; }
.item-card .card-actions { display: flex; flex-wrap: wrap; justify-content: center; }

/* === Artikel-Modal === */
body.no-scroll {
	overflow: hidden;
	touch-action: none;
}

#item-modal .modal-content {
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

#item-modal {
	position: fixed;
	top: 0; left: 0;
	width: 100%; height: 100%;
	background: rgba(0,0,0,0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999;
}

#item-modal.hidden { display: none; }

#item-modal .modal-content {
	background: #fff;
	border-radius: 10px;
	padding: 1.5em;
	width: 90%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
	text-align: left;
}

#item-modal .modal-img {
	width: 100%;
	height: auto;
	margin-bottom: 1em;
	border-radius: 8px;
}

#item-modal button {
	margin: 0.4em 0.8em 0.4em 0;
	padding: 0.6em 1em;
	border: none;
	border-radius: 8px;
	background: #555;
	color: #fff;
	cursor: pointer;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
}

#item-modal button:hover {
	background:#FC6355;
}

/* Modal-Kopf: Titel + Teilen-Button nebeneinander */
#item-modal .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#item-modal .modal-header h2 { margin: 0; }
#item-modal .btn-share {
	flex: none;
	margin: 0;
	padding: 0.35em 0.7em;
	font-size: 0.8em;
	background: none;
	border: 1px solid #bbb;
	color: #555;
}
#item-modal .btn-share:hover { background: #f2f2f2; color: #555; }

#item-modal label {
	display: inline-block;
	margin-top: 0.6em;
	font-weight: bold;
	color: #555;
}

#item-modal a {
	color:#FC6355;
	text-decoration:none;
	transition:all 0.5s ease;
}
#item-modal a:hover {
	color:#555;
}

/* === Modal: Bildgalerie mit Variantenbindung === */
.modal-gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.6em;
	margin-bottom: 0.8em;
}
.modal-gallery img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: none; /* wird per JS passend eingeblendet */
}
.modal-thumbs {
	display: flex;
	gap: 0.5em;
	justify-content: center;
	flex-wrap: wrap;
}
.thumb-wrap {
	position: relative;
}
.thumb-wrap img {
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
}
.thumb-wrap.active img {
	border-color: #ccc;
}
.thumb-wrap.active::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -8px;
	transform: translateX(-50%);
	width: 8px;
	height: 8px;
	background: #FC6355;
	border-radius: 50%;
}

.modal-thumbs img.active::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -8px;
	transform: translateX(-50%);
	width: 8px;
	height: 8px;
	background: #FC6355;
	border-radius: 50%;
}

/* ---------- Buttons ---------- */
.btn-details, .btn-add, .btn-add-bundle {
	margin: 0.4em;
	padding: 0.6em 1em;
	border: none;
	border-radius: 8px;
	background: #555;
	color: #fff;
	cursor: pointer;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	transition: background 0.2s ease;
}

.btn-details:hover, .btn-add:hover, .btn-add-bundle:hover {
	background:#FC6355;
}

/* ---------- Warenkorb ---------- */
#cart-overlay {
	position: fixed;
	top:0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.3);
	box-shadow: -2px 0 6px rgba(0,0,0,0.2);
	padding: 204px 1em 1em 1em;
	z-index:1000;
	overflow-y: auto;
	display: none;
}

/* === Warenkorb-Overlay Detail === */
#cart-overlay.visible { display: block; }

#cart {
	position: absolute;
	top: 0;
	right: 0;
	width: min(400px, 100%);
	height: 100%;
	background: #fff;
	box-shadow: -2px 0 6px rgba(0,0,0,0.2);
	padding: 1em 2.8em 1em 1em;
	overflow-y: auto;
	box-sizing:border-box;
}

.cart-line {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.6em;
	padding: 0.3em 0;
	border-bottom: 1px solid #eee;
	font-size: 0.95em;
}
.cart-line .cart-title { flex: 1; text-align: left; }
.cart-line .cart-qty { display: inline-flex; align-items: center; gap: 1px; }
.cart-qty .qty-btn { width: 24px; height: 24px; border: 1px solid #ccc; background: #fafafa; border-radius: 4px; font-size: 0.95em; line-height: 1; cursor: pointer; color: #333; padding: 0; }
.cart-qty .qty-btn:hover { background: #eee; }
.cart-qty .qty-num { min-width: 1.1em; text-align: center; }
.cart-line .cart-price { width: 5em; text-align: right; }
.btn-remove {
	background: none;
	border: none;
	color: #555;
	font-size: 1.2em;
	cursor: pointer;
}
.btn-remove:hover { color: #555; }

.cart-ship {
	text-align: right;
}

.cart-total {
	text-align: right;
	font-weight: bold;
	margin-top: 0.5em;
}

#btn-checkout, #cart-close {
	width: 100%;
	margin-top: 1em;
	padding: 0.8em;
	background: #555;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	cursor: pointer;
}
#btn-checkout:hover, #cart-close:hover {
	background: #FC6355;
}

#cart h2 {
	font-size: 1.4em;
	margin-top: 0;
	color: #555;
}

/* ---------- Checkout ---------- */
#checkout-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.35);
	display: none;
	z-index: 1500;
	overflow-y: auto;          /* scrollt bei vielen Artikeln */
	padding: 30px 12px;
	box-sizing: border-box;
}

/* Alles gestapelt in einer zentrierten Spalte – kein Überlappen mehr */
#checkout-container.visible {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

#checkout-panel {
	width: 360px;
	max-width: 100%;
	background: #fff;
	border-radius: 14px;
	padding: 16px 18px;
	box-sizing: border-box;
}

#checkout-container h2 {
	margin: 0 0 0.8em 0;
	color: #555;
}

/* Abbrechen-Button im Checkout (unter den Checkboxen) – sekundär/unaufdringlich */
#btn-checkout-cancel {
	display: inline-block;
	margin-top: 0.9em;
	padding: 0.5em 1.2em;
	background: none;
	border: 1px solid #bbb;
	border-radius: 8px;
	color: #555;
	cursor: pointer;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	font-size: 1em;
}
#btn-checkout-cancel:hover { background: #f2f2f2; }

#paypal-button-container {
	position: relative;
	isolation: isolate;        /* eigener Stacking-Context, damit der Schleier über dem PayPal-iframe liegt */
	width: 360px;
	max-width: 100%;
	padding: 16px;
	background: #fff;
	border-radius: 16px;
	box-sizing: border-box;
}

/* Gesperrt bis Zustimmung: deckend weiß bleiben, Inhalt nur blass + nicht klickbar.
   WICHTIG: kein pointer-events:none am Container – sonst fällt der Klick auf den
   Hintergrund durch und schließt das Checkout-Fenster. Stattdessen fängt der Schleier
   (::after) die Klicks ab; ein JS-Handler zeigt dann den Hinweis. */
#paypal-button-container.pay-locked { cursor: not-allowed; }
#paypal-button-container.pay-locked::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255,255,255,0.6);
	border-radius: 16px;
	z-index: 100;              /* über den PayPal-Buttons (iframe) */
	pointer-events: auto;      /* Klicks abfangen → kein Durchfallen auf den Hintergrund/Close */
	cursor: not-allowed;
}

#btn-pay-bank {
	margin: 0 0 14px 0;
	height: 45px;
	position: relative;
    width:320px;
    border:1px solid #ccc;
    border-radius:4px;
    background:url('/img/button_ueberweisen.png') top left / 100% 100% no-repeat;
    cursor:pointer;
}

/* === Banküberweisung (Checkout) === */
#bank-form {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 14px;
	padding: 16px;
	width: 360px;
	max-width: 100%;
	box-sizing: border-box;
}

#bank-form h3 {
	margin: 0 0 12px 0;
	font-size: 1.2em;
	color: #555;
}

#bank-form form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

#bank-form label {
	font-size: 0.95em;
	color: #555;
}

#bank-form input[type="text"],
#bank-form input[type="email"] {
	width: 100%;
	box-sizing: border-box;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 8px;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	font-size: 1em;
	color: #333;
	background: #fff;
}

#bank-form input[type="text"]:focus,
#bank-form input[type="email"]:focus {
	border-color: #9C9E9D;
	outline: none;
}

#bank-form button[type="submit"] {
	padding: 10px 14px;
	border: none;
	border-radius: 8px;
	background: #555;
	color: #fff;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	cursor: pointer;
}

#bank-form button[type="submit"]:hover {
	background: #9C9E9D;
}

#btn-cancel-bank {
	padding: 10px 14px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
	color: #555;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	cursor: pointer;
}

#btn-cancel-bank:hover {
	border-color: #9C9E9D;
}

/* optional: kleiner Abstand, wenn PayPal-Buttons wieder eingeblendet werden */
#btn-pay-bank.alt-pay {
	margin-top: 16px;
}

#bank-form.hidden { display: none !important; }

#legal-page {
	max-width: 500px;
	margin: 0 auto;
	padding: 20px 20px calc(var(--footer-h) + 20px) 20px;
	line-height: 1.55;
	font-size: 15px;
}

/* Haupttitel */
#legal-page h1 {
	font-size: 22px;
	margin-bottom: 20px;
	font-weight: 600;
	color:#555;
}

/* Abschnittstitel */
#legal-page h2 {
	font-size: 16px;
	margin-top: 24px;
	margin-bottom: 6px;
	font-weight: 600;
	border-left: 4px solid #ccc;
	padding-left: 8px;
	color:#555;
}

/* Absätze */
#legal-page p {
	margin: 4px 0 12px 0;
	color:#555;
}
#legal-page a {
	color:#555;
	text-decoration:underline;
}
#legal-page a:hover {
	color:#FC6355;
}

/* ---------- Footer ---------- */

footer {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: #fff;
	color: #555;
	text-align: center;
	padding: 0.5em 0;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	font-size: 10pt;
	border-top: 1px solid #9C9E9D;
	z-index:998;
}
#footer a {
	color: #555;
	text-decoration: none;
}
#footer a:hover {
	text-decoration: underline;
}
footer p { margin: 0.15em 0; line-height: 1.5; }

/* ------------- Message ------------- */

#shop-message {
	position: fixed;
	top: 165px;
	left: 50%;
	transform: translateX(-50%);
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 500;
	z-index: 9999;
	transition: opacity .3s;
}
#shop-message.success { background:#2e7d32; color:#fff; }
#shop-message.error { background:#c62828; color:#fff; }
#shop-message.hidden { opacity:0; pointer-events:none; }
/* ===========================================================
   Checkout: Bestellübersicht + Zustimmung (§312j)
   =========================================================== */
#checkout-summary {
	background: #fafafa;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 14px 16px;
	margin-bottom: 14px;
	text-align: left;
}
#checkout-summary h3 { margin: 0 0 8px; }
#checkout-summary .co-line { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
#checkout-summary .co-total { font-weight: bold; border-top: 1px solid #ddd; margin-top: 6px; padding-top: 6px; }
#checkout-summary .co-tax { color: #666; font-size: 0.85em; margin-top: 6px; }
#checkout-consent, #digital-consent {
	text-align: left;
	margin: 6px 0 16px;
	font-size: 0.95em;
	display: flex;
	gap: 8px;
	align-items: flex-start;
}
#checkout-consent input, #digital-consent input { margin-top: 3px; }
#digital-consent { color: #7a3b00; }

/* Rechtstext-Seiten: Adress- und Musterformular-Blöcke */
.legal-address { margin: 10px 0; padding-left: 4px; line-height: 1.5; }
#muster-widerruf .muster-box {
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 14px 16px;
	background: #fafafa;
	margin-top: 8px;
}

/* Lager-Hinweise (Storefront) */
.stock-badge { font-weight: bold; font-size: 0.85em; margin: 2px 0; }
.stock-badge.ok { color: #27a327; }
.stock-badge.soldout { color: #c0392b; }
.stock-badge.backorder { color: #b8860b; }
.btn-add[disabled], #btn-add-selected[disabled] { opacity: 0.55; cursor: not-allowed; }
.stock-note { font-size: 0.95em; }

/* Bestellbestätigung mit GiroCode */
.order-confirm { background:#fff; border-radius:8px; padding:24px; max-width:420px; width:100%; text-align:center; box-shadow:0 2px 12px rgba(0,0,0,.15); }
.order-confirm h2 { margin-top:0; }
.order-confirm .giro-qr { width:220px; max-width:70%; height:auto; margin:8px auto 16px; display:block; }
.order-confirm .bank-details { width:100%; border-collapse:collapse; text-align:left; margin:0 auto 12px; font-size:.95em; }
.order-confirm .bank-details td { padding:4px 6px; border-bottom:1px solid #eee; }
.order-confirm .bank-details td:first-child { color:#666; white-space:nowrap; width:40%; }
.order-confirm .bank-details td:last-child { font-weight:bold; word-break:break-all; }
.order-confirm .hint { color:#666; font-size:.85em; }
.order-confirm .oc-done { margin-top:8px; }
.order-confirm .oc-check { font-size:52px; line-height:1; color:#2e7d32; margin-bottom:6px; }

/* Lade-/Fehlerzustand der Artikelliste */
.loading-note { text-align:center; color:#666; padding:40px 16px; font-size:1.05em; }
.load-error { text-align:center; color:#555; padding:40px 16px; }
.load-error button { margin-top:12px; padding:10px 20px; border:1px solid #333; background:#000; color:#fff; border-radius:6px; cursor:pointer; font-size:1em; }
.load-error button:hover { background:#333; }

/* Batch-2 Quick Wins */
.ship-note { color:#666; font-size:.85em; margin:2px 0 8px; }
.cart-freeship { color:#2e7d32; font-size:.9em; margin-top:4px; font-weight:bold; }
#shop-message { cursor: pointer; }
.footer-pay { font-size: .8em; color: #888; margin-top: 2px; }

/* ===== Mobil (ans Dateiende, damit die Regeln die Basisregeln überschreiben) ===== */
@media (max-width: 768px) {
	/* Warenkorb-Button sitzt oben rechts in der Ecke → Header-Inhalt darunter schieben */
	header { padding-top: 2.8em; }
	/* Logo mobil höchstens 80 % Breite */
	header img.logo { max-width: 80% !important; }
	/* Abstand unter dem Header bis zur ersten Kategorie verkleinern (mobil war ~3,6em) */
	#shop { margin-top: 0.7em; }
	#shop .cat-headline:first-of-type { margin-top: 0.3em; }
	/* Toast weiter nach oben (mobil ist der Header kleiner, top:165px hing im Content) */
	#shop-message { top: 70px; }
}
/* Einspaltige Ansicht (Phones, < 533 px): Artikelbilder groß (~75 % Screenbreite),
   Footer nicht mehr fixiert (kein Überdecken, keine große Reserve) */
@media (max-width: 532px) {
	.item-card .img-wrap { height: 75vw; }
	footer { position: static; }
	#shop { padding-bottom: 1em; }
	footer p { font-size: 9pt; }
}
