/**
 * Klingelschild Konfigurator V8
 * Mit realistischem Glanzeffekt
 */

/* Web Fonts für Schriftart-Vorschau */
@font-face { font-family: 'Robot'; src: url('/assets/fonts/RobotoCondensed-Light.ttf') format('truetype'); }
@font-face { font-family: 'Chroma'; src: url('/assets/fonts/Michroma-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Mountain'; src: url('/assets/fonts/Mandala Regular.otf') format('opentype'); }
@font-face { font-family: 'Ralway'; src: url('/assets/fonts/Raleway-Light.ttf') format('truetype'); }
@font-face { font-family: 'Merdock'; src: url('/assets/fonts/Merriweather-Light.ttf') format('truetype'); }
@font-face { font-family: 'Style'; src: url('/assets/fonts/Stylish.otf') format('opentype'); }

:root {
    --white: #ffffff;
    --black: #171a20;
    --gray-50: #f4f4f4;
    --gray-100: #e8e8e8;
    --gray-200: #d6d6d6;
    --gray-300: #b3b3b3;
    --gray-400: #8c8c8c;
    --gray-500: #6e6e6e;
    --gray-600: #5c5c5c;
    --gray-700: #393c41;
    --gray-800: #222222;
    --gray-900: #171a20;
    --accent: #3e6ae1;
    --accent-light: #5c83e6;
    --accent-dark: #2d52b8;
    --success: #12b76a;
    --warning: #f79009;
    --error: #f04438;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--white);
    min-height: 100vh;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-100);
}

.logo { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.2em; color: var(--black); }
.nav { display: flex; gap: var(--space-lg); }
.nav-item { font-size: 0.875rem; font-weight: 500; color: var(--gray-600); cursor: pointer; transition: color var(--transition-fast); }
.nav-item:hover, .nav-item.active { color: var(--black); }

/* Main */
.main { display: flex; flex-direction: column; flex: 1; padding-top: 60px; }

/* Desktop: Preview links, Config rechts */
@media (min-width: 1024px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }
    #app {
        height: 100%;
        min-height: auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .main {
        flex-direction: row;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    .preview-section {
        flex: 0 0 55%;
        max-width: 55%;
        height: 100%;
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .preview-section .preview-stage {
        width: 100%;
        height: 100%;
        overflow: auto;
    }
    .config-section {
        flex: 0 0 45%;
        max-width: 45%;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-top: none;
        border-left: 1px solid var(--gray-100);
    }
    .config-section .config-tabs {
        flex-shrink: 0;
    }
    .config-section .config-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    .config-section .price-bar {
        flex-shrink: 0;
        background: var(--white);
        z-index: 10;
        margin-top: 0;
        padding: var(--space-sm) 0;
        border-top: 1px solid var(--gray-100);
        box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    }
    /* Compact option groups on desktop */
    .option-group {
        padding: var(--space-sm) var(--space-md);
    }
    .option-group h3 {
        margin-bottom: var(--space-xs);
        font-size: 0.8rem;
    }
    .control-row {
        margin-bottom: 2px;
    }
    .options-container {
        gap: var(--space-sm);
    }
}

/* Preview Section */
.preview-section {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    padding: var(--space-2xl);
}

.preview-stage {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-background {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
}

.preview-background[data-bg="none"] { background: transparent; }
.preview-background[data-bg="putz-weiss"] { 
    background: url('/assets/backgrounds/putz-weiss.jpg') center/cover; 
}
.preview-background[data-bg="putz-grau"] { 
    background: url('/assets/backgrounds/putz-grau.jpg') center/cover; 
}
.preview-background[data-bg="klinker"] { 
    background: url('/assets/backgrounds/klinker.jpg') center/cover; 
}
.preview-background[data-bg="holz"] { 
    background: url('/assets/backgrounds/holz.jpg') center/cover; 
}
.preview-background[data-bg="beton"] { 
    background: url('/assets/backgrounds/beton.jpg') center/cover; 
}

.nameplate-wrapper { display: flex; align-items: center; justify-content: center; }

.nameplate {
    position: relative;
    background: var(--gray-900);
    border-radius: 4px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.nameplate.showing-dimensions {
    overflow: visible;
    margin: 50px 60px;
}

@media (max-width: 768px) {
    .nameplate.showing-dimensions {
        margin: 35px 40px;
    }
}

/* Realistischer Glanzeffekt wie im Beispielbild */
.glossy-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.nameplate.glossy .glossy-overlay {
    opacity: 1;
    /* Diagonaler Lichtstreifen - dezenter */
    background: linear-gradient(
        135deg,
        transparent 0%,
        transparent 35%,
        rgba(255, 255, 255, 0.04) 40%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        rgba(255, 255, 255, 0.04) 60%,
        transparent 65%,
        transparent 100%
    );
}

/* Löcher-Overlay */
.holes-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 15;
}

/* Bohrloch — als echtes Loch (zeigt Preview-Hintergrund) */
.hole-bore {
    position: absolute;
    border-radius: 50%;
    /* Hintergrundfarbe der Preview-Section übernehmen */
    background: var(--gray-50);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.5),
        inset 0 -1px 2px rgba(255,255,255,0.1);
    border: 1px solid rgba(30,30,30,0.8);
}

/* Auf dunklem Hintergrund */
[data-bg="putz-grau"] .hole-bore,
[data-bg="beton"] .hole-bore { background: #9a9a9a; }
[data-bg="klinker"] .hole-bore { background: #8B4513; }
[data-bg="holz"] .hole-bore { background: #c49454; }
[data-bg="putz-weiss"] .hole-bore { background: #f5f5f0; }
[data-bg="none"] .hole-bore { background: var(--gray-50); }

/* Abdeckkappe — als Bild (img-Element) */
.hole-cap {
    position: absolute;
    pointer-events: none;
    object-fit: contain;
}

/* Maße-Overlay (SVG-basiert, technische Zeichnung) */
.dimensions-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 20;
    overflow: visible;
}

.doorbell-image {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    display: none;
    object-fit: contain;
}

.doorbell-image.visible { display: block; }

.svg-container { width: 100%; height: 100%; position: relative; }
.svg-container svg { display: block; width: 100%; height: 100%; }

.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--space-xl) auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Info Badge */
.info-badge {
    position: absolute;
    top: 14px; left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    font-size: 0.75rem; font-weight: 500; color: var(--gray-600);
    z-index: 10;
    white-space: nowrap;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: var(--space-lg); left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: var(--space-sm);
    background: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

.zoom-btn {
    width: 32px; height: 32px;
    border: none; background: transparent;
    font-size: 1.25rem; font-weight: 300; color: var(--gray-600);
    cursor: pointer; border-radius: var(--radius-full);
}

.zoom-btn:hover { background: var(--gray-100); color: var(--black); }
.zoom-btn.toggle-btn { 
    width: auto; 
    font-size: 0.75rem; 
    padding: 4px 10px; 
    margin-left: 8px; 
    border-left: 1px solid var(--gray-200); 
    opacity: 0.5;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.zoom-btn.toggle-btn .btn-icon {
    width: 14px;
    height: 14px;
}
.zoom-btn.toggle-btn.active { opacity: 1; background: var(--gray-100); }
.zoom-level { font-size: 0.75rem; font-weight: 500; color: var(--gray-500); min-width: 40px; text-align: center; }

/* Preview Toggles */
.preview-toggles {
    position: absolute;
    top: var(--space-lg); right: var(--space-lg);
    display: flex; gap: var(--space-md);
}

.toggle { display: flex; align-items: center; gap: var(--space-xs); cursor: pointer; }

.toggle input {
    position: relative;
    width: 36px; height: 20px;
    appearance: none;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.toggle input::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.toggle input:checked { background: var(--accent); }
.toggle input:checked::before { transform: translateX(16px); }
.toggle-label { font-size: 0.75rem; font-weight: 500; color: var(--gray-600); }

/* Preview BG Selector */
.preview-bg-selector {
    position: absolute;
    top: var(--space-lg); right: var(--space-lg);
    display: flex; align-items: center; gap: var(--space-sm);
    background: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.bg-label { font-size: 0.7rem; font-weight: 500; color: var(--gray-500); }
.bg-buttons { display: flex; gap: 4px; }

.preview-bg-selector .bg-btn {
    width: 24px; height: 24px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--white);
    padding: 0;
}

.preview-bg-selector .bg-btn:hover { border-color: var(--gray-400); }
.preview-bg-selector .bg-btn.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(62, 106, 225, 0.2); }
.bg-icon { font-size: 0.7rem; color: var(--gray-400); }
.bg-preview { width: 16px; height: 16px; border-radius: 2px; }

/* Mobile BG Dropdown - versteckt auf Desktop */
/* Hintergrund-Dropdown Wrapper (nur mobile sichtbar) */
.bg-dropdown-wrapper {
    display: none;
    align-items: center;
    position: relative;
}

.bg-dropdown-wrapper .bg-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bg-dropdown-wrapper .bg-icon-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.5;
    stroke: var(--gray-600);
    pointer-events: none;
}

.bg-dropdown-wrapper .bg-hidden-select {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    background: transparent;
    font-size: 16px; /* prevent iOS zoom */
}

/* Config Section */
.config-section {
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    padding: 0 var(--space-xl) var(--space-lg);
}

.config-tabs {
    display: flex; gap: var(--space-xs);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--gray-100);
    overflow-x: auto;
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    border: none; background: transparent;
    font-family: inherit; font-size: 0.875rem; font-weight: 500;
    color: var(--gray-500); cursor: pointer;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.tab-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 2px;
    flex-shrink: 0;
}

.tab:hover { color: var(--gray-700); background: var(--gray-50); }
.tab.active { color: var(--white); background: var(--black); }

.config-content { padding: var(--space-lg) 0; }

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

/* Accordion Header - versteckt auf Desktop */
.accordion-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
}

.accordion-header:hover {
    background: var(--gray-100);
}

.accordion-icon {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Model Categories */
.model-categories { display: flex; flex-direction: column; gap: var(--space-xl); }

.model-category {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.category-title { margin-bottom: var(--space-md); }

.brand-logo {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
    color: var(--gray-500);
    padding: var(--space-xs) var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-sm);
}

.model-card {
    display: flex; flex-direction: column; align-items: center;
    padding: var(--space-sm);
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.model-card:hover { background: var(--gray-100); }
.model-card.selected { border-color: var(--accent); background: var(--white); }
.model-card img { width: 90px; height: 90px; object-fit: contain; margin-bottom: var(--space-xs); }
.model-card span { font-size: 0.65rem; font-weight: 500; color: var(--gray-700); text-align: center; line-height: 1.2; }

/* Design Layout */
.design-layout { display: flex; flex-direction: column; gap: var(--space-xl); }

.design-options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.option-group h3 {
    font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: var(--space-md);
}

/* Muster Grid - RESPONSIVE */
.muster-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.muster-card {
    display: flex; flex-direction: column; align-items: center;
    padding: var(--space-md);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.muster-card:hover { border-color: var(--gray-400); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.muster-card.selected { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.2); }
.muster-card img { width: 80px; height: 80px; object-fit: contain; margin-bottom: var(--space-sm); }
.muster-card .muster-name { font-size: 0.8125rem; font-weight: 600; color: var(--gray-800); text-align: center; }
.muster-card .muster-desc { font-size: 0.7rem; color: var(--gray-500); text-align: center; margin-top: var(--space-xs); }
.muster-card .muster-price { font-size: 0.7rem; color: var(--gray-500); font-weight: 500; text-align: center; margin-top: 4px; }

/* Position Visual Selector */
.position-visual-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.position-visual-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border: 2px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.position-visual-btn:hover { border-color: var(--gray-400); }
.position-visual-btn.selected { border-color: var(--accent); background: rgba(62, 106, 225, 0.05); }
.position-icon { width: 40px; height: 50px; color: var(--gray-400); }
.position-icon.landscape { width: 50px; height: 35px; }
.position-visual-btn.selected .position-icon { color: var(--accent); }
.position-visual-btn span { font-size: 0.7rem; font-weight: 500; color: var(--gray-600); }

/* Color Selector */
.color-selector { display: flex; gap: var(--space-lg); flex-wrap: wrap; }

.color-option {
    display: flex; flex-direction: column; align-items: center;
    gap: var(--space-xs); cursor: pointer;
}

.color-swatch {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    position: relative;
}

.color-swatch.glossy::after {
    content: '';
    position: absolute;
    top: 5px; left: 8px;
    width: 15px; height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: rotate(-30deg);
}

.color-option:hover .color-swatch { transform: scale(1.1); }
.color-option.selected .color-swatch { border-color: var(--accent); box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--accent); }
.color-name { font-size: 0.6875rem; font-weight: 500; color: var(--gray-500); }

/* Text Inputs */
.text-inputs { display: flex; flex-direction: column; gap: var(--space-md); }

.icon-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.text-field-enhanced {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.text-field-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm); }
.text-field-header label { font-size: 0.8125rem; font-weight: 500; color: var(--gray-700); }
.text-field-header .optional { font-weight: 400; color: var(--gray-400); }

/* Label direkt im text-field-enhanced */
.text-field-enhanced > label {
    display: block;
    font-size: 0.8125rem; 
    font-weight: 500; 
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}
.text-field-enhanced > label .optional { font-weight: 400; color: var(--gray-400); }

.expand-btn {
    width: 28px; height: 28px;
    border: none; background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.75rem;
}

.expand-btn:hover { background: var(--gray-200); }

.input-with-font { 
    display: flex; 
    gap: var(--space-sm);
    max-width: 600px; /* Begrenzte Breite für große Bildschirme */
}

.input-with-font input,
.input-with-font textarea {
    flex: 1;
    min-width: 0; /* Flex-Item kann schrumpfen */
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit; font-size: 0.9375rem;
}

.input-with-font textarea {
    min-height: 38px;
    max-height: 100px;
    resize: vertical;
    line-height: 1.4;
}

.input-with-font input:focus,
.input-with-font textarea:focus { outline: none; border-color: var(--accent); }

.font-select {
    min-width: 100px;
    max-width: 140px;
    padding: var(--space-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--white);
    flex-shrink: 0;
}

/* Mobile: Input und Font-Select untereinander */
@media (max-width: 480px) {
    .input-with-font {
        flex-direction: column;
        max-width: 100%;
    }
    .font-select {
        max-width: 100%;
        width: 100%;
    }
}

.font-select option {
    padding: 4px 8px;
    font-size: 16px;
}

.font-fixed {
    display: flex; align-items: center;
    padding: 0 var(--space-md);
    font-size: 0.8125rem; color: var(--gray-400);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.text-controls {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--gray-100);
}

.mini-control { display: flex; flex-direction: column; gap: 4px; }
.mini-control label { font-size: 0.65rem; color: var(--gray-400); }

.mini-control input[type="range"] {
    width: 100%; height: 5px;
    appearance: none;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.mini-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px; height: 22px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.mini-control input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.mini-control span { font-size: 0.65rem; color: var(--gray-500); text-align: center; }

/* Options Tab */
.options-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.option-group {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.option-group h3 {
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Unified reset button style - minimal width */
.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition-fast);
    width: fit-content;
    white-space: nowrap;
}
.reset-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.size-inputs { display: flex; align-items: flex-end; gap: var(--space-sm); }
.size-field { flex: 1; }
.size-field label { display: block; font-size: 0.75rem; color: var(--gray-500); margin-bottom: var(--space-xs); }

.size-field input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit; font-size: 0.9375rem;
    text-align: center;
}

.size-field input:focus { outline: none; border-color: var(--accent); }
.size-separator { padding-bottom: var(--space-sm); color: var(--gray-400); }
.size-hint { margin-top: var(--space-xs); font-size: 0.75rem; color: var(--gray-400); }

/* Sondergröße Slider */
.size-slider-group { display: flex; flex-direction: column; gap: 8px; }
.size-slider-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.size-slider-row label { min-width: 42px; font-size: 0.8rem; color: var(--gray-600); font-weight: 500; }
.size-slider { 
    flex: 1; 
    min-width: 100px;
    -webkit-appearance: none; 
    appearance: none; 
    height: 6px; 
    border-radius: 3px; 
    background: var(--gray-200); 
    outline: none; 
    cursor: pointer;
}
.size-slider::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    width: 26px; 
    height: 26px; 
    border-radius: 50%; 
    background: var(--accent); 
    cursor: grab; 
    border: 3px solid #fff; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.size-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}
.size-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    cursor: grab;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.size-slider-value { min-width: 60px; font-size: 0.8rem; font-weight: 600; color: var(--gray-800); text-align: right; }

/* Size input row (new simplified layout) */
.size-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.size-input-row label {
    min-width: 45px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
}
.size-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}
.size-input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    text-align: center;
}
.size-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.1);
}
.size-input::placeholder {
    color: var(--gray-400);
}
.size-unit {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Reset Sondergröße button */
.reset-sondergroesse-btn {
    padding: 6px 12px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-fast);
}
.reset-sondergroesse-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.size-category-info { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.size-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--gray-100); color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px; }
.size-badge.l { background: #dbeafe; color: #1d4ed8; }
.size-badge.xl { background: #fef3c7; color: #92400e; }
.size-badge.xxl { background: #fce7f3; color: #9d174d; }
.size-limits { font-size: 0.7rem; color: var(--gray-400); }
.size-categories-ref { font-size: 0.65rem; color: var(--gray-400); line-height: 1.4; }

/* Model search with icon */
.model-search {
    position: relative;
    margin-bottom: var(--space-md);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.1);
}

/* Text field cards (new unified design) */
.text-field-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}
.text-field-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: var(--space-sm);
}
.field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}
.field-optional {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 400;
}

/* Text field card - textarea with Schriftart below */
.text-field-card textarea,
.text-field-card input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 42px;
    margin-bottom: var(--space-sm);
}
.text-field-card textarea:focus,
.text-field-card input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.1);
}

/* Font row below textarea */
.font-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.font-row .field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}
.font-row .font-select {
    flex: 1;
    max-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
}
.font-row .font-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Befestigung - Grid Cards (same style as muster/icon) */
.befestigung-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.befestigung-card {
    cursor: pointer;
}
.befestigung-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.befestigung-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-sm);
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.befestigung-card:hover .befestigung-card-inner {
    background: var(--gray-100);
}
.befestigung-card input:checked + .befestigung-card-inner {
    border-color: var(--accent);
    background: var(--white);
}

.befestigung-img {
    width: 100%;
    max-width: 80px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.befestigung-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.3;
}
.befestigung-desc {
    font-size: 0.65rem;
    color: var(--gray-500);
}

@media (max-width: 480px) {
    .befestigung-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Offset Sliders */
.offset-sliders { display: flex; flex-direction: column; gap: var(--space-md); }
.slider-row { display: flex; align-items: center; gap: var(--space-sm); }
.slider-label { width: 20px; text-align: center; color: var(--gray-400); }

.slider-row input[type="range"] {
    flex: 1; 
    height: 6px;
    appearance: none;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 26px; height: 26px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-row input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.slider-row input[type="range"]::-moz-range-thumb {
    width: 26px; height: 26px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-value { min-width: 50px; font-size: 0.75rem; font-weight: 500; color: var(--gray-600); text-align: right; }

/* Global Text Controls (im Optionen Tab) */
.global-text-controls { display: flex; flex-direction: column; gap: var(--space-md); }
.control-row { display: flex; align-items: center; gap: var(--space-sm); }
.control-row label { min-width: 80px; font-size: 0.75rem; color: var(--gray-500); }

.slider-with-value { display: flex; align-items: center; gap: var(--space-sm); flex: 1; }

.slider-with-value input[type="range"] {
    flex: 1; height: 6px;
    appearance: none;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.slider-with-value input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 26px; height: 26px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-with-value input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.slider-with-value input[type="range"]::-moz-range-thumb {
    width: 26px; height: 26px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.value-display { font-size: 0.75rem; font-weight: 500; color: var(--gray-600); min-width: 45px; text-align: right; }

/* Price Bar */
.price-bar {
    display: flex; align-items: center; justify-content: flex-end;
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--gray-100);
    margin-top: var(--space-lg);
}

.price-details { display: flex; gap: var(--space-lg); font-size: 0.8125rem; color: var(--gray-500); }
.price-total { display: flex; flex-direction: column; align-items: flex-end; }
.price-label { font-size: 0.75rem; color: var(--gray-500); }
.price-amount { font-size: 1.5rem; font-weight: 600; color: var(--black); }
.price-vat { font-size: 0.65rem; color: var(--gray-400); margin-top: 2px; }
.vat-link { color: var(--gray-500); text-decoration: underline; }
.vat-link:hover { color: var(--accent); }

/* Desktop Share Modal */
.desktop-share-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.desktop-share-overlay.visible {
    display: flex;
}

.desktop-share-modal {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--gray-100);
}

.share-modal-title {
    font-weight: 600;
    font-size: 1rem;
}

.share-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.share-modal-close:hover {
    background: var(--gray-200);
}

.share-modal-close svg {
    width: 16px;
    height: 16px;
}

.share-modal-body {
    padding: 20px;
}

/* Shared styles for both mobile + desktop share UI */
.share-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 16px;
    text-align: left;
}

.share-preview-thumb {
    width: 56px;
    height: 56px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.share-preview-thumb img,
.share-preview-thumb svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-preview-info { flex: 1; min-width: 0; }
.share-preview-title { font-weight: 600; font-size: 0.9rem; color: #1a1a1a; }
.share-preview-sub { font-size: 0.75rem; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.share-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #555;
    background: #f8f8f8;
    min-width: 0;
    font-family: inherit;
}

.share-copy-btn {
    padding: 10px 18px;
    background: #418cba;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.share-copy-btn:hover { background: #357aa3; }

.share-hint {
    font-size: 0.72rem;
    color: #888;
    margin-bottom: 16px;
    line-height: 1.4;
}

.share-channels {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.share-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: #333;
    font-size: 0.7rem;
    -webkit-tap-highlight-color: transparent;
}

.share-channel:hover { opacity: 0.8; }

.share-channel-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.share-channel-icon.email { background: #666; }
.share-channel-icon.whatsapp { background: #25d366; }
.share-channel-icon.copy-link { background: #418cba; }

/* Share button */
.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}
.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.share-btn svg {
    width: 16px;
    height: 16px;
}

/* Share toast notification */
.share-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: var(--gray-800);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}
.share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.order-btn {
    padding: var(--space-md) var(--space-xl);
    border: none; background: var(--accent);
    color: var(--white);
    font-family: inherit; font-size: 0.875rem; font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.order-btn:hover { background: var(--accent-dark); }

/* Warnings */
.warnings-container {
    position: fixed;
    bottom: var(--space-lg); left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: var(--space-sm);
    z-index: 200;
}

.warning {
    padding: var(--space-sm) var(--space-lg);
    background: var(--warning);
    color: var(--white);
    font-size: 0.8125rem; font-weight: 500;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ============================================
   RESPONSIVE - Mobile Anpassungen
   ============================================ */
@media (max-width: 768px) {
    .header { padding: var(--space-sm) var(--space-md); }
    .nav { display: none; }
    
    /* Mobile: Sticky Preview am oberen Bildschirmrand */
    .preview-section { 
        position: sticky;
        top: 0;
        z-index: 100;
        min-height: auto;
        max-height: 45vh;
        padding: var(--space-sm);
        flex-wrap: wrap;
        align-content: flex-start;
        background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
        border-bottom: 1px solid var(--gray-200);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    .config-section { padding: 0 var(--space-md) var(--space-md); }
    
    /* Mobile: Zoom Controls in einer Reihe */
    .zoom-controls {
        position: relative;
        bottom: auto; left: auto; transform: none;
        margin: var(--space-xs) auto 0;
        order: 10;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Mobile: Hintergrund-Buttons verstecken, Dropdown zeigen */
    .preview-bg-selector {
        display: none !important;
    }
    
    .bg-dropdown-wrapper {
        display: flex !important;
    }
    
    .preview-stage {
        order: 1;
        width: 100%;
        max-height: 30vh;
        overflow: hidden;
    }
    
    /* Mobile: Info-Badge kompakter und unterhalb des Preview */
    .info-badge { 
        order: 0; 
        position: relative;
        top: auto; left: auto;
        margin: 0 auto var(--space-xs);
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.7rem;
    }
    
    /* Mobile: Horizontale Tabs verstecken */
    .config-tabs {
        display: none;
    }
    
    /* Mobile: Accordion Headers zeigen - sticky when open */
    .accordion-header {
        display: flex !important;
        position: sticky;
        top: 45vh; /* Below the preview */
        z-index: 50;
        background: var(--gray-50);
    }
    
    .tab-panel.accordion-open .accordion-header {
        background: var(--black);
        color: var(--white);
    }
    
    .tab-panel.accordion-open .accordion-header .tab-icon {
        stroke: var(--white);
    }
    
    /* Mobile: Alle Tab-Panels sichtbar machen (Accordion steuert Inhalt) */
    .tab-panel {
        display: block !important;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .tab-panel .accordion-content {
        display: none;
        padding: var(--space-md) 0;
    }
    
    .tab-panel.accordion-open .accordion-content {
        display: block;
    }
    
    .tab-panel.accordion-open .accordion-icon {
        transform: rotate(180deg);
    }
    
    /* MUSTER - 2 Karten nebeneinander auf Mobile */
    .muster-grid-large {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .muster-card {
        padding: var(--space-sm);
    }
    
    .muster-card img {
        width: 60px;
        height: 60px;
    }
    
    .muster-card .muster-name {
        font-size: 0.7rem;
    }
    
    .muster-card .muster-desc {
        font-size: 0.6rem;
    }
    
    .design-options-row { grid-template-columns: 1fr; }
    
    .position-visual-selector { grid-template-columns: repeat(2, 1fr); }
    
    .text-controls { grid-template-columns: 1fr; }
    
    .option-row { grid-template-columns: 1fr; }
    
    .price-bar { flex-direction: column; align-items: stretch; }
    .price-total { align-items: center; }
    .order-btn { width: 100%; }
    
    .control-row { flex-direction: column; align-items: stretch; }
    .control-row label { min-width: auto; margin-bottom: var(--space-xs); }
}

/* Icon Grid (visuelles Auswahl-Raster für Motive) */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-sm);
    max-height: 320px;
    overflow-y: auto;
    padding: var(--space-xs);
}

.icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-card:hover {
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.icon-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.2);
    background: rgba(62, 106, 225, 0.04);
}

.icon-preview {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0);  /* Schwarz darstellen */
}

.icon-card.selected .icon-preview img {
    filter: brightness(0) sepia(1) hue-rotate(200deg) saturate(3);  /* Akzentfarbe */
}

.icon-name {
    font-size: 0.65rem;
    color: var(--gray-600);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

/* Icon-Position Selector (visuell wie Textposition) */
.icon-position-selector {
    display: flex;
    gap: var(--space-sm);
}

.icon-pos-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
}

.icon-pos-btn:hover {
    background: var(--gray-100);
}

.icon-pos-btn.active {
    border-color: var(--accent);
    background: var(--white);
}

.icon-pos-btn .pos-icon {
    width: 32px;
    height: 48px;
    color: var(--gray-500);
}

.icon-pos-btn.active .pos-icon {
    color: var(--accent);
}

.icon-pos-btn span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-600);
}

.icon-pos-btn.active span {
    color: var(--accent);
}

/* Reset Checkbox */
.reset-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-sm);
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--gray-500);
}
.reset-checkbox input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}
.reset-checkbox:hover {
    color: var(--gray-700);
}


/* Info-Points mit Tooltip */
.info-point {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    font-style: normal;
    font-family: var(--font-primary);
    color: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    transition: all 0.2s;
    vertical-align: middle;
    margin-left: 6px;
    line-height: 1;
}

.info-point::after {
    content: "?";
}

.info-point:hover {
    background: var(--accent);
    color: white;
}

.info-tooltip {
    display: none;
    background: var(--gray-800);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    animation: fadeIn 0.2s ease;
}

.info-tooltip.visible {
    display: block;
}

/* Info-Hinweis (immer sichtbar, dezent) */
.info-hint {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--gray-500);
    margin-bottom: var(--space-sm);
    padding: 0;
}

/* Befestigungs-/Icon-Position Bilder */
.option-image {
    width: 100%;
    max-width: 200px;
    border-radius: var(--radius-md);
    margin-top: var(--space-xs);
    border: 1px solid var(--gray-100);
}
.radio-card .option-image {
    max-width: 100%;
    height: auto;
    margin-top: 6px;
    object-fit: contain;
}
.icon-pos-btn .option-image {
    max-width: 80px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.price-hint {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--gray-500);
}

/* Custom Font Picker für Mobile */
.font-picker-wrapper {
    position: relative;
}

.font-picker-trigger {
    display: none; /* Versteckt auf Desktop */
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    text-align: left;
    font-size: 14px;
}

.font-picker-trigger::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: var(--gray-400);
}

/* Mobile: Custom Picker statt native select */
@media (max-width: 480px) {
    .font-select {
        display: none;
    }
    .font-picker-trigger {
        display: block;
    }
}

/* Font Picker Modal */
.font-picker-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.font-picker-modal.open {
    display: flex;
}

.font-picker-content {
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.font-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.font-picker-header h3 {
    margin: 0;
    font-size: 1rem;
}

.font-picker-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0;
    line-height: 1;
}

.font-picker-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    flex: 1;
    min-height: 0;
}

.font-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--gray-50);
}

.font-option:hover {
    border-color: var(--gray-300);
    background: var(--gray-100);
}

.font-option.selected {
    border-color: var(--accent);
    background: var(--white);
}

.font-option-preview {
    font-size: 1.5rem;
    min-width: 100px;
}

.font-option-name {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.font-option-check {
    margin-left: auto;
    color: var(--accent);
    font-size: 1.2rem;
    opacity: 0;
}

.font-option.selected .font-option-check {
    opacity: 1;
}

/* ============================================================================
   EINZELNE TEXTBAUSTEINE ANPASSEN
   ============================================================================ */

.element-adjust-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.element-selector label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: var(--space-xs);
}

.element-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.element-chip {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--gray-700);
    transition: all 0.15s;
    user-select: none;
}

.element-chip:hover {
    border-color: var(--gray-400);
    background: var(--gray-50, #f9fafb);
}

.element-chip.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--white);
}

.element-chip.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.element-chip .chip-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-left: 4px;
    vertical-align: middle;
}

.element-sliders {
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50, #f9fafb);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
}

.element-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.element-slider-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
}

.reset-btn-small {
    padding: 2px 8px;
    font-size: 0.7rem;
    min-width: auto;
}

.element-spacing-hint {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 4px;
    margin-bottom: 0;
    font-style: italic;
}

/* Kommentarfeld */
.customer-comment {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white, #fff);
    color: var(--gray-800);
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    transition: border-color 0.2s;
}
.customer-comment:focus {
    outline: none;
    border-color: var(--accent, var(--primary));
    box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.1);
}
.customer-comment::placeholder {
    color: var(--gray-400);
}
.comment-counter {
    text-align: right;
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== Shopify Mobile Navigation ===== */
/* Desktop: alles ausblenden */
.shopify-mobile-bar,
/* Desktop: X-Button always visible in Shopify mode */
.shopify-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 300;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.shopify-close-btn:hover {
    background: rgba(0,0,0,0.8);
}

.shopify-close-btn svg {
    width: 18px;
    height: 18px;
}

/* Exit Dialog (Desktop + Mobile) */
.mobile-exit-dialog {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 400;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
}

.mobile-exit-dialog.visible {
    display: flex;
}

.exit-dialog-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.exit-dialog-box p {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.exit-dialog-box .exit-sub {
    font-size: 0.82rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 20px;
}

.exit-dialog-buttons {
    display: flex;
    gap: 10px;
}

.exit-dialog-buttons button {
    flex: 1;
    padding: 12px 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}

.exit-btn-no {
    background: #e5e5e5;
    color: #333;
}

.exit-btn-yes {
    background: #418cba;
    color: #fff;
}

.mobile-bottom-nav,
.mobile-sheet-overlay {
    display: none;
}

@media (max-width: 1023px) {

    /* === Bottom Navigation Bar === */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 250;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        padding: 4px 6px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        gap: 2px;
        align-items: stretch;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        flex-shrink: 0;
    }
    
    /* Tab-Buttons in der Bottom-Nav */
    .mobile-nav-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 2px;
        border: none;
        background: transparent;
        color: #888;
        font-size: 0.6rem;
        font-family: inherit;
        font-weight: 500;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-nav-tab svg {
        width: 22px;
        height: 22px;
        stroke-width: 1.8;
    }
    
    .mobile-nav-tab.active {
        color: #000;
        background: #f0f0f0;
    }
    
    /* Warenkorb-Pill */
    .mobile-nav-cart {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 6px 10px;
        border: none;
        background: #418cba;
        color: #fff;
        font-family: inherit;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
        border-radius: 12px;
        margin: 2px 0;
        transition: background 0.15s;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-nav-cart:hover {
        background: #357aa3;
    }
    
    .mobile-nav-cart svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
    
    .mobile-cart-vat {
        display: block;
        font-size: 0.4rem;
        font-weight: 400;
        opacity: 0.8;
        line-height: 1.1;
        white-space: normal;
    }
    
    .mobile-cart-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }
    
    /* (Teilen-Button styles are now in the bottom section of this media query) */

    /* === Bottom Sheet Overlay === */
    .mobile-sheet-overlay {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: transparent;
        z-index: 240;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }
    
    .mobile-sheet-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* === Bottom Sheet === */
    .mobile-sheet {
        position: fixed;
        left: 0; right: 0;
        bottom: 0;
        z-index: 245;
        background: #fff;
        border-radius: 16px 16px 0 0;
        max-height: 55vh;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        display: flex;
        flex-direction: column;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    }
    
    .mobile-sheet.open {
        transform: translateY(0);
    }
    
    /* Wenn Sheet offen: Preview auf obere Hälfte beschränken */
    body.has-mobile-nav.sheet-open .preview-section {
        max-height: 45vh !important;
        flex: none !important;
    }
    
    /* Wenn Sheet offen: Zoom/Info/Maße ausblenden für mehr Platz */
    body.has-mobile-nav.sheet-open .zoom-controls,
    body.has-mobile-nav.sheet-open .info-badge {
        display: none !important;
    }
    
    .mobile-sheet-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 10px 4px;
        flex-shrink: 0;
        cursor: grab;
    }
    
    .mobile-sheet-handle .drag-bar {
        width: 36px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
    }
    
    .mobile-sheet-title {
        font-size: 0.8rem;
        font-weight: 600;
        padding: 0 12px 6px;
        border-bottom: 1px solid #f0f0f0;
        flex-shrink: 0;
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }
    
    .mobile-sheet-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 12px;
        padding-bottom: 72px; /* Platz für Bottom-Nav */
        flex: 1;
    }

    /* === Anpassungen wenn Bottom-Nav aktiv === */
    /* Accordion-Headers ausblenden */
    body.has-mobile-nav .accordion-header {
        display: none !important;
    }
    
    /* Config-Section und Panels unsichtbar (Sheet zeigt Inhalt) */
    body.has-mobile-nav .config-section {
        display: none !important;
    }
    
    /* KERN-FIX: Gesamtes Layout = festes Viewport, kein Scroll */
    body.has-mobile-nav {
        height: 100%;
        overflow: hidden !important;
        padding: 0;
        margin: 0;
    }
    
    html:has(body.has-mobile-nav) {
        height: 100%;
        overflow: hidden !important;
    }
    
    body.has-mobile-nav .app {
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    body.has-mobile-nav .main {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 56px; /* Platz für fixed Bottom-Nav */
    }
    
    body.has-mobile-nav .preview-section {
        position: relative !important;
        top: auto !important;
        max-height: none !important;
        flex: 1 !important;
        min-height: 0 !important; /* wichtig: erlaubt Schrumpfen */
        overflow: hidden !important;
        padding: 2px !important;
        border-bottom: none !important;
        box-shadow: none !important;
        display: flex;
        flex-direction: column;
    }
    
    body.has-mobile-nav .preview-stage {
        flex: 1;
        min-height: 0; /* erlaubt Schrumpfen */
        max-height: none !important;
        overflow: hidden;
    }
    
    /* Price-Bar ausblenden (Preis ist in Bottom-Nav) */
    body.has-mobile-nav .price-bar {
        display: none !important;
    }
    
    /* Zoom und Info kompakter */
    body.has-mobile-nav .zoom-controls {
        position: fixed;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0;
        margin-top: 2px;
        padding: 2px 10px;
        z-index: 250;
        flex-wrap: nowrap;
        gap: 6px;
        width: auto;
        max-width: 98vw;
    }
    
    /* Mobile: Hide "Maße" text, show only icon */
    body.has-mobile-nav .zoom-controls .toggle-btn .btn-label {
        display: none;
    }
    
    /* Mobile: Show bg-dropdown icon button */
    body.has-mobile-nav .zoom-controls .bg-dropdown-wrapper {
        display: flex !important;
        align-items: center;
    }

    body.has-mobile-nav .preview-bg-selector {
        display: none !important;
    }
    
    /* Hide bg controls when sheet is open */
    body.has-mobile-nav.sheet-open .zoom-controls .bg-dropdown-wrapper {
        display: none !important;
    }
    
    body.has-mobile-nav .zoom-controls .zoom-btn {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }
    
    body.has-mobile-nav .zoom-controls .toggle-btn {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    /* Info-Badge vertikal zentriert zwischen X-Button und Share-Buttons */
    body.has-mobile-nav .info-badge {
        position: absolute !important;
        top: 10px;
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 2px 8px;
        font-size: 0.6rem;
        max-width: calc(100% - 120px);
        overflow: hidden;
        text-overflow: ellipsis;
        order: unset;
        margin: 0;
    }
    
    /* Close-Button kompakter auf mobile */
    body.has-mobile-nav .shopify-close-btn {
        width: 30px;
        height: 30px;
        top: 4px;
        left: 4px;
    }
    
    /* Teilen + Speichern Buttons oben rechts */
    .mobile-top-actions {
        position: fixed;
        top: 4px;
        right: 8px;
        display: flex;
        gap: 6px;
        z-index: 300;
    }
    
    .mobile-top-btn {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(0,0,0,0.6);
        color: #fff;
        border: none;
        cursor: pointer;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-top-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* === Beenden-Dialog === */
    /* === Share Sheet === */
    .share-sheet-content {
        text-align: center;
    }
    
    .share-preview-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        background: #f8f8f8;
        border-radius: 10px;
        margin-bottom: 16px;
        text-align: left;
    }
    
    .share-preview-thumb {
        width: 56px;
        height: 56px;
        background: #eee;
        border-radius: 8px;
        overflow: hidden;
        flex-shrink: 0;
    }
    
    .share-preview-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .share-preview-info {
        flex: 1;
        min-width: 0;
    }
    
    .share-preview-title {
        font-weight: 600;
        font-size: 0.9rem;
        color: #1a1a1a;
    }
    
    .share-preview-sub {
        font-size: 0.75rem;
        color: #888;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .share-link-row {
        display: flex;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .share-link-input {
        flex: 1;
        padding: 10px 12px;
        border: 1px solid #ddd;
        border-radius: 10px;
        font-size: 0.8rem;
        color: #555;
        background: #f8f8f8;
        min-width: 0;
        font-family: inherit;
    }
    
    .share-copy-btn {
        padding: 10px 18px;
        background: #418cba;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-family: inherit;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
    }
    
    .share-hint {
        font-size: 0.72rem;
        color: #888;
        margin-bottom: 16px;
        line-height: 1.4;
    }
    
    .share-channels {
        display: flex;
        justify-content: center;
        gap: 20px;
    }
    
    .share-channel {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        border: none;
        background: none;
        font-family: inherit;
        color: #333;
        font-size: 0.7rem;
        -webkit-tap-highlight-color: transparent;
    }
    
    .share-channel-icon {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }
    
    .share-channel-icon.email { background: #666; }
    .share-channel-icon.whatsapp { background: #25d366; }
    .share-channel-icon.copy-link { background: #418cba; }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #4a5568;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #48bb78;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Strichstärke-Slider (gleicher Style wie andere Slider) */
.stroke-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: 6px;
    max-width: 280px;
}
.stroke-row .stroke-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    min-width: 75px;
}
.stroke-row .slider-with-value {
    flex: 1;
}
.stroke-row .value-display {
    min-width: 20px;
    text-align: right;
}
