/* ============================================
   TERAPRINT TYPOGRAPHY OVERRIDES v2.0
   Geladen NACH teraprint-frontend.css.
   Gescopet auf Plugin-Bereiche.
   ============================================ */

/* ================================================
   GLOBALER FONT-RESET (Gemini Fix #1)
   KEIN body * !important — das killt Icon-Fonts!
   Nur body + Formular-Elemente.
   ================================================ */
body {
    font-family: var(--tp-font);
    font-size: var(--tp-text-base);
    line-height: var(--tp-lh-base);
    color: var(--tp-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
input, button, select, textarea {
    font-family: inherit;
}

/* ================================================
   LINK-FARBEN (Gemini Fix #2)
   Links muessen als Links erkennbar bleiben!
   ================================================ */
a {
    color: var(--tp-blue);
}
a:hover {
    text-decoration: underline;
}
/* Footer-Links: inherit (weiss auf dunklem Hintergrund) */
footer a,
.tp-footer a {
    color: inherit;
}
/* Nav-Links: eigenes Styling behalten */
.tp-nav a, nav a, .menu a {
    color: inherit;
}

/* ================================================
   CONTENT-BEREICH RESET (Gemini Fix #3)
   .woocommerce liegt auf <body> — NIE als Scope!
   Nur echte Content-Container targeten.
   ================================================ */
.woocommerce-Tabs-panel,
.entry-content,
#tab-description,
.woocommerce-product-details__short-description {
    color: var(--tp-text-primary);
}

/* ================================================
   KONFIGURATOR TYPOGRAPHY
   Selektoren = echte Klassen aus teraprint-frontend.js
   ================================================ */

/* --- Konfigurator Titel --- */
.konf-header h2 {
    font-size: var(--tp-text-md);
    font-weight: var(--tp-font-bold);
    color: var(--tp-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: var(--tp-lh-tight);
}

/* --- Info-Badges (FORMAT / MINDESTMENGE / BRANDSCHUTZ) --- */
.info-badge__label {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.info-badge__value {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-primary);
}

/* --- Step-Labels ("MATERIAL", "UPLOAD & MASSE") --- */
.tp-sec-t {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-bold);
    color: var(--tp-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Step-Nummern (1, 2, 3) --- */
.tp-step-num {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-bold);
}

/* --- Step-Tags (WAEHLBAR / PFLICHT) --- */
.tp-sec-tag {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-medium);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Optionen (Material-Kacheln / Tiles) --- */
/* Kadence setzt button { color: #fff } — Tiles sind <button>! */
.tp-tile {
    color: var(--tp-text-primary);
}
.tp-tile-n {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-primary);
}
/* Gemini Fix #7: Beschreibung KEIN uppercase */
.tp-tile-sub {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-normal);
    color: var(--tp-text-secondary);
    text-transform: none;
}
.tp-tile-badge {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tp-tile-price {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-medium);
}

/* === Selected Tile: Hellblau BG + blauer Rand === */
.tp-tile.on {
    background-color: #edf4fb;
    border-color: #337ab7;
    color: #2d2d2d;
}
.tp-tile.on:hover {
    background-color: #e4eef7;
}
.tp-tile.on .tp-tile-n {
    color: #337ab7;
    font-size: var(--tp-text-base);
    font-weight: var(--tp-font-bold);
}
.tp-tile.on .tp-tile-sub {
    display: none;
}
.tp-tile.on .tp-tile-badge {
    background-color: #16a34a;
    color: #fff;
}
.tp-tile.on .tp-tile-price {
    color: #6b7280;
}

/* === Hover-Effekte für nicht-selected Tiles === */
.tp-tile:not(.on):hover {
    border-color: #b0b8c4;
    background-color: #fafbfc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.tp-tile:not(.on):hover .tp-tile-ico {
    background: rgba(51, 122, 183, 0.1);
}

/* --- Pill-Optionen (Buttons) --- */
.tp-pill-n {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-medium);
}
.tp-pill-pr {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-normal);
    color: var(--tp-text-secondary);
}

/* --- Incentive ("Nur noch 4 Stk. bis 59,90 EUR") --- */
.tp-sav-box__left {
    font-size: var(--tp-text-base);
    font-weight: var(--tp-font-medium);
}
.tp-sav-box__label {
    font-size: var(--tp-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tp-sav-box__amount {
    font-size: var(--tp-text-lg);
    font-weight: var(--tp-font-bold);
}

/* --- Staffelpreise (Conversion-kritisch!) --- */
.tp-t-p {
    font-size: var(--tp-text-md);
    font-weight: var(--tp-font-bold);
    font-family: var(--tp-font-mono);
    color: var(--tp-text-primary);
}
.tp-t-u {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-normal);
    color: var(--tp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tp-t-r {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-normal);
    color: var(--tp-text-secondary);
}
.tp-t-n {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Upload-Bereich --- */
.tp-upl-txt p {
    font-size: var(--tp-text-base);
    font-weight: var(--tp-font-medium);
}
.tp-upl-txt small {
    font-size: var(--tp-text-xs);
    color: var(--tp-text-secondary);
}

/* --- Datei-Cards --- */
.tp-fc-name {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-primary);
}
.tp-fc-meta {
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-normal);
    color: var(--tp-text-secondary);
}
.tp-fc-dpi {
    font-size: var(--tp-text-xs);
}
.tp-fc-price {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-bold);
    font-family: var(--tp-font-mono);
}

/* --- Spacing-Slider --- */
.tp-spacing-control__label {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-bold);
    color: var(--tp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tp-spacing-control__value {
    font-weight: var(--tp-font-bold);
    color: var(--tp-blue);
}

/* --- Nesting-Vorschau --- */
.tp-nesting-preview__title {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
/* Gemini Fix #5: secondary statt muted fuer WCAG */
.tp-nesting-preview__info {
    font-size: var(--tp-text-sm);
    color: var(--tp-text-secondary);
}
.tp-nesting-preview__footer {
    font-size: var(--tp-text-sm);
    color: var(--tp-text-primary);
}

/* --- Preis-Breakdown --- */
.tp-pl {
    font-size: var(--tp-text-sm);
    color: var(--tp-text-primary);
}
.tp-total-lbl {
    font-size: var(--tp-text-sm);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-primary);
}
/* Gemini Fix #6: Orange Text mit --tp-orange-text (AA-large) */
.tp-total-pr {
    font-size: var(--tp-text-xl);
    font-weight: var(--tp-font-bold);
    color: var(--tp-orange-text);
    font-family: var(--tp-font-mono);
}
.tp-total-vat {
    font-size: var(--tp-text-xs);
    color: var(--tp-text-secondary);
}
.tp-min-notice {
    font-size: var(--tp-text-sm);
}

/* --- CTA Button (Conversion-kritisch!) --- */
.tp-cta {
    font-size: var(--tp-text-md);
    font-weight: var(--tp-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: var(--tp-lh-tight);
}

/* --- Express-Lieferung --- */
.tp-express__body strong {
    font-size: var(--tp-text-sm);
}
.tp-express__body span {
    font-size: var(--tp-text-xs);
    color: var(--tp-text-secondary);
}
.tp-express__badge {
    font-size: var(--tp-text-sm);
}

/* --- Lieferzeit + Trust-Info --- */
.tp-delivery-info {
    font-size: var(--tp-text-xs);
    color: var(--tp-text-secondary);
}
.tp-trust {
    font-size: var(--tp-text-xs);
    color: var(--tp-text-secondary);
}

/* ================================================
   CONTENT TYPOGRAPHY (Produktbeschreibung)
   ================================================ */

/* --- H4 Headlines: JS macht Title Case --- */
.woocommerce-Tabs-panel h4,
.entry-content h4,
#tab-description h4 {
    text-transform: none;
    font-size: var(--tp-text-lg);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-primary);
    line-height: var(--tp-lh-tight);
    margin: 1.5em 0 0.5em;
}

/* --- Bullet-Listen: Labels NICHT bold --- */
.woocommerce-Tabs-panel li strong,
.entry-content li strong,
#tab-description li strong {
    font-weight: var(--tp-font-normal);
    color: var(--tp-text-primary);
}
.woocommerce-Tabs-panel li,
.entry-content li,
#tab-description li {
    color: var(--tp-text-secondary);
    font-size: var(--tp-text-base);
    line-height: var(--tp-lh-base);
}

/* --- Vergleichstabelle: Labels Title Case --- */
.woocommerce-Tabs-panel table td:first-child,
.entry-content table td:first-child,
#tab-description table td:first-child {
    text-transform: capitalize;
    font-weight: var(--tp-font-medium);
    font-size: var(--tp-text-sm);
    color: var(--tp-text-secondary);
}
.woocommerce-Tabs-panel table th,
.entry-content table th,
#tab-description table th {
    font-weight: var(--tp-font-medium);
    font-size: var(--tp-text-sm);
    color: var(--tp-text-primary);
}
/* Tabellen-Buttons: kein uppercase */
.woocommerce-Tabs-panel table a.button,
.entry-content table a.button,
#tab-description table a.button {
    text-transform: none;
    font-size: var(--tp-text-xs);
    font-weight: var(--tp-font-medium);
    letter-spacing: 0.03em;
}

/* --- Produkt-Tabs Navigation --- */
.woocommerce-tabs .tabs li a {
    text-transform: none;
    font-size: var(--tp-text-base);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-secondary);
}
.woocommerce-tabs .tabs li.active a,
.woocommerce-tabs .tabs li a:hover {
    color: var(--tp-text-primary);
    font-weight: var(--tp-font-bold);
    text-decoration: none;
}

/* ================================================
   HEADER TYPOGRAPHY
   ================================================ */
.tp-head h1 {
    font-size: var(--tp-text-md);
    font-weight: var(--tp-font-bold);
    color: var(--tp-text-primary);
}

/* ================================================
   SHOP / KATEGORIE TYPOGRAPHY
   ================================================ */
.woocommerce-loop-product__title {
    font-size: var(--tp-text-md);
    font-weight: var(--tp-font-medium);
    color: var(--tp-text-primary);
    line-height: var(--tp-lh-tight);
}
.woocommerce-Price-amount {
    font-size: var(--tp-text-base);
    font-weight: var(--tp-font-bold);
    font-family: var(--tp-font-mono);
}

/* ================================================
   ANTI-ABSCHNEID-SCHUTZ
   Mehr Platz fuer groessere Schrift in Staffel/Tiles
   ================================================ */
.tp-t {
    padding: 8px 6px;
    min-width: 0;
}
.tp-tile {
    padding: 10px 12px;
}
.info-badge {
    min-width: 0;
    flex: 1;
}

/* ================================================
   INLINE-STYLE FALLBACKS (Gemini Fix #8)
   Faengt alte inline-Farben und Mini-Fonts ab.
   ================================================ */

/* Falsche Grautoene -> primary */
[style*="color:#5c5b5b"], [style*="color: #5c5b5b"],
[style*="color:#5C5B5B"], [style*="color: #5C5B5B"],
[style*="color:#555"],    [style*="color: #555"],
[style*="color:#444"],    [style*="color: #444"],
[style*="color:#333"],    [style*="color: #333"],
[style*="color:black"],   [style*="color: black"],
[style*="color:#000"]     {
    color: var(--tp-text-primary) !important;
}

/* Mittelgrau -> secondary */
[style*="color:#666"], [style*="color: #666"],
[style*="color:#777"], [style*="color: #777"],
[style*="color:#888"], [style*="color: #888"],
[style*="color:#999"], [style*="color: #999"],
[style*="color:#aaa"], [style*="color: #aaa"],
[style*="color:#bbb"], [style*="color: #bbb"] {
    color: var(--tp-text-secondary) !important;
}

/* Zu kleine Schriften -> xs (10px) */
[style*="font-size: 10px"], [style*="font-size: 10px"],
[style*="font-size: 10px"], [style*="font-size: 10px"],
[style*="font-size: 10px"], [style*="font-size: 10px"] {
    font-size: var(--tp-text-xs) !important;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .tp-total-pr {
        font-size: var(--tp-text-lg);
    }
    .tp-cta,
    .tp-trust {
        font-size: var(--tp-text-base);
    }
}
