/* Generell layout */
.woo-designer-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 20px; 
    margin-bottom: 30px; 
    background: #f9f9f9; 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid #e0e0e0; 
}

.woo-designer-controls { 
    position: relative; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    flex: 1; 
    min-width: 250px; 
    max-width: 300px; 
    background: #f9f9f9; 
}

.main-controls-wrap { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    width: 100%; 
    transition: opacity 0.2s; 
}

.woo-designer-controls button, 
.woo-designer-controls select, 
.woo-designer-controls input { 
    padding: 10px; 
    font-size: 14px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    width: 100%; 
    box-sizing: border-box; 
}

.woo-designer-controls button { 
    background: #333; 
    color: #fff; 
    cursor: pointer; 
    border: none; 
    transition: 0.3s; 
}

.woo-designer-controls button:hover { 
    background: #555; 
}

.btn-primary { 
    background: #007cba !important; 
    font-weight: bold; 
}

.btn-primary:hover { 
    background: #006ba1 !important; 
}

/* Størrelser og Prisboks */
.fixed-sizes-box { 
    background: #fff; 
    padding: 12px; 
    border: 1px solid #007cba; 
    border-radius: 6px; 
}

.fixed-sizes-box label { 
    font-size: 12px; 
    font-weight: bold; 
    color: #007cba; 
    margin-bottom: 6px; 
    display: block; 
}

.dimensions-box { 
    background: #fff; 
    padding: 15px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    display: none; 
}

.dimensions-box label { 
    font-size: 12px; 
    font-weight: bold; 
    margin-bottom: 4px; 
    display: block; 
}

.dimensions-row { 
    display: flex; 
    gap: 10px; 
    width: 100%; 
}

.dimensions-row div { 
    flex: 1; 
    min-width: 0; 
}

.price-box { 
    background: #e6f7ff; 
    border: 2px solid #007cba; 
    padding: 15px; 
    border-radius: 6px; 
    text-align: center; 
    margin-top: 10px; 
}

.price-box p { 
    margin: 0; 
    font-size: 14px; 
    color: #005a87; 
}

.price-box .total-price { 
    font-size: 24px; 
    font-weight: bold; 
    color: #007cba; 
    display: block; 
    margin-top: 5px; 
}

.price-box .discount-badge { 
    display: none; 
    background: #d9534f; 
    color: #fff; 
    padding: 3px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    margin-top: 5px; 
    font-weight: bold; 
}

/* Canvas Område */
.woo-designer-main { 
    display: flex; 
    flex-direction: column; 
    flex: 3; 
    min-width: 300px; 
    width: 100%; 
    overflow: visible; 
}

.canvas-toolbar { 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    display: flex; 
    gap: 5px; 
    margin-bottom: 10px; 
    background: #fff; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    align-items: center; 
    flex-wrap: wrap; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
}

.canvas-toolbar button { 
    background: #f1f1f1; 
    border: 1px solid #ddd; 
    padding: 6px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    transition: 0.2s; 
    color:#333; 
    width: auto; 
}

.canvas-toolbar button:hover { 
    background: #e0e0e0; 
}

.canvas-toolbar button.active { 
    background: #007cba; 
    color: #fff; 
    border-color: #005a87; 
}

.canvas-toolbar button:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
}

.tb-divider { 
    width: 1px; 
    height: 24px; 
    background: #ccc; 
    margin: 0 5px; 
}

.tb-dimensions-info { 
    margin-left: auto; 
    font-size: 12px; 
    color: #444; 
    text-align: right; 
    line-height: 1.3; 
}

.tb-dimensions-info strong { 
    color: #007cba; 
}

/* Canvas Wrapper med Sjakkbrett-mønster (Transparent utseende) */
.woo-designer-canvas-wrap { 
    position: relative; 
    border: 2px dashed #ccc; 
    width: 100%; 
    background-color: #ffffff;
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0), 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.design-grid-overlay { 
    position: absolute; 
    top:0; left:0; right:0; bottom:0; 
    pointer-events: none; 
    display: none; 
    z-index: 5; 
    background-image: linear-gradient(to right, rgba(0,124,186,0.15) 1px, transparent 1px), linear-gradient(to bottom, rgba(0,124,186,0.15) 1px, transparent 1px); 
    background-size: 37.795px 37.795px; 
}

/* Tooltips */
.fabric-tooltip { 
    position: absolute; 
    display: none; 
    background: #fff; 
    border: 1px solid #ccc; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    border-radius: 6px; 
    padding: 8px; 
    z-index: 100; 
    flex-direction: column; 
    gap: 8px; 
    transform: translate(-50%, -100%); 
    margin-top: -30px; 
}

.fabric-tooltip::after { 
    content: ''; 
    position: absolute; 
    bottom: -8px; 
    left: 50%; 
    transform: translateX(-50%); 
    border-width: 8px 8px 0; 
    border-style: solid; 
    border-color: #fff transparent transparent transparent; 
}

.tt-row { 
    display: flex; 
    gap: 5px; 
    align-items: center; 
    width: 100%; 
    justify-content: center; 
}

.fabric-tooltip button { 
    background: #f1f1f1; 
    border: 1px solid #ddd; 
    color: #333; 
    padding: 5px 10px; 
    cursor: pointer; 
    border-radius: 4px; 
    font-weight: bold; 
    width: auto; 
}

.fabric-tooltip button.active { 
    background: #dcdcdc; 
    border-color: #999; 
}

.fabric-tooltip select { 
    padding: 5px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    width: auto; 
    min-width: 130px; 
}

.fabric-tooltip input[type="range"] { 
    width: 80px; 
}

.fabric-tooltip .btn-delete { 
    color: #d9534f; 
}

.hover-size-tooltip { 
    position: absolute; 
    display: none; 
    background: rgba(0,0,0,0.8); 
    color: #fff; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 12px; 
    font-weight: bold; 
    pointer-events: none; 
    z-index: 100; 
    transform: translate(-50%, -100%); 
    margin-top: -5px; 
    white-space: nowrap; 
}

.hover-size-tooltip::after { 
    content: ''; 
    position: absolute; 
    bottom: -4px; 
    left: 50%; 
    transform: translateX(-50%); 
    border-width: 4px 4px 0; 
    border-style: solid; 
    border-color: rgba(0,0,0,0.8) transparent transparent transparent; 
}

.color-swatches { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 4px; 
    justify-content: center; 
    max-width: 220px; 
}

.color-swatch { 
    width: 22px; 
    height: 22px; 
    border-radius: 50%; 
    border: 1px solid #bbb; 
    cursor: pointer; 
    transition: 0.1s; 
}

.color-swatch:hover { 
    transform: scale(1.15); 
}

.color-swatch.active { 
    border: 2px solid #007cba; 
    box-shadow: 0 0 0 2px #fff inset; 
    transform: scale(1.1); 
}

/* Modaler */
.designer-modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    z-index: 99999; 
    align-items: center; 
    justify-content: center; 
}

.designer-modal-content { 
    background: #fff; 
    padding: 25px; 
    border-radius: 8px; 
    max-width: 800px; 
    width: 90%; 
    max-height: 85vh; 
    overflow-y: auto; 
    position: relative; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
}

.close-modal { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    cursor: pointer; 
    font-size: 24px; 
    font-weight: bold; 
    color: #555; 
}

.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 15px; 
    margin-top: 15px; 
}

.grid-item { 
    border: 1px solid #e0e0e0; 
    padding: 15px; 
    cursor: pointer; 
    text-align: center; 
    border-radius: 6px; 
    transition: 0.2s; 
    background: #fafafa; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 120px; 
}

.grid-item:hover { 
    border-color: #007cba; 
    background: #f0f8ff; 
    transform: translateY(-3px); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

.grid-item img { 
    max-width: 100%; 
    max-height: 100px; 
    object-fit: contain; 
    margin-bottom: 10px; 
}

/* Slide-in Panel */
.slide-in-panel { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #fff; 
    z-index: 30; 
    transform: translateX(-101%); 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    box-shadow: 2px 0 10px rgba(0,0,0,0.05); 
    border-right: 1px solid #e0e0e0; 
}

.slide-in-panel.active { 
    transform: translateX(0); 
}

.panel-header { 
    display: flex; 
    align-items: center; 
    padding: 15px; 
    border-bottom: 1px solid #eee; 
    background: #f9f9f9; 
}

.panel-header button { 
    background: none; 
    border: none; 
    font-size: 14px; 
    cursor: pointer; 
    color: #007cba; 
    padding: 0; 
    display: flex; 
    align-items: center; 
    width: auto; 
    font-weight: bold; 
}

.panel-content { 
    padding: 15px; 
    overflow-y: auto; 
    flex: 1; 
}

.clipart-category { 
    margin-bottom: 25px; 
}

.clipart-category-header h4 { 
    margin: 0; 
    font-size: 15px; 
    font-weight: bold; 
    color: #333; 
}

.clipart-row { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding-bottom: 10px; 
    scrollbar-width: thin; 
}

.clipart-item { 
    flex: 0 0 90px; 
    height: 90px; 
    border: 1px solid #eee; 
    border-radius: 6px; 
    padding: 8px; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: #fafafa; 
    transition: 0.2s; 
}

.clipart-item:hover { 
    border-color: #007cba; 
    transform: scale(1.05); 
}

.clipart-item img { 
    max-width: 100%; 
    max-height: 80%; 
    object-fit: contain; 
}

/* Mobil-tilpasninger */
@media (max-width: 768px) {
    .canvas-toolbar { 
        position: fixed; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        top: auto; 
        z-index: 1000; 
        border-radius: 0; 
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1); 
        margin: 0; 
        padding: 8px; 
        justify-content: center; 
    }
    .tb-dimensions-info { 
        display: none; 
    }
    .woo-designer-main { 
        padding-bottom: 60px; 
    }
    .fabric-tooltip { 
        transform: translate(-50%, 20px); 
        margin-top:0; 
        top: auto !important; 
        bottom: 10px !important; 
        position: fixed; 
    }
    .fabric-tooltip::after { 
        display: none; 
    }
    .woo-designer-canvas-wrap { 
        touch-action: none !important; 
    }
}