.tsdmg-front-app { max-width: 1300px; margin: 0 auto; }
.tsdmg-front-loading { padding: 60px; text-align: center; color: #999; font-size: 14px; }

.tsdmg-front-types {
    display: flex; gap: 10px; margin-bottom: 18px; width: 100%; max-width: 480px;
}
/* v2.7.2: zwei echte Buttons (Rand + Icon + Unterzeile), aktiver gefuellt */
.tsdmg-front-type {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 60px; box-sizing: border-box; padding: 0 10px;
    border: 2px solid currentColor; border-radius: 12px; background: transparent; color: #111; /* v2.7.3: transparent statt weiss - Dunkelmodus dreht nur die Schrift */
    cursor: pointer; transition: background .15s, color .15s;
}
.tsdmg-front-type svg { width: 22px; height: 22px; flex: none; }
.tsdmg-front-type i { font-style: normal; text-align: left; }
.tsdmg-front-type b { display: block; font-size: 15px; font-weight: 700; line-height: 1.15; }
.tsdmg-front-type small { display: block; font-size: 11.5px; font-weight: 500; line-height: 1.2; margin-top: 2px; }
.tsdmg-front-type.active { background: #111; color: #fff; }
/* v2.7.3 (Micha: Desktop maßlos übertrieben) - Desktop kompakt, Mobil bleibt wie es ist */
@media (min-width: 701px) {
    .tsdmg-front-types { width: auto; max-width: none; gap: 8px; }
    .tsdmg-front-type { flex: none; height: 46px; padding: 0 16px; gap: 8px; border-radius: 10px; }
    .tsdmg-front-type svg { width: 18px; height: 18px; }
    .tsdmg-front-type b { font-size: 13.5px; }
    .tsdmg-front-type small { font-size: 11px; margin-top: 1px; }
}

/* v2.7.267 (Micha: Sidebar-Layout wie Shirttuning.de statt Pillen-Leiste) */
/* v1.10.0 (Micha: Gap zum Grid war auf Desktop viel zu gross) 32px -> 18px,
   Sidebar-Breite leicht verkleinert (300px -> 260px). */
.tsdmg-front-body { display: flex; gap: 18px; align-items: flex-start; }

.tsdmg-front-sidebar {
    width: 260px; flex-shrink: 0; position: relative;
}

/* v1.10.0: Dropdown-Toggle - nur auf Mobile sichtbar (siehe Media Query),
   auf Desktop bleibt die klassische Sidebar-Liste unveraendert. */
.tsdmg-front-cats-toggle { display: none; }
.tsdmg-front-sidebar-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 17px; font-weight: 700; color: #111; margin-bottom: 14px; padding-left: 2px;
}
.tsdmg-front-sidebar-title svg { flex-shrink: 0; color: #0b6e6e; }
.tsdmg-front-cats {
    display: flex; flex-direction: column; border-top: 1px solid #eee;
}
.tsdmg-front-cat {
    padding: 14px 6px; font-size: 16px; color: #333; cursor: pointer;
    border-bottom: 1px solid #eee; transition: color .12s;
}
.tsdmg-front-cat:hover { color: #111; }
.tsdmg-front-cat.active { color: #0b6e6e; font-weight: 700; }

.tsdmg-front-main { flex: 1; min-width: 0; }

.tsdmg-front-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tsdmg-front-card {
    cursor: pointer; border-radius: 12px; overflow: hidden; background: #26282c;
    transition: transform .15s, box-shadow .15s; text-align: center;
}
.tsdmg-front-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
/* v2.7.265: fester Hintergrund entfernt - wird jetzt dynamisch pro Bild per
   JS gesetzt (tsdmgApplyThumbBg in front.js, Helligkeits-Analyse), exakt wie
   im Shirtdesigner-CM selbst schon geloest. Neutrales Grau nur als kurzer
   Platzhalter, bis das Bild geladen ist. */
.tsdmg-front-card-img {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    background: #ccc; position: relative;
}
.tsdmg-front-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
/* v2.7.270 (Micha: wie bei Shirttuning.de - kleiner Badge in der Kachel-Ecke
   zeigt dem Kunden, dass Motiv/Vorlage anpassbar ist, nimmt Unsicherheit
   vorm Klicken). Eckig mit abgerundeten Ecken, Pinsel-Icon. */
.tsdmg-front-edit-badge {
    position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
    background: #fff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center; color: #111;
}
.tsdmg-front-card-title { padding: 8px 6px 12px; font-size: 12.5px; color: #eee; }

.tsdmg-front-empty { padding: 50px; text-align: center; color: #999; }

.tsdmg-front-more-wrap { text-align: center; margin-top: 26px; }
.tsdmg-front-more-btn {
    padding: 11px 28px; border-radius: 24px; border: 1px solid #ddd; background: #fff;
    color: #111; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.tsdmg-front-more-btn:hover { border-color: #111; }
.tsdmg-front-more-btn:disabled { opacity: .6; cursor: default; }

@media (max-width: 700px) {
    /* v1.10.0 (Micha: Wrap-Pillen fressen bei 15 Kategorien den ganzen
       Bildschirm, man sieht kein Motiv mehr. Seitliches Wischen wurde 6x
       versucht und war nie stabil. Loesung: Dropdown-Button oeffnet ein
       Panel UEBER dem Grid, das Grid selbst bleibt immer sofort sichtbar. ) */
    .tsdmg-front-body { flex-direction: column; }
    .tsdmg-front-sidebar { width: 100%; }
    .tsdmg-front-sidebar-title { display: none; }

    .tsdmg-front-cats-toggle {
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        padding: 12px 16px; border: 1px solid #ddd; border-radius: 14px;
        background: #fff; font-size: 14px; font-weight: 600; color: #111;
        cursor: pointer; margin-bottom: 12px;
    }
    .tsdmg-front-cats-toggle-chevron { flex-shrink: 0; transition: transform .15s; }
    .tsdmg-front-sidebar.tsdmg-open .tsdmg-front-cats-toggle-chevron { transform: rotate(180deg); }

    .tsdmg-front-cats {
        display: none; flex-direction: column; border-top: none;
        position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
        background: #fff; border-radius: 14px; border: 1px solid #eee;
        box-shadow: 0 12px 28px rgba(0,0,0,.16); padding: 6px;
        max-height: 60vh; overflow-y: auto;
    }
    .tsdmg-front-sidebar.tsdmg-open .tsdmg-front-cats { display: flex; }
    .tsdmg-front-cat {
        padding: 12px 12px; border-bottom: 1px solid #f0f0f0; border-radius: 10px;
    }
    .tsdmg-front-cat:last-child { border-bottom: none; }
    .tsdmg-front-cat.active { background: #111; color: #fff; font-weight: 700; }
    .tsdmg-front-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px; } /* v2.7.2: 2 pro Zeile */
}

/* 17.08. (Micha: "vorne oder hinten drauf beim Auswaehlen fragen, versteht jeder") -
   kleines Vorne/Hinten-Modal, erscheint bei Kartenklick statt direkt zum Designer zu
   springen. */
#tsdmgf-side-ov {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
}
#tsdmgf-side-ov.tsdmgf-side-open { display: flex; }
#tsdmgf-side-panel {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    text-align: center;
}
#tsdmgf-side-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 14px;
}
#tsdmgf-side-choices {
    display: flex;
    gap: 12px;
}
.tsdmgf-side-choice {
    cursor: pointer;
    padding: 16px 28px;
    border-radius: 10px;
    border: 2px solid #eee;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    transition: border-color .15s, background .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.tsdmgf-side-choice:hover { border-color: #111; background: #f7f7f7; }
