/* T-Shirt Designer v12 */

#tsd-designer-wrapper {
    margin: 30px 0 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --acc: #e94560;
    --border: #ddd;
    color: #222;
}

/* LAYOUT */
.tsd-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
@media (max-width: 768px) { .tsd-layout { flex-direction: column; } }

/* CANVAS – groß */
.tsd-canvas-wrap {
    flex: 2 1 auto;
    max-width: 680px;
    min-width: 0;
}
.tsd-canvas-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: transparent;
}
.tsd-canvas-container > div:not(.tsd-side-thumb) {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
}
.tsd-canvas-container canvas {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* SIDEBAR */
.tsd-sidebar {
    width: 340px;
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
@media (max-width: 768px) { .tsd-sidebar { width: 100%; flex: none; } }

/* UPLOAD */
.tsd-upload-zone {
    min-height: 64px;
    border: 2px dashed var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    cursor: pointer;
    background: #fafafa;
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
}
.tsd-upload-zone:hover, .tsd-upload-zone.drag-over {
    border-color: var(--acc); background: #fff5f7;
}
.tsd-upload-zone svg { width: 22px; height: 22px; fill: #555; }
.tsd-upload-zone span { font-size: 13px; color: #444; font-weight: 500; }

.tsd-progress-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.tsd-progress-fill { height: 100%; background: var(--acc); animation: tsd-prog 1s linear infinite; }
@keyframes tsd-prog { 0%{width:0%} 50%{width:70%} 100%{width:90%} }

/* TEXT INPUT */
#tsd-text-input {
    height: 46px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}
#tsd-text-input:focus { outline: none; border-color: var(--acc); }
#tsd-text-input::placeholder { color: #555; opacity: 1; }

/* SELECT */
#tsd-font-family {
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* SLIDER LABELS */
.tsd-row-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
    margin-bottom: -2px;
    margin-top: 6px;
}
input[type="range"] {
    width: 100%;
    height: 16px;
    margin: 0;
    accent-color: var(--acc);
}

/* FARBFELDER – viereckig */
.tsd-color-presets {
    display: flex;
    gap: 0;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 6px 0;
    width: 100%;
}
.tsd-color-dot {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.18) !important;
    transition: transform .15s, box-shadow .15s;
    display: block !important;
    margin: 0 2px !important;
}
#tsd-designer-wrapper span.tsd-color-dot,
#tsd-designer-wrapper .tsd-color-dot {
    border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
}
.tsd-color-dot:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 0 0 2px var(--acc) !important;
}
.tsd-color-dot.active {
    transform: scale(1.1) !important;
    box-shadow: 0 0 0 2px var(--acc), 0 0 0 4px rgba(233,69,96,0.2) !important;
    border-color: #fff !important;
}

/* EFFEKT-BUTTONS */
.tsd-effect-row { display: flex; gap: 5px; padding-top: 2px; }
.tsd-effect-btn {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 12px; font-weight: 600;
    color: #555; transition: all .15s;
    padding: 0;
}
.tsd-effect-btn:hover { border-color: var(--acc); color: var(--acc); }
.tsd-effect-btn.active { background: var(--acc); border-color: var(--acc); color: #fff; }

/* UNDO */
.tsd-btn-undo {
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 12px; font-weight: 600;
    color: #555; width: 100%;
    transition: all .15s;
    margin-top: 4px;
}
.tsd-btn-undo:hover { border-color: var(--acc); color: var(--acc); }

/* WOOCOMMERCE IN SIDEBAR */
#tsd-wc-slot {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    width: 100%;
    box-sizing: border-box;
}
#tsd-wc-slot .cart,
#tsd-wc-slot form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
}
#tsd-wc-slot .single_add_to_cart_button {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
#tsd-wc-slot .quantity { flex: 0 0 auto !important; }

/* FLATSOME-FIX */
body.tsd-active .woocommerce-product-gallery { display: none !important; }
body.tsd-active .product .col-left,
body.tsd-active .product .product-images { display: none !important; }
body.tsd-active .product .col-right,
body.tsd-active .product .entry-summary,
body.tsd-active .product div.summary {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
    padding-left: 0 !important;
}

/* MOBILE */
@media (max-width: 600px) {
    .tsd-canvas-container { width: 100% !important; padding-bottom: 100% !important; }
    .tsd-canvas-wrap { width: 100% !important; max-width: 100% !important; }
}

/* SPINNER */
.tsd-loading {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 10;
}
.tsd-spinner {
    width: 28px; height: 28px;
    border: 3px solid #eee; border-top-color: var(--acc);
    border-radius: 50%; animation: tsd-spin .7s linear infinite;
}
@keyframes tsd-spin { to { transform: rotate(360deg); } }

/* Pulsierender Farb-Badge über färbbarer Grafik */
.tsd-color-badge {
    position: absolute;
    z-index: 999;
    background: #e94560;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: tsd-pulse-badge 1.4s ease-in-out infinite;
}
.tsd-color-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #e94560;
    border-bottom: none;
}
@keyframes tsd-pulse-badge {
    0%, 100% { transform: scale(1);   box-shadow: 0 2px 8px rgba(233,69,96,0.4); }
    50%       { transform: scale(1.08); box-shadow: 0 4px 16px rgba(233,69,96,0.7); }
}

/* ================================================================
   SEITEN-THUMBNAIL (Vorne/Hinten umschalten) – v2.16
================================================================ */
.tsd-side-thumb {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    width: 64px !important;
    z-index: 20 !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
    background: #ccc !important;
    transition: transform .15s !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}
.tsd-side-thumb:hover {
    transform: scale(1.07) !important;
    box-shadow: 0 3px 14px rgba(0,0,0,0.5) !important;
}
.tsd-side-thumb img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}
.tsd-side-thumb-placeholder {
    width: 100% !important;
    aspect-ratio: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #888 !important;
    font-size: 20px !important;
    background: #e8e8e8 !important;
}
.tsd-side-thumb span {
    display: block !important;
    text-align: center !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    background: rgba(0,0,0,0.6) !important;
    padding: 2px 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
