/* Shirt Designer Pro — Fullscreen (MonkeyMerch-Stil) v1.1 */

/* ── Reset ─────────────────────────────────────────── */
.sdp-fs *, .sdp-fs *::before, .sdp-fs *::after { box-sizing:border-box; margin:0; padding:0; }
.sdp-fs {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px; color: #2c2c2c; line-height: 1.5;
    position: fixed; inset: 0; z-index: 99999;
    display: flex; flex-direction: column;
    background: #EDECEA; overflow: hidden;
}

/* ── TOP BAR ────────────────────────────────────────── */
.sdp-topbar {
    flex-shrink: 0; height: 60px; background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; padding: 0 24px; gap: 24px;
    z-index: 10; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sdp-topbar__logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sdp-logo-icon { color: #1a1a2e; flex-shrink: 0; }
.sdp-logo-text { font-size: 15px; font-weight: 800; color: #1a1a2e; letter-spacing:.01em; white-space:nowrap; }
.sdp-logo-sub { font-weight: 400; color: #888; }

.sdp-product-tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.sdp-product-tab {
    background: none; border: 1.5px solid #ddd; border-radius: 6px;
    padding: 7px 18px; font-size: 13.5px; font-weight: 500; color: #555;
    cursor: pointer; transition: border-color .15s, color .15s, background .15s;
    font-family: inherit; letter-spacing:.01em;
}
.sdp-product-tab:hover, .sdp-product-tab.active { border-color: #1a1a2e; color: #1a1a2e; }
.sdp-product-tab.active { background: #f4f5fa; font-weight: 700; }

.sdp-topbar__actions { display: flex; gap: 10px; flex-shrink: 0; }
.sdp-topbar-btn {
    border-radius: 6px; padding: 8px 18px; font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: background .15s, transform .1s;
    font-family: inherit; white-space: nowrap; letter-spacing:.01em;
}
.sdp-topbar-btn--outline { background:#fff; border: 1.5px solid #1a1a2e; color: #1a1a2e; }
.sdp-topbar-btn--outline:hover { background: #f4f5fa; }
.sdp-topbar-btn--primary { background: #7D5A1E; border: none; color: #fff; }
.sdp-topbar-btn--primary:hover { background: #6a4c18; }
.sdp-topbar-btn--primary:active { transform: translateY(1px); }
.sdp-topbar-btn.sdp-btn--sm { padding: 6px 12px; font-size: 12px; }

/* ── STAGE ──────────────────────────────────────────── */
.sdp-stage {
    flex: 1; min-height: 0; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

/* Farbswatches links */
.sdp-stage__colors {
    position: absolute; left: 24px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 8px; z-index: 5;
}
.sdp-stage__swatch {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2.5px solid transparent; cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .15s, border-color .15s; outline: none;
}
.sdp-stage__swatch:hover { transform: scale(1.15); }
.sdp-stage__swatch.active { border-color: #1a1a2e; box-shadow: 0 0 0 3px rgba(26,26,46,.15); }

/* Canvas + Shirt */
.sdp-stage__canvas-wrap {
    position: relative; max-height: calc(100% - 20px);
    display: flex; align-items: center; justify-content: center;
}
.sdp-shirt-bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
}
.sdp-shirt-bg svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 24px rgba(0,0,0,.12)); }
#sdp-canvas { position: relative; z-index: 1; display: block; background: transparent; }

/* ── PROPERTIES PANEL (schwebend rechts) ───────────── */
.sdp-props-panel {
    position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
    width: 250px; background: #fff; border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
    padding: 20px; z-index: 10;
    max-height: calc(100% - 32px); overflow-y: auto;
}
.sdp-props-panel__empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 16px 0; color: #bbb; font-size: 13px; text-align: center;
}
.sdp-props-panel__title { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 16px; }

.sdp-props-input {
    width: 100%; border: 1.5px solid #e0e2e8; border-radius: 8px;
    padding: 9px 12px; font-size: 14px; font-family: inherit;
    color: #1a1a2e; background: #fff; margin-bottom: 12px;
    transition: border-color .15s; outline: none;
}
.sdp-props-input:focus { border-color: #1a1a2e; }
.sdp-props-select-wrap { position: relative; }
.sdp-props-select { appearance: none; padding-right: 32px; cursor: pointer; }
.sdp-select-chevron {
    position: absolute; right: 10px; top: 50%; transform: translateY(-60%);
    pointer-events: none; color: #888;
}
.sdp-props-range { width: 100%; accent-color: #1a1a2e; cursor: pointer; }
.sdp-props-size-label { font-size: 14px; font-weight: 700; color: #1a1a2e; min-width: 28px; }
.sdp-props-size-unit { font-size: 12px; color: #888; }

.sdp-props-colors { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.sdp-props-color {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .12s, border-color .12s;
    position: relative; flex-shrink: 0; display: flex; align-items:center; justify-content:center;
}
.sdp-props-color:hover { transform: scale(1.15); }
.sdp-props-color.active { border-color: #1a1a2e; box-shadow: 0 0 0 3px rgba(26,26,46,.12); }
.sdp-props-color--white { border-color: #ddd !important; }
.sdp-props-color--white.active { border-color: #1a1a2e !important; }
.sdp-props-color--picker { background: #f4f5f7 !important; color: #888; cursor: pointer; }

.sdp-props-btn-group { display: flex; border: 1.5px solid #e0e2e8; border-radius: 8px; overflow: hidden; }
.sdp-props-btn {
    background: #fff; border: none; padding: 7px 10px; font-size: 13px;
    cursor: pointer; color: #555; transition: background .12s, color .12s;
    font-family: inherit; line-height: 1;
}
.sdp-props-btn + .sdp-props-btn { border-left: 1px solid #e0e2e8; }
.sdp-props-btn:hover { background: #f4f5f7; }
.sdp-props-btn.active { background: #1a1a2e; color: #fff; }
.sdp-props-btn--wide {
    flex: 1; background: #f4f5f7; border: 1.5px solid #e0e2e8;
    border-radius: 8px; padding: 8px 10px; font-size: 12px;
    cursor: pointer; transition: background .12s; font-family: inherit;
}
.sdp-props-btn--wide:hover { background: #e8eaed; }
.sdp-props-btn--ai {
    background: linear-gradient(135deg, #1a1a2e, #e94560);
    color: #fff !important; border: none !important;
    padding: 9px 14px; border-radius: 8px; font-size: 13px;
    cursor: pointer; width: 100%; font-family: inherit;
}

.sdp-props-divider { height: 1px; background: #f0f0f0; margin: 14px 0; }
.sdp-props-delete {
    background: none; border: none; color: #e94560; font-size: 13px;
    font-weight: 600; cursor: pointer; padding: 0; font-family: inherit;
}
.sdp-props-delete:hover { text-decoration: underline; }

.sdp-props-xywh { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.sdp-props-coord {
    display: flex; align-items: center; gap: 4px;
    border: 1.5px solid #e0e2e8; border-radius: 6px; padding: 5px 8px;
}
.sdp-props-coord label { font-size: 11px; color: #999; font-weight: 600; width: 12px; flex-shrink: 0; }
.sdp-props-coord-input { border: none; outline: none; width: 100%; font-size: 12px; font-family: inherit; color: #1a1a2e; }

/* ── BOTTOM BAR ────────────────────────────────────── */
.sdp-bottombar {
    flex-shrink: 0; display: flex; justify-content: center;
    padding: 12px 20px 20px; pointer-events: none;
    position: relative; z-index: 10;
}
.sdp-bottombar__pill {
    background: rgba(26,26,30,.92); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); border-radius: 40px;
    padding: 10px 16px; display: flex; align-items: center; gap: 4px;
    pointer-events: all; box-shadow: 0 8px 32px rgba(0,0,0,.35);
    max-width: 900px; width: 100%; justify-content: center;
}
.sdp-bb-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; color: rgba(255,255,255,.75); cursor: pointer;
    padding: 6px 12px; border-radius: 10px;
    transition: background .15s, color .15s; font-family: inherit; white-space: nowrap;
}
.sdp-bb-btn span { font-size: 11px; font-weight: 500; }
.sdp-bb-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sdp-bb-btn.active { background: rgba(255,255,255,.12); color: #fff; }
.sdp-bb-btn--ai { color: #f0a0b0; }
.sdp-bb-btn--ai:hover { color: #fff; background: rgba(233,69,96,.25); }
.sdp-bb-divider { width: 1px; height: 32px; background: rgba(255,255,255,.15); margin: 0 6px; flex-shrink: 0; }
.sdp-bb-sides { display: flex; background: rgba(255,255,255,.1); border-radius: 20px; overflow: hidden; flex-shrink: 0; }
.sdp-bb-side {
    background: none; border: none; color: rgba(255,255,255,.6);
    padding: 8px 16px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s;
    font-family: inherit; white-space: nowrap;
}
.sdp-bb-side.active { background: #fff; color: #1a1a2e; font-weight: 700; border-radius: 20px; }
.sdp-bb-side:not(.active):hover { color: #fff; }

/* ── LAYERS PANEL ──────────────────────────────────── */
.sdp-layers-panel {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
    width: 260px; background: #fff; border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18); z-index: 20; overflow: hidden;
}
.sdp-layers-panel__header {
    background: #1a1a2e; color: #fff; padding: 10px 14px;
    font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between;
}
.sdp-layers-panel__close { background: none; border: none; color: rgba(255,255,255,.7); font-size: 18px; cursor: pointer; }
.sdp-layers-panel__close:hover { color: #fff; }
.sdp-layers-action {
    background: rgba(255,255,255,.12); border: none; color: #fff;
    border-radius: 5px; width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s;
}
.sdp-layers-action:hover { background: rgba(255,255,255,.22); }
.sdp-layers-action--danger:hover { background: #e94560; }
.sdp-layers-panel__list { max-height: 200px; overflow-y: auto; padding: 6px; }
.sdp-layer-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 8px;
    border-radius: 6px; cursor: pointer; font-size: 12px;
    border: 1px solid transparent; transition: background .12s;
}
.sdp-layer-item:hover { background: #f4f5f7; }
.sdp-layer-item.sdp-active { background: #eef0ff; border-color: #b0beff; }
.sdp-layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdp-layer-actions button { background: none; border: none; cursor: pointer; font-size: 13px; opacity: .5; padding: 0 2px; }
.sdp-layer-actions button:hover { opacity: 1; }

/* ── MODALS ─────────────────────────────────────────── */
.sdp-ai-modal, .sdp-gallery-modal, .sdp-mockup-modal {
    display: none; position: fixed; inset: 0; z-index: 100010;
    align-items: center; justify-content: center; padding: 24px 16px;
}
.sdp-ai-modal { background: rgba(0,0,0,.55); }
.sdp-gallery-modal { background: rgba(0,0,0,.55); align-items: flex-start; padding-top: 60px; }
.sdp-mockup-modal { background: rgba(0,0,0,.8); }

.sdp-ai-modal__inner {
    background: #fff; border-radius: 16px; width: 100%; max-width: 460px;
    box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; position: relative; z-index: 1;
}
.sdp-ai-modal__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.sdp-ai-modal__header h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.sdp-ai-modal__body { padding: 20px; }
.sdp-ai-modal__body label { font-size: 13px; color: #666; display: block; margin-bottom: 8px; }
.sdp-ai-modal__footer { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sdp-textarea {
    width: 100%; border: 1.5px solid #e0e2e8; border-radius: 8px;
    padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
    transition: border-color .15s; outline: none;
}
.sdp-textarea:focus { border-color: #1a1a2e; }
.sdp-modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #aaa; transition: color .15s; padding: 0 4px; }
.sdp-modal-close:hover { color: #1a1a2e; }
.sdp-suggestion-chip {
    background: #f4f5f7; border: 1px solid #e0e2e8; border-radius: 8px;
    padding: 8px 12px; font-size: 13px; cursor: pointer;
    text-align: left; transition: background .12s; font-family: inherit; display: block; width: 100%; margin-bottom: 6px;
}
.sdp-suggestion-chip:hover { background: #e8eeff; border-color: #b0beff; }

.sdp-gallery-modal__inner {
    background: #fff; border-radius: 16px; width: 100%; max-width: 820px;
    max-height: 80vh; display: flex; flex-direction: column;
    overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.3); position: relative; z-index: 1;
}
.sdp-gallery-modal__header {
    background: #1a1a2e; color: #fff; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.sdp-gallery-modal__header h3 { font-size: 15px; font-weight: 700; color: #fff; }
.sdp-gallery-modal__actions { display: flex; align-items: center; gap: 8px; }
.sdp-gallery-modal__header .sdp-modal-close { color: rgba(255,255,255,.6); font-size: 24px; }
.sdp-gallery-modal__header .sdp-modal-close:hover { color: #fff; }
.sdp-gallery-modal__body { flex: 1; overflow-y: auto; padding: 20px; }
.sdp-gallery-status { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: #aaa; font-size: 14px; }
.sdp-mini-spinner { width: 22px; height: 22px; border: 3px solid #eee; border-top-color: #1a1a2e; border-radius: 50%; animation: sdp-spin .7s linear infinite; flex-shrink: 0; }
.sdp-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.sdp-gallery-card { border: 2px solid #e8eaed; border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s; position: relative; background: #fff; }
.sdp-gallery-card:hover, .sdp-gallery-card:focus { border-color: #1a1a2e; box-shadow: 0 4px 18px rgba(26,26,46,.18); transform: translateY(-2px); outline: none; }
.sdp-gallery-card__thumb { width: 100%; aspect-ratio: 5/6; background: #f4f5f7; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sdp-gallery-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sdp-gallery-card__no-thumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.sdp-gallery-card__info { padding: 8px 10px; }
.sdp-gallery-card__title { font-size: 12px; font-weight: 600; color: #2c2c2c; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdp-gallery-card__date { font-size: 11px; color: #999; display: block; }
.sdp-gallery-card__delete { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 14px; line-height: 1; cursor: pointer; display: none; align-items: center; justify-content: center; }
.sdp-gallery-card:hover .sdp-gallery-card__delete { display: flex; }
.sdp-gallery-card__delete:hover { background: #e94560; }

.sdp-gallery-modal__backdrop, .sdp-ai-modal__backdrop, .sdp-mockup-modal__backdrop { position: fixed; inset: 0; z-index: -1; cursor: pointer; }

.sdp-mockup-modal__inner {
    background: #0e0e1e; border-radius: 16px; width: 100%; max-width: 780px;
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 32px 100px rgba(0,0,0,.8); border: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1;
}
.sdp-mockup-modal__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); gap: 10px; }
.sdp-mockup-modal__header h3 { font-size: 15px; font-weight: 700; color: #fff; }
.sdp-mockup-modal__controls { display: flex; align-items: center; gap: 8px; }
.sdp-mockup-modal .sdp-modal-close { color: rgba(255,255,255,.5); font-size: 24px; }
.sdp-mockup-modal .sdp-modal-close:hover { color: #fff; }
.sdp-mockup-modal__body { flex: 1; min-height: 0; }
.sdp-mockup-container { width: 100%; height: 520px; cursor: grab; user-select: none; }
.sdp-mockup-container:active { cursor: grabbing; }
.sdp-mockup-container canvas { display: block; }
.sdp-btn--mockup-side {
    background: rgba(255,255,255,.1) !important; color: rgba(255,255,255,.7) !important;
    border: 1px solid rgba(255,255,255,.15) !important; border-radius: 20px !important;
    padding: 6px 14px !important; font-size: 12px !important; white-space: nowrap;
}
.sdp-btn--mockup-side.active { background: #e94560 !important; color: #fff !important; border-color: #e94560 !important; }

/* ── Loading ────────────────────────────────────────── */
.sdp-loading-overlay {
    display: none; position: fixed; inset: 0; background: rgba(255,255,255,.8);
    z-index: 200000; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.sdp-spinner { width: 44px; height: 44px; border: 4px solid #e0e2e6; border-top-color: #1a1a2e; border-radius: 50%; animation: sdp-spin .75s linear infinite; }
@keyframes sdp-spin { to { transform: rotate(360deg); } }
.sdp-loading-overlay p { font-size: 14px; color: #555; font-weight: 500; }

/* ── Notices ────────────────────────────────────────── */
.sdp-notice {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(16px);
    background: #1a1a2e; color: #fff; padding: 10px 22px; border-radius: 24px;
    font-size: 14px; font-weight: 500; opacity: 0; z-index: 300000; pointer-events: none;
    transition: opacity .3s, transform .3s; white-space: nowrap;
}
.sdp-notice.sdp-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sdp-notice--error { background: #c0392b; }
.sdp-notice--success { background: #22a55a; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 820px) {
    .sdp-props-panel { display: none; }
    .sdp-stage__colors { left: 8px; }
    .sdp-topbar { padding: 0 12px; gap: 10px; }
    .sdp-logo-text { display: none; }
    .sdp-product-tab { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 560px) {
    .sdp-topbar__actions .sdp-topbar-btn--outline { display: none; }
    .sdp-bb-btn span { display: none; }
    .sdp-bb-btn { padding: 8px; }
    .sdp-mockup-container { height: 340px; }
}

/* ── 2D Produkt-Vorschau ────────────────────────────── */
.sdp-mockup-2d-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.sdp-mockup-2d-shirt {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}
.sdp-mockup-2d-design {
    position: absolute;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: .92;
}
/* Weißes Shirt: multiply macht das Design korrekt sichtbar.
   Dunkle Shirts: screen-Modus wäre besser – JS kann das per Farbhelligkeit steuern */
.sdp-mockup-modal__body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f4f4f6;
}
#sdp-mockup-container {
    width: 100%;
    max-width: 520px;
    height: auto;
    cursor: default;
}
