/* Textildruck: Name, Nummer & Logo
   Anpassbar über Variablen, z. B. im Theme-CSS:
   .dnn-box { --dnn-accent: #c00; } */

.dnn-box {
    --dnn-accent: #0d6efd;
    --dnn-border: rgba(0, 0, 0, .15);
    --dnn-muted: rgba(0, 0, 0, .6);
    border: 1px solid var(--dnn-border);
    border-radius: 6px;
    padding: 1rem;
    margin: 0 0 1rem;
    width: 100%;
}
.dnn-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .75rem; }
.dnn-title { font-weight: 700; font-size: 1.05rem; }
.dnn-optional { font-size: .85rem; color: var(--dnn-muted); }

/* Tabs */
.dnn-tabs { display: flex; gap: .25rem; margin-bottom: .5rem; }
.dnn-tab {
    flex: 1 1 0; border: 1px solid var(--dnn-border); background: transparent; color: inherit;
    border-radius: 4px; padding: .45rem .5rem; font-size: .9rem; cursor: pointer;
}
.dnn-tab.is-active { font-weight: 700; border-color: var(--dnn-accent); color: var(--dnn-accent); }

/* Bühne */
.dnn-stage {
    position: relative; max-width: 440px; margin: 0 auto;
    background: #f4f4f4; border-radius: 4px; overflow: hidden;
    user-select: none; -webkit-user-select: none;
}
.dnn-side { display: none; position: relative; container-type: inline-size; }
.dnn-side.is-active { display: block; }
.dnn-side > img { display: block; width: 100%; height: auto; pointer-events: none; }
.dnn-placeholder { aspect-ratio: 1 / 1; width: 100%; }
.dnn-canvas { position: absolute; inset: 0; touch-action: none; }

/* Elemente */
.dnn-el {
    position: absolute; transform: translate(-50%, -50%);
    cursor: move; outline: none; line-height: 1; touch-action: none;
}
.dnn-el[hidden] { display: none; }
.dnn-el-text {
    display: block; white-space: nowrap; font-weight: 900; letter-spacing: .03em;
    color: var(--dnn-color, #fff);
    -webkit-text-stroke: .045em var(--dnn-stroke, #000);
    paint-order: stroke fill;
    padding: .05em .1em;
}
.dnn-el-logo img { display: block; width: 100%; height: auto; pointer-events: none; }
.dnn-el-logo-ph {
    display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1;
    border: 2px dashed var(--dnn-stroke, #000); background: rgba(255, 255, 255, .6);
    font: 700 2.4cqw/1 Arial, sans-serif; color: #000;
}
.dnn-el.is-placeholder { opacity: .45; }

/* Fadenkreuz am ausgewählten Element */
.dnn-el.is-selected { outline: 1.5px dashed var(--dnn-accent); outline-offset: 3px; }
.dnn-cross { display: none; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); pointer-events: none; }
.dnn-cross::before, .dnn-cross::after { content: ""; position: absolute; background: var(--dnn-accent); }
.dnn-cross::before { left: 50%; top: 0; bottom: 0; width: 1.5px; transform: translateX(-50%); }
.dnn-cross::after { top: 50%; left: 0; right: 0; height: 1.5px; transform: translateY(-50%); }
.dnn-el.is-selected .dnn-cross { display: block; }
.dnn-handle {
    display: none; position: absolute; right: -11px; bottom: -11px; width: 16px; height: 16px;
    background: #fff; border: 2px solid var(--dnn-accent); border-radius: 50%;
    cursor: nwse-resize; touch-action: none;
}
.dnn-el.is-selected .dnn-handle { display: block; }
.dnn-handle::after { content: ""; position: absolute; inset: -10px; } /* größere Touch-Fläche */

/* Hilfslinien über die ganze Fläche */
.dnn-guide { display: none; position: absolute; pointer-events: none; }
.dnn-canvas.has-selection .dnn-guide { display: block; }
.dnn-guide-v { top: 0; bottom: 0; width: 0; border-left: 1px dashed rgba(13, 110, 253, .55); }
.dnn-guide-h { left: 0; right: 0; height: 0; border-top: 1px dashed rgba(13, 110, 253, .55); }
.dnn-guide-center { left: 50%; top: 0; bottom: 0; width: 0; border-left: 1px solid transparent; }
.dnn-guide-center.is-snapped { border-left-color: #e8590c; }

.dnn-hint { font-size: .8rem; color: var(--dnn-muted); margin: .4rem 0 .75rem; text-align: center; }

/* Felder */
.dnn-panel { display: grid; gap: .75rem; }
.dnn-panel[hidden] { display: none; }
.dnn-field { display: block; margin: 0; }
.dnn-label { display: block; font-weight: 600; margin-bottom: .25rem; }
.dnn-price { font-style: normal; font-weight: 400; color: var(--dnn-muted); margin-left: .35rem; }
.dnn-small { display: block; color: var(--dnn-muted); font-size: .8rem; margin-top: .2rem; }
.dnn-in-font option { font-size: 1.1rem; }

.dnn-size { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.dnn-size[hidden] { display: none; }
.dnn-size-txt { font-size: .85rem; color: var(--dnn-muted); flex: 0 0 auto; }
.dnn-range { flex: 1 1 auto; accent-color: var(--dnn-accent); }
.dnn-size-label { font-size: .85rem; min-width: 7.5em; text-align: right; flex: 0 0 auto; }

.dnn-upload { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dnn-upload-btn { margin: 0; cursor: pointer; }
.dnn-upload-status { font-size: .9rem; word-break: break-all; }
.dnn-upload-remove { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 .25rem; }
.dnn-upload-remove[hidden] { display: none; }
.dnn-box.is-uploading .dnn-upload-status { opacity: .6; }
.dnn-reset { justify-self: start; padding-left: 0; }

.dnn-confirm { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; margin: .75rem 0 0; }
.dnn-confirm[hidden] { display: none; }
.dnn-confirm input { margin-top: .2rem; flex: 0 0 auto; }
.dnn-error { color: #b00020; font-size: .9rem; font-weight: 600; margin-top: .5rem; }
.dnn-error[hidden], .dnn-error:empty { display: none; }
.dnn-box.has-error { border-color: #b00020; }

.dnn-setup { margin-top: 1rem; padding: .75rem; border: 1px dashed #e8590c; border-radius: 4px; background: rgba(232, 89, 12, .05); }
.dnn-setup-out { margin-top: .5rem; font-family: monospace; font-size: .85rem; }
.dnn-setup-out[hidden] { display: none; }

/* Bildauswahl (Admin) */
.dnn-imgpick { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed #e8590c; }
.dnn-imgpick-row { display: flex; gap: .5rem; align-items: flex-start; margin: .5rem 0; }
.dnn-imgpick-label { flex: 0 0 6.5em; font-weight: 600; font-size: .9rem; padding-top: .3rem; }
.dnn-imgpick-thumbs { display: flex; flex-wrap: wrap; gap: .35rem; }
.dnn-imgpick-thumb { position: relative; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: #fff; cursor: pointer; overflow: hidden; }
.dnn-imgpick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dnn-imgpick-thumb span { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 3px; }
.dnn-imgpick-thumb.is-active { border-color: #e8590c; box-shadow: 0 0 0 2px rgba(232, 89, 12, .3); }
.dnn-imgpick-msg:empty { display: none; }

/* Farbauswahl */
.dnn-swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.dnn-swatch {
    width: 32px; height: 32px; padding: 0; border-radius: 50%; cursor: pointer;
    background: var(--sw-fill); border: 4px solid var(--sw-stroke);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
}
.dnn-swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--dnn-accent); }
.dnn-color-name { font-size: .85rem; }

/* Shop-Logo-Option */
.dnn-shoplogo-opt {
    display: flex; gap: .6rem; align-items: center; margin: 1rem 0 0; padding: .6rem .75rem;
    border: 1px solid var(--dnn-border); border-radius: 6px; background: rgba(46, 125, 50, .06);
    font-weight: 600; font-size: .95rem; cursor: pointer;
}
.dnn-shoplogo-opt input { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; }
.dnn-shoplogo-thumb { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.dnn-price.is-discount { color: #2e7d32; font-weight: 600; }
.dnn-el-shoplogo .dnn-el-logo img { width: 100%; height: auto; display: block; }

.dnn-shoplogo-wrap { margin: 1rem 0 .25rem; }
.dnn-shoplogo-wrap .dnn-shoplogo-opt { margin: 0; }
.dnn-shoplogo-opts { padding: .5rem .75rem 0; }
.dnn-shoplogo-opts[hidden] { display: none; }
.dnn-shoplogo-sides { display: flex; gap: 1rem; font-size: .9rem; }
.dnn-shoplogo-side { display: flex; gap: .35rem; align-items: center; margin: 0; cursor: pointer; }
