/**
 * Shop (inc/shop.php): Übersicht, Kategorien, Produktseite.
 * Baut auf buecher.css auf (Rahmen .panel, Kopf, Brotkrümel, Buttons, Kategorie-Links).
 * Die WooCommerce-Stylesheets sind auf diesen Seiten aus – alles, was WooCommerce ausgibt
 * (Hinweise, Menge, Varianten, Button), ist hier gestaltet.
 */

/* ==========================================================================
   Kopf
   ========================================================================== */

.shop-head__lead p { margin: 0; }
.shop-head__lead p + p { margin-top: 10px; }
@media (min-width: 900px) {
	.shop-fan__item { aspect-ratio: 1 / 1; width: 128px; border-radius: 16px; background: #fff; }
}

/* Kategorien */
.shop-cats { padding-block: 14px; }
.buecher .shop-cats .term-link[aria-current] { border-color: var(--accent); background: var(--accent); color: #fff; }
.buecher .shop-cats .term-link[aria-current] .pill__count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.shop-cats .term-link:not(:has(.pill__count)) { padding-right: 14px; }

/* Sortierung */
.shop-results__bar { margin-bottom: 22px; }
.shop-sort .woocommerce-ordering { margin: 0; }
.shop-sort select {
	min-height: 44px;
	padding: 8px 38px 8px 14px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-control);
	background: #fff url("../icons/chevron-down-violet.svg") right 12px center / 18px no-repeat;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: var(--ink);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.shop-sort select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ==========================================================================
   Raster und Karten
   ========================================================================== */

.shop-grid {
	--shop-row-gap: 16px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--shop-row-gap) 12px;
}
@media (min-width: 700px) { .shop-grid { --shop-row-gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 18px; } }
@media (min-width: 1100px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.shop-grid__item { min-width: 0; }

.shop-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--radius-card);
	background: #fff;
	border: 1px solid var(--line-soft);
	box-shadow: var(--shadow-card);
	overflow: hidden;
	transition: box-shadow 0.25s ease;
}
.shop-card:hover { box-shadow: 0 22px 36px -22px rgba(43, 16, 24, 0.45); }
@supports selector(:has(*)) {
	.shop-card:has(.shop-card__title a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
	.shop-card__title a:focus-visible { outline: none; }
}

.shop-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: var(--accent-tint);
	overflow: hidden;
}
.buecher .shop-card__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.shop-card:hover .shop-card__img { transform: scale(1.04); }

.shop-card__signed {
	position: absolute;
	inset-inline-start: 8px;
	bottom: 8px;
	padding: 3px 7px;
	border: 1px solid var(--line);
	border-radius: 4px 8px;
	background: var(--paper);
	color: var(--accent-dark);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
}

.shop-card__body { display: flex; min-width: 0; flex-direction: column; gap: 4px; flex: 1 1 auto; padding: 10px 10px 12px; }
@media (min-width: 700px) { .shop-card__body { padding: 14px 14px 16px; } }

.shop-card__cat {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	overflow-wrap: anywhere;
	color: var(--accent);
}
.buecher .shop-card__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(16px, 1.6vw, 21px);
	line-height: 1.18;
	overflow-wrap: anywhere;
}
.shop-card__title a { color: inherit; text-decoration: none; }
/* Ganze Karte klickbar */
.shop-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.shop-card__legal { font-size: 12px; line-height: 1.35; color: var(--ink-70); overflow-wrap: anywhere; }
.shop-card__legal:empty { display: none; }
.shop-card__legal p { margin: 0; }
.shop-card__legal a { position: relative; z-index: 2; color: var(--ink-70); }

.shop-card__cta { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: auto; padding-top: 6px; }

/* Gemeinsame Zeilenhöhen für Bild, Titel, Veredelung, Preis, Hinweise und Kaufbutton. */
@supports (grid-template-rows: subgrid) {
	.shop-grid { row-gap: 0; }

	.shop-grid__item,
	.shop-card,
	.shop-card__body {
		display: grid;
		grid-template-rows: subgrid;
		row-gap: 0;
	}

	.shop-grid__item { grid-row: span 6; margin-block-end: var(--shop-row-gap); }
	.shop-card { grid-row: 1 / -1; height: auto; }
	.shop-card__media { grid-row: 1; }
	.shop-card__body { grid-row: 2 / 7; align-items: start; }
	.shop-card__title { grid-row: 1; }
	.shop-card__cat { grid-row: 2; padding-top: 4px; }
	.shop-card__price { grid-row: 3; padding-top: 5px; }
	.shop-card__legal { grid-row: 4; }
	.shop-card__cta { grid-row: 5; margin-top: 0; padding-top: 8px; }
}

/* ==========================================================================
   Preis (WooCommerce-HTML)
   ========================================================================== */

.buecher .price { font-size: 18px; font-weight: 800; color: var(--ink); }
.buecher .price del { margin-right: 6px; font-weight: 600; color: var(--ink-50); }
.buecher .price ins { text-decoration: none; color: var(--accent); }
.buecher .price .woocommerce-Price-currencySymbol { margin-left: 1px; }

/* ==========================================================================
   Buttons (auch die von WooCommerce)
   ========================================================================== */

.buecher .shop-btn,
.buecher .single_add_to_cart_button,
.buecher .shop-card__cta .added_to_cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 18px;
	border: 1.5px solid var(--accent);
	border-radius: var(--radius-button);
	box-shadow: var(--button-keyline);
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.buecher .shop-btn:hover,
.buecher .single_add_to_cart_button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.buecher .shop-btn:focus-visible,
.buecher .single_add_to_cart_button:focus-visible,
.buecher .shop-card__cta .added_to_cart:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.buecher .shop-card__cta .shop-btn { width: 100%; min-height: 44px; padding-inline: 8px; font-size: 14px; }
.shop-card__cta { container-type: inline-size; }
.shop-btn__short { display: none; }
@container (max-width: 150px) {
	.shop-btn__long { display: none; }
	.shop-btn__short { display: inline; }
}
@container (max-width: 110px) {
	.buecher .shop-card__cta .shop-btn { padding-inline: 4px; font-size: 13px; }
}
/* Variante wählen / Weiterlesen: heller */
.buecher .shop-btn:not(.add_to_cart_button) { background: #fff; color: var(--accent); }
.buecher .shop-btn:not(.add_to_cart_button):hover { background: var(--accent-light); color: var(--accent-dark); }
/* Während „In den Warenkorb“ lädt / danach */
.buecher .shop-btn.loading { opacity: 0.7; cursor: progress; }
.buecher .shop-btn.added::after {
	content: "";
	width: 16px;
	height: 16px;
	background: url("../icons/check-white.svg") center / contain no-repeat;
}
.buecher .shop-card__cta .added_to_cart { width: 100%; min-height: 40px; background: #fff; color: var(--accent); font-size: 14px; }
.buecher .shop-card__cta .added_to_cart:hover { background: var(--accent-light); }
.buecher .single_add_to_cart_button.disabled,
.buecher .single_add_to_cart_button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Hinweise (Ecke des Bildes)
   ========================================================================== */

.shop-badges { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.shop-badge {
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	box-shadow: 0 6px 14px -8px rgba(43, 16, 24, 0.5);
}
.shop-badge--vorbestellung,
.shop-badge--limitiert { background: var(--accent-deep); }
.shop-badge--neu,
.shop-badge--sonderausgabe { background: #fff; color: var(--accent); }
.shop-badge--angebot { background: var(--success); }
.shop-badge--aus { background: #5d4a50; }

/* ==========================================================================
   Hinweise von WooCommerce (Warenkorb, Fehler)
   ========================================================================== */

.shop-notices [tabindex="-1"]:focus { outline: none; }
.shop-notices:empty,
.shop-notices > .woocommerce-notices-wrapper:empty { display: none; }
.shop-notices .woocommerce-message,
.shop-notices .woocommerce-info,
.shop-notices .woocommerce-error,
.shop-notices .wc-block-components-notice-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 18px;
	margin: 0;
	padding: 14px 18px;
	border-radius: 18px;
	background: var(--success-bg);
	color: var(--success);
	font-size: 16px;
	font-weight: 700;
	list-style: none;
}
.shop-notices .woocommerce-info { background: var(--info-bg); color: var(--info); }
.shop-notices .woocommerce-error,
.shop-notices .wc-block-components-notice-banner.is-error { background: #FCEDEC; color: #8C1D18; }
.shop-notices .woocommerce-message .button,
.shop-notices a.wc-forward { order: 2; color: inherit; font-weight: 800; text-decoration: underline; }
.shop-notices .woocommerce-error li { margin: 0; }

/* ==========================================================================
   Produktseite
   ========================================================================== */

.product-hero { display: flex; flex-direction: column; gap: 18px; }
.product-hero__grid { display: grid; gap: 22px; }
@media (min-width: 900px) {
	.product-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
}

/* Bilder */
.product-gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 900px) { .product-gallery { position: sticky; top: 130px; } }
.product-gallery__stage {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: var(--radius-card);
	background: var(--accent-tint);
	overflow: hidden;
}
.product-gallery__main {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}
.product-gallery__main:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.buecher .product-gallery__img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-gallery__zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 6px 16px -8px rgba(43, 16, 24, 0.5);
}
.product-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.product-gallery__thumb {
	width: 72px;
	height: 72px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 14px;
	background: var(--accent-tint);
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.2s;
}
.buecher .product-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-gallery__thumb[aria-current="true"] { border-color: var(--accent); }
.product-gallery__thumb:hover { border-color: var(--line-strong); }
.product-gallery__thumb:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Text und Kauf */
.product-hero__summary { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.product-hero__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(30px, 4vw, 48px);
	line-height: 1.08;
	overflow-wrap: break-word;
}
.buecher .product-hero__price { font-size: 26px; }
.product-hero__buy { display: flex; flex-direction: column; gap: 14px; }
.product-hero__buy > *:empty { display: none; }
.product-hero__buy .woocommerce-product-details__short-description { color: var(--ink-70); }
.product-hero__buy .woocommerce-product-details__short-description p { margin: 0 0 10px; }
.buecher .product-hero__buy .woocommerce-product-details__short-description ul { padding-left: 1.3em; list-style: disc; }
/* Germanized: Grundpreis, MwSt., Versand, Lieferzeit */
.product-hero__buy .legal-price-info,
.product-hero__buy .wc-gzd-additional-info,
.product-hero__buy .delivery-time-info,
.product-hero__buy .price-unit { margin: 0; font-size: 14px; color: var(--ink-70); }
.product-hero__buy .wc-gzd-additional-info a,
.product-hero__buy .legal-price-info a { color: var(--ink-70); }

/* Lagerbestand */
.product-hero__buy .stock { margin: 0; font-size: 15px; font-weight: 700; color: var(--success); }
.product-hero__buy .stock.out-of-stock { color: #8C1D18; }

/* Menge + Button */
.product-hero__buy form.cart:not(.variations_form),
.product-hero__buy .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.product-hero__buy .quantity { display: flex; }
.product-hero__buy .quantity .qty {
	width: 84px;
	min-height: 52px;
	padding: 8px 10px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-control);
	background: #fff;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	text-align: center;
	color: var(--ink);
}
.product-hero__buy .quantity .qty:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.buecher .product-hero__buy .single_add_to_cart_button { flex: 1 1 220px; min-height: 52px; font-size: 16px; }

/* Varianten (z. B. Titel der Buchbox) */
.product-hero__buy table.variations { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.product-hero__buy table.variations th,
.product-hero__buy table.variations td { display: block; padding: 0; text-align: left; }
.product-hero__buy table.variations tr + tr th { padding-top: 12px; }
.product-hero__buy table.variations label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 800; }
.product-hero__buy table.variations select {
	width: 100%;
	min-height: 50px;
	padding: 10px 40px 10px 16px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-control);
	background: #fff url("../icons/chevron-down-violet.svg") right 14px center / 18px no-repeat;
	font: inherit;
	font-size: 16px;
	color: var(--ink);
	-webkit-appearance: none;
	appearance: none;
}
.product-hero__buy table.variations select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.product-hero__buy .reset_variations { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--accent); }
.product-hero__buy .single_variation_wrap { display: flex; flex-direction: column; gap: 12px; }
.product-hero__buy .woocommerce-variation-price .price { font-size: 22px; }
.product-hero__buy .woocommerce-variation-description p { margin: 0; }

/* Beschreibung + Details */
.product-info { display: grid; gap: 26px; }
@media (min-width: 900px) {
	.product-info { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
	.product-info--single { grid-template-columns: minmax(0, 1fr); }
}
.product-info__title {
	margin-bottom: 12px !important;
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(24px, 2.6vw, 30px);
	line-height: 1.15;
}
.product-info .prose p { margin: 0 0 14px; }
.buecher .product-info .prose ul { padding-left: 1.3em; list-style: disc; margin: 0 0 14px; }
.buecher .product-info .prose ol { padding-left: 1.3em; list-style: decimal; margin: 0 0 14px; }
.buecher .product-info .prose li { display: list-item; list-style: inherit; }
.product-info .woocommerce-product-attributes { width: 100%; border-collapse: collapse; font-size: 16px; }
.product-info .woocommerce-product-attributes th,
.product-info .woocommerce-product-attributes td { padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.product-info .woocommerce-product-attributes th { width: 42%; padding-right: 14px; font-weight: 800; }
.product-info .woocommerce-product-attributes td p { margin: 0; }

/* Ähnliche Produkte */
.shop-related .results__count { margin-bottom: 18px; }

/* Bild groß */
.product-zoom {
	max-width: min(96vw, 1100px);
	max-height: 94vh;
	padding: 0;
	border: 0;
	border-radius: var(--radius-card);
	background: #fff;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}
.product-zoom::backdrop { background: rgba(43, 16, 24, 0.7); }
.buecher .product-zoom__img { display: block; width: auto; height: auto; max-width: 100%; max-height: 90vh; margin: 0 auto; object-fit: contain; }
.product-zoom__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 6px 16px -8px rgba(43, 16, 24, 0.5);
	cursor: pointer;
}
.product-zoom__close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Seitenzahlen */
.shop .navigation.pagination { margin-top: 28px; }
.shop .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.shop .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-control);
	background: #fff;
	font-weight: 800;
	color: var(--ink);
	text-decoration: none;
}
.shop .page-numbers.current { border-color: var(--accent); background: var(--accent); color: #fff; }
.shop a.page-numbers:hover { border-color: var(--accent); background: var(--accent-hover); }

@media (prefers-reduced-motion: reduce) {
	.shop-card,
	.shop-card__img { transition: none; }
	.shop-card:hover,
	.shop-card:hover .shop-card__img { transform: none; }
}

/* EMMA-ANPASSUNG 04.12. (24b) (Kirill) – BITTE BEI THEME-UPDATES ÜBERNEHMEN */
/* (24b) Lange Wörter sauber trennen („Weihnachts-küsse“ statt „Weihnachtsküss-e“) */
.shop-card__title { overflow-wrap: normal !important; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 10 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; }
