/*
 Theme Name:   dmp school 27 Shop
 Description:  child theme for the dmp school shop (WooCommerce)
 Author:       Mr. Patrick
 Template:     twentytwentyfive
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://gnu.org
 Text Domain:  dmp-school-shop
*/

/*
 * Nur, was Gutenberg nicht selbst kann (Konzept: „Wo eigenes CSS und
 * JavaScript nötig bleibt“). Farben, Schriften, Abstände, Rundungen und
 * Raster stehen in theme.json und in den Block-Einstellungen – auch bei den
 * WooCommerce-Blöcken (z. B. Produktkarte = Gruppe mit Block-Stil „Karte“
 * in der Produktvorlage, Farben des Mini-Warenkorbs im Block).
 *
 * Teil 1 ist von der Hauptseite übernommen (dmp-school/style.css) und bleibt
 * mit ihr gleich: Änderungen dort hier nachziehen. Teil 2 ist nur für den Shop.
 */

/* =========================================================================
 * Teil 1: gemeinsam mit der Hauptseite
 * ========================================================================= */

/* ---------- Grundlagen ---------- */
.wp-site-blocks > * { margin-block-start: 0; }
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 20;
}
/* Seite nie breiter als das Fenster. clip statt hidden: Sticky-Header bleibt intakt. */
.wp-site-blocks { overflow-x: clip; }

/* ---------- Buttons ---------- */
.wp-element-button { transition: transform .2s, background-color .2s, color .2s; }
.wp-element-button:hover { transform: translateY(-2px); }
.is-style-kontur > .wp-element-button:hover {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}
:is(.is-style-section-dunkel, .is-style-section-rot) .is-style-kontur > .wp-element-button:hover {
	background-color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* ---------- Gaffa-Tape ---------- */
:is(h1, h2).is-style-outline, p.is-style-outline, .gaffa {
	--tape: var(--wp--preset--color--accent-1);
	width: fit-content; color: #fff; -webkit-text-fill-color: currentColor;
	background: var(--tape) repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 6px);
	padding: .22em .28em .1em; transform: rotate(-2deg);
	clip-path: polygon(0 5%, 2% 0, 30% 3%, 60% 0, 98% 4%, 100% 0, 99% 28%, 100% 52%, 98.6% 78%, 100% 100%, 70% 97%, 35% 100%, 3% 96%, 0 100%, 1.2% 72%, 0 46%, 1.4% 22%);
}
.gaffa { display: inline-block; line-height: 1.05; }
:is(h1, h2).is-style-outline, p.is-style-outline { margin-left: -.08em !important; margin-right: auto !important; }
:is(h1, h2, p).is-style-outline.has-text-align-center { margin-inline: auto !important; }
:is(.is-style-section-rot, .has-accent-1-background-color) :is(.is-style-outline, .gaffa) { --tape: var(--wp--preset--color--accent-3); }
.wp-block-group:has(> .is-style-outline) > .wp-block-heading { animation: hoch .8s both cubic-bezier(.2, .8, .2, 1); }
.wp-block-group:has(> .is-style-outline) > .wp-block-heading + .wp-block-heading { animation-delay: .12s; }
@keyframes hoch { from { transform: translateY(46px); opacity: 0; } }
h3.is-style-outline { -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px var(--wp--preset--color--accent-1); min-width: 46px; }

/* ---------- Block-Stil „Prägeband“ (Absatz; im Shop auch Angebots-Etikett) ---------- */
:is(p, .wp-block-woocommerce-product-sale-badge).is-style-praegeband,
.is-style-praegeband .wc-block-components-product-sale-badge {
	width: fit-content; padding: 7px 11px 6px; border-radius: 1px; transform: rotate(-1.5deg);
	font-size: .74rem; font-weight: 700; line-height: 1; letter-spacing: .14em; text-transform: uppercase;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 rgba(0, 0, 0, .4);
}
p.is-style-praegeband:not(.has-background) { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
:is(.is-style-section-dunkel, .wp-block-cover) p.is-style-praegeband:not(.has-background) { background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); }
.is-style-section-rot p.is-style-praegeband:not(.has-background) { background: var(--wp--preset--color--accent-3); color: var(--wp--preset--color--base); }

/* ---------- Block-Stil „Icon-Kreis“ (Bild) ---------- */
.is-style-icon-kreis { margin: 0; flex: none; }
.is-style-icon-kreis img { display: block; aspect-ratio: 1; object-fit: cover; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); } /* Rundung: theme.json */

/* ---------- Block-Stil „Schräge Kante“ ---------- */
.is-style-schraege-kante img { transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.wp-block-image.is-style-schraege-kante { overflow: hidden; }
.wp-block-image.is-style-schraege-kante img { clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%); }
.wp-block-column:first-child > .wp-block-image.is-style-schraege-kante img { clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%); }
.wp-block-cover.is-style-schraege-kante { overflow: visible; }
.wp-block-cover.is-style-schraege-kante > :is(.wp-block-cover__background, .wp-block-cover__video-background, .wp-block-cover__image-background) { clip-path: polygon(11% 0, 100% 0, 100% 100%, 0 100%); }

/* ---------- Block-Stil „Karte“ (Gruppe; im Shop auch die Produktkarte) ---------- */
.is-style-karte { position: relative; transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; } /* Schatten: theme.json */
.is-style-karte:hover { transform: translateY(-6px); box-shadow: var(--wp--preset--shadow--karte), 0 0 0 2px var(--wp--preset--color--accent-1); }
/* Link in der Überschrift (auch Produkttitel) macht die ganze Karte klickbar */
.is-style-karte :is(h2, h3, h4) a { text-decoration: none; color: inherit; }
.is-style-karte :is(h2, h3, h4) a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.is-style-karte.has-base-background-color:hover :is(h2, h3, h4) { color: var(--wp--preset--color--accent-1); }
.is-style-karte.has-accent-1-background-color:hover { box-shadow: var(--wp--preset--shadow--karte), 0 0 0 2px var(--wp--preset--color--base); }
/* Karten in Rastern: Buttons ans untere Ende, über dem Karten-Link klickbar */
.is-style-karte > :is(.wp-block-buttons, .wp-block-woocommerce-product-button):last-child { margin-top: auto; position: relative; z-index: 2; }

/* ---------- Listen: Pillen, Häkchen ---------- */
.wp-block-list.is-style-pillen { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-list.is-style-pillen li { padding: 6px 14px; border-radius: var(--wp--preset--border-radius--pille); background: color-mix(in srgb, currentColor 12%, transparent); font-weight: 500; font-size: .95rem; }
ul.is-style-checkmark-list { list-style: none; padding-left: 0; display: grid; gap: 14px; }
ul.is-style-checkmark-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding-inline-start: 0; }
ul.is-style-checkmark-list li::before {
	content: ""; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%;
	background: var(--wp--preset--color--accent-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* =========================================================================
 * Teil 2: nur Shop
 * Nur, was die WooCommerce-Blöcke im Editor nicht einstellen lassen.
 * Ihre Buttons tragen .wp-element-button und erben die Optik aus theme.json.
 * ========================================================================= */

/* ---------- Preise: Streichpreis grau, Angebotspreis rot ---------- */
.wc-block-components-product-price del { color: var(--wp--preset--color--accent-5); font-weight: 400; }
.wc-block-components-product-price ins { color: var(--wp--preset--color--accent-1); text-decoration: none; }

/* ---------- Reiter am Produkt („Beschreibung“ usw.) wie die Tabs der Hauptseite ---------- */
.wp-block-woocommerce-product-details .wc-tabs { display: flex; gap: 4px; margin: 0 0 var(--wp--preset--spacing--40); padding: 0; list-style: none; border-bottom: 2px solid var(--wp--preset--color--contrast); overflow-x: auto; }
.wp-block-woocommerce-product-details .wc-tabs li { margin: 0; padding: 0; border: 0; background: none; }
/* !important bei Farbe, Hintergrund und Schriftstärke: WooCommerce setzt die Farbe je nach Block-Stil
   („Minimal“, „Klassisch“) mit sehr spezifischen Regeln auf „inherit“ – sonst Schwarz auf Schwarz.
   Schriftstärke 400: Anton gibt es nur in einer Stärke, 700 würde künstlich gefettet und verzerrt. */
.wp-block-woocommerce-product-details .wc-tabs li a {
	display: block; padding: 12px 16px 10px; border: 0; border-radius: var(--wp--preset--border-radius--klein) var(--wp--preset--border-radius--klein) 0 0;
	color: var(--wp--preset--color--accent-5) !important; font-family: var(--wp--preset--font-family--anton); font-size: 1.15rem; font-weight: 400 !important; line-height: 1;
	text-transform: uppercase; text-decoration: none;
}
.wp-block-woocommerce-product-details .wc-tabs li a:hover { color: var(--wp--preset--color--contrast) !important; }
.wp-block-woocommerce-product-details .wc-tabs li.active a { background: var(--wp--preset--color--contrast) !important; color: var(--wp--preset--color--base) !important; }

/* ---------- Formularfelder (Warenkorb, Kasse, Konto, Menge) wie die Formulare der Hauptseite ---------- */
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-blocks-components-select .wc-blocks-components-select__select,
.woocommerce form .input-text, .woocommerce form select,
.quantity .qty {
	background: var(--wp--preset--color--accent-4) !important; border: 2px solid transparent !important;
	border-radius: var(--wp--preset--border-radius--klein) !important; color: var(--wp--preset--color--contrast);
}
.wc-block-components-text-input input:focus,
.wc-block-components-textarea:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus,
.woocommerce form .input-text:focus, .woocommerce form select:focus,
.quantity .qty:focus { outline: none; border-color: var(--wp--preset--color--accent-1) !important; box-shadow: none !important; }
.wc-block-components-validation-error p { color: var(--wp--preset--color--accent-1); font-weight: 700; }
/* Häkchen und Auswahlknöpfe in Rot */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked { background: var(--wp--preset--color--accent-1); border-color: var(--wp--preset--color--accent-1); }
.wc-block-components-checkbox .wc-block-components-checkbox__mark { fill: var(--wp--preset--color--base); }
.wc-block-components-radio-control .wc-block-components-radio-control__input:checked { border-color: var(--wp--preset--color--accent-1); }
.wc-block-components-radio-control .wc-block-components-radio-control__input:checked::before { background: var(--wp--preset--color--accent-1); }

/* ---------- Hinweise (Erfolg, Fehler, Info) in den Farben der Palette ---------- */
.wc-block-components-notice-banner { border-radius: var(--wp--preset--border-radius--klein); }
.wc-block-components-notice-banner.is-success { background: var(--wp--preset--color--minze); border-color: var(--wp--preset--color--minze); }
.wc-block-components-notice-banner.is-error { background: var(--wp--preset--color--rosa); border-color: var(--wp--preset--color--accent-1); }
.wc-block-components-notice-banner.is-info { background: var(--wp--preset--color--himmel); border-color: var(--wp--preset--color--himmel); }
.wc-block-components-notice-banner.is-warning { background: var(--wp--preset--color--sonne); border-color: var(--wp--preset--color--sonne); }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
