/* Produktfelder (tegrafo – Shop-Erweiterungen): Aussehen wie vorher mit APF und Child-Theme. */

.tgpf { width: 100%; margin-top: .4em; }
.tgpf-feld { margin-bottom: .9em; }
.tgpf-feld.tgpf-aus { display: none !important; }

/* Überschrift über dem Feld */
.tgpf-label { display: block; margin: 0 0 .3em; font-size: var(--wp--preset--font-size--tiny); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--wp--preset--color--secondary); }
.tgpf-label abbr.required { text-decoration: none; border: 0; color: inherit; }
.tgpf-hinweis { margin-top: .2em; font-size: var(--wp--preset--font-size--tiny); line-height: 1.5; color: var(--wp--preset--color--secondary); }
.tgpf-hinweis a { color: inherit; text-decoration: underline; }
.tgpf-hinweis[hidden] { display: none; }

/* Kacheln: Eingabe unsichtbar, aber fokussierbar (Browser-Meldung bei Pflichtfeld) */
.tgpf-kacheln { display: grid; grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); gap: .6em; max-width: 440px; }
.tgpf-kachel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; margin: 0; padding: .5em .4em .45em; box-sizing: border-box; border: 1.5px solid #C9CCD0; border-radius: 4px; background: #fff; text-align: center; cursor: pointer; transition: border-color .1s; }
.tgpf-kachel:hover { border-color: var(--wp--preset--color--secondary); }
.tgpf-kachel input { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; }
.tgpf-kachel.tgpf-gewaehlt, .tgpf-kachel:has( input:checked ) { border: 2px solid var(--wp--preset--color--foreground); padding: calc( .5em - .5px ) calc( .4em - .5px ) calc( .45em - .5px ); }
.tgpf-kachel:has( input:focus-visible ) { outline: 2px solid var(--wp--preset--color--foreground); outline-offset: 2px; }
.tgpf-kachel-bild img { display: block; width: auto; max-width: 52px; height: auto; margin: 0 auto; }
.tgpf-kachel-text { font-size: var(--wp--preset--font-size--small); font-weight: 500; line-height: 1.3; overflow-wrap: normal; word-break: normal; hyphens: auto; }

/* Textkacheln (z. B. Wegwahl „Datei hochladen / Im Designer gestalten“) */
.tgpf-darstellung--text .tgpf-kacheln { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); gap: .75em; }
.tgpf-darstellung--text .tgpf-kachel { min-height: 3em; padding: .55em .8em; border-radius: 6px; font-weight: 600; }
.tgpf-darstellung--text .tgpf-kachel-text { font-weight: 600; }
.tgpf-darstellung--text .tgpf-kachel.tgpf-gewaehlt, .tgpf-darstellung--text .tgpf-kachel:has( input:checked ) { padding: calc( .55em - .5px ) calc( .8em - .5px ); background: var(--wp--preset--color--foreground, #232D37); border-color: var(--wp--preset--color--foreground, #232D37); color: #fff; }

/* Auswahlliste, Textfelder */
.tgpf select, .tgpf input[type="text"]:not( .tgpf-wert ), .tgpf textarea { width: 100%; box-sizing: border-box; }

/* Häkchen */
.tgpf-haken { display: inline-flex; align-items: center; gap: .5em; margin: 0; font-size: var(--wp--preset--font-size--small); font-weight: 600; cursor: pointer; }
.tgpf-haken input { margin: 0; }

/* Upload: gestrichelte Ablage, Name des Felds steht im Feld */
.tgpf-feld--datei { margin-bottom: .6em; }
.tgpf-upload { position: relative; }
.tgpf-datei { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.tgpf-ablage { display: block; margin: 0; padding: .55em 1em; box-sizing: border-box; border: 2px dashed currentColor; border-radius: 6px; text-align: center; font-size: var(--wp--preset--font-size--tiny); line-height: 1.6; cursor: pointer; }
.tgpf-ablage strong { font-weight: 600; }
.tgpf-durchsuchen { text-decoration: underline; }
.tgpf-ablage.tgpf-ueber { border-style: solid; opacity: .7; }
.tgpf-upload:has( .tgpf-datei:focus-visible ) .tgpf-ablage { outline: 2px solid var(--wp--preset--color--foreground); outline-offset: 2px; }
.tgpf-upload.tgpf-ungueltig .tgpf-ablage { border-color: #D50032; }
.tgpf-feld.tgpf-aus .tgpf-ablage, .tgpf-datei:disabled + .tgpf-ablage { cursor: default; opacity: .5; }
/* Prüffeld liegt unsichtbar über der Ablage, damit die Browser-Meldung dort erscheint. */
.tgpf-wert { position: absolute !important; left: 0; top: 0; width: 100% !important; height: 2.6em !important; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none; }

.tgpf-liste { list-style: none; margin: .4em 0 0; padding: 0; }
.tgpf-liste:empty { display: none; }
.tgpf-zeile { display: flex; align-items: center; gap: .6em; padding: .3em 0; font-size: var(--wp--preset--font-size--tiny); border-bottom: 1px solid #DCDFE2; }
.tgpf-vorschau { width: 36px; height: 36px; object-fit: contain; background: #F2F2F0; border-radius: 3px; }
.tgpf-zeile-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tgpf-fortschritt { display: none; flex: 0 0 80px; height: 4px; border-radius: 2px; background: #DCDFE2; overflow: hidden; }
.tgpf-fortschritt span { display: block; width: 0; height: 100%; background: var(--wp--preset--color--foreground, #232D37); transition: width .2s; }
.tgpf-zeile--laeuft .tgpf-fortschritt { display: block; }
.tgpf-zeile--laeuft .tgpf-zeile-name { color: var(--wp--preset--color--secondary); }
.tgpf-entfernen { flex: 0 0 auto; width: 1.8em; height: 1.8em; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.1em; line-height: 1; cursor: pointer; }
.tgpf-entfernen:hover, .tgpf-entfernen:focus-visible { background: #F2F2F0; }
.tgpf-fehler { font-size: var(--wp--preset--font-size--tiny); color: #D50032; }
.tgpf-fehler:empty { display: none; }
.tgpf-fehler:not( :empty ) { margin-top: .3em; }

@media ( max-width: 480px ) {
	.tgpf-kacheln { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); gap: .4em; }
	.tgpf-kachel-text { font-size: var(--wp--preset--font-size--tiny); }
}

/* Warenkorb: hochgeladenes Motiv zum Ansehen */
.tgpf-motiv { display: inline-flex; align-items: center; gap: .45em; max-width: 100%; vertical-align: middle; color: inherit; text-decoration: underline; }
/* gegen die Warenkorb-Regel „table.cart img { width: 80px }“ aus Theme/WooCommerce */
.woocommerce-cart table.cart .tgpf-motiv img, .tgpf-motiv img { flex: 0 0 auto; width: 40px; height: 40px; object-fit: contain; background: #F2F2F0; border-radius: 3px; box-shadow: none; }
.tgpf-motiv span { overflow-wrap: anywhere; }
