/* Canvas Section - DESKTOP DEFAULT (NO STICKY) */
.mockup-preview {
    position: relative;
    width: min(80vmin, 1000px);  /* Maksimum 600px, minimum viewport'un %80'i */
    height: min(80vmin, 1000px); /* Kare alan */
    margin: 0 auto 30px;
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* STICKY SADECE 1024PX VE ALTINDA */
@media screen and (max-width: 1024px) {
    .mockup-preview {
        position: -webkit-sticky !important; /* Safari desteği */
        position: sticky !important;
        top: var(--canvas-top-offset, 50px) !important; /* Dinamik header yüksekliği */
        z-index: 1000 !important;
    }
}

/* MOBİL ZOOM VE PAN DESTEĞİ */
@media screen and (max-width: 768px) {
    .mockup-preview {
        touch-action: none;
        overflow: visible;
        transform-origin: center center;
        position: -webkit-sticky !important; /* Safari desteği */
        position: sticky !important;
        top: var(--canvas-top-offset, 60px) !important; /* Dinamik header yüksekliği */
        z-index: 1000 !important;
    }
    
    .canvas-wrapper {
        touch-action: none;
        overflow: visible;
        width: 100%;
        height: 100%;
        transform-origin: center center;
        transition: transform 0.1s ease-out;
        will-change: transform;
    }
    
    #customerCanvas {
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        pointer-events: none;
    }
    
    /* Zoom kontrol talimatları */
    .mockup-preview::after {
        content: 'İki parmak: Zoom | Tek parmak: Hareket | Çift dokunma: Reset';
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        color: #666;
        background: rgba(255,255,255,0.9);
        padding: 4px 8px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 1;
    }
}

/* Canvas Wrapper - GÜNCELLENEN BÖLÜM */
.canvas-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

#customerCanvas {
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: none !important;
    background: white;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* JavaScript sticky fallback */
.js-sticky {
    position: fixed !important;
    top: var(--canvas-top-offset, 60px) !important;
    z-index: 1000 !important;
}

@media screen and (max-width: 1024px) {
    .js-sticky {
        top: var(--canvas-top-offset, 50px) !important;
    }
}

/* TABLET RESPONSIVE - GÜNCELLENEN BÖLÜM */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .design-container {
        padding: 15px;
    }
    
    .mockup-preview {
        width: min(70vmin, 500px);
        height: min(70vmin, 500px);
    }
}

/* MOBİL RESPONSIVE - GÜNCELLENEN BÖLÜM */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .design-container {
        padding: 10px;
        margin: 5px auto;
        border-radius: 10px;
        min-height: calc(100vh - 10px);
    }
    
    .header-section {
        margin: -10px -10px 20px -10px;
        padding: 20px 10px;
        border-radius: 10px 10px 0 0;
    }
    
    .header-section h1 {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }
    
    .header-section p {
        font-size: 0.9rem;
    }
    
    .mockup-preview {
        width: calc(100vw - 40px);  /* Viewport genişliği - padding */
        height: calc(100vw - 40px); /* Kare alan */
        max-width: 500px;
        max-height: 500px;
    }
    
    .canvas-wrapper {
        padding: 5px;
    }
}

/* KÜÇÜK MOBİL - GÜNCELLENEN BÖLÜM */
@media screen and (max-width: 480px) {
    .mockup-preview {
        width: calc(100vw - 30px);
        height: calc(100vw - 30px);
        max-width: 400px;
        max-height: 400px;
    }
}
