/**
 * MatCrafter - Gelişmiş Paspas Tasarım Aracı Stilleri
 * Version: 1.0
 */

/* =================================
   GENEL LAYOUT
   ================================= */

.mat-designer-advanced-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    background: #f5f7fa;
}

.designer-header {
    text-align: center;
    margin-bottom: 40px;
}

.designer-header h1 {
    font-size: 2.5rem;
    color: #2C3E50;
    margin-bottom: 10px;
}

.designer-header p {
    font-size: 1.1rem;
    color: #7F8C8D;
}

/* 3 Kolonlu Grid Layout */
.designer-layout {
    display: grid;
    grid-template-columns: 350px 1fr 380px;
    gap: 30px;
    min-height: 800px;
    align-items: start;
    /* CRITICAL: Allows children to be sticky */
}

/* =================================
   SOL PANEL - KONTROLLER
   ================================= */

.designer-controls {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.control-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #ecf0f1;
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    font-size: 1.1rem;
    color: #2C3E50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Boyut inputları yan yana */
.size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.size-inputs .form-group {
    margin-bottom: 0;
}

.size-inputs .form-group small {
    display: none;
}

/* Standart Ölçüler */
.standard-sizes {
    margin-top: 15px;
}

.standard-sizes label {
    display: block;
    font-weight: 600;
    color: #34495E;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.standard-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.standard-size-btn {
    padding: 10px 12px;
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
    color: #2C3E50;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.standard-size-btn:hover,
.standard-size-btn.active {
    border-color: #0046be;
    background: #e8f0fe;
    color: #0046be;
}

.standard-size-btn small {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: normal;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #34495E;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0046be;
}

.form-group small {
    display: block;
    color: #95a5a6;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Şekil Seçici */
.shape-selector {
    display: flex;
    gap: 10px;
}

.shape-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shape-btn span {
    font-size: 14px;
    font-weight: 600;
    color: #34495E;
    transition: color 0.3s;
}

.shape-btn svg {
    color: #95a5a6;
    transition: color 0.3s;
    width: 32px;
    height: 32px;
}

.shape-btn:hover {
    border-color: #0046be;
    background: #f8f9fa;
}

.shape-btn.active {
    border-color: #0046be;
    background: #e8f0fe;
}

.shape-btn.active svg,
.shape-btn.active span {
    color: #0046be;
}

/* Zemin Seçici */
.background-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-grid,
.texture-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.color-item,
.texture-item {
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.color-item:hover,
.texture-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-item.active,
.texture-item.active {
    border-color: #0046be;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #0046be;
}

.color-name,
.texture-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px;
    font-size: 0.75rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.color-item:hover .color-name,
.texture-item:hover .texture-name {
    opacity: 1;
}

.texture-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Logo & Metin Upload */
.logo-upload-area,
.text-add-area {
    margin-bottom: 15px;
}

.text-add-area {
    display: flex;
    gap: 8px;
}

#text-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

#text-input:focus {
    outline: none;
    border-color: #0046be;
    box-shadow: 0 0 0 3px rgba(0, 70, 190, 0.1);
}

#text-input::placeholder {
    color: #95a5a6;
}

.btn-add-text {
    padding: 12px 20px;
    background: #0046be;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-add-text:hover {
    background: #003a9e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 70, 190, 0.3);
}

/* Text Toolbar */
.text-toolbar {
    position: absolute;
    background: white;
    border: 2px solid #0046be;
    border-radius: 8px;
    padding: 8px;
    display: none;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 4px;
    max-width: 320px;
}

.text-toolbar.active {
    display: flex;
}

.toolbar-group {
    display: flex;
    gap: 4px;
    padding: 0 4px;
    border-right: 1px solid #ecf0f1;
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ecf0f1;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    color: #2C3E50;
}

.toolbar-btn:hover {
    background: #f8f9fa;
    border-color: #0046be;
}

.toolbar-btn.active {
    background: #0046be;
    color: white;
    border-color: #0046be;
}

.toolbar-select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
}

.toolbar-color-input {
    width: 32px;
    height: 32px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.toolbar-number-input {
    width: 50px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

.btn-upload,
.btn-add-text {
    width: 100%;
    padding: 12px;
    background: #0046be;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 5px;
}

.btn-upload:hover,
.btn-add-text:hover {
    background: #003a9e;
}

.element-list {
    max-height: 250px;
    overflow-y: auto;
}

.element-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
}

.element-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.element-info {
    flex: 1;
    font-size: 0.9rem;
}

.element-controls {
    display: flex;
    gap: 5px;
}

.btn-element {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

/* Çerçeve Toggle */
.frame-toggle {
    display: flex;
    gap: 10px;
}

.toggle-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-option input {
    display: none;
}

.toggle-option span {
    font-weight: 600;
    color: #7f8c8d;
}

.toggle-option.active {
    border-color: #0046be;
    background: #e8f0fe;
}

.toggle-option.active span {
    color: #0046be;
}

/* Gönderim Seçenekleri */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shipping-option {
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.shipping-option input {
    display: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-content strong {
    color: #2C3E50;
    font-size: 1rem;
}

.option-content span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.option-content .price {
    color: #27ae60;
    font-weight: 600;
}

.shipping-option.active {
    border-color: #0046be;
    background: #e8f0fe;
}

/* =================================
   ORTA ALAN - CANVAS
   ================================= */

.mat-designer-advanced-container .designer-canvas-wrapper {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky !important;
    top: 110px !important;
    z-index: 100 !important;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.canvas-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2C3E50;
}

.canvas-tools {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 8px 12px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #0046be;
}

.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    position: relative;
    min-height: 600px;
}

#mat-canvas {
    border: 2px solid #ddd;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
    max-width: 100%;
    max-height: 100%;
}

/* Draggable Container */
.draggable-container {
    position: absolute;
    top: 30px;
    left: 30px;
    pointer-events: none;
}

.draggable-element {
    position: absolute;
    cursor: move;
    pointer-events: auto;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
    user-select: none;
}

.draggable-element:hover {
    border-color: rgba(0, 70, 190, 0.5);
}

.draggable-element.selected {
    border-color: #0046be;
    box-shadow: 0 0 0 2px rgba(0, 70, 190, 0.2);
}

.draggable-element.dragging {
    opacity: 0.8;
    z-index: 1000;
}

.draggable-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.draggable-text {
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 10px;
    background: transparent;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #0046be;
    border: 2px solid white;
    border-radius: 50%;
    display: none;
}

.draggable-element.selected .resize-handle {
    display: block;
}

.resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.canvas-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.canvas-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1rem;
    color: #7f8c8d;
}

.canvas-info span {
    font-weight: 600;
}

/* =================================
   SAĞ PANEL - FİYAT & SİPARİŞ
   ================================= */

.mat-designer-advanced-container .designer-summary {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky !important;
    top: 110px !important;
    height: fit-content;
    z-index: 100 !important;
}

.price-summary h3 {
    font-size: 1.2rem;
    color: #2C3E50;
    margin-bottom: 15px;
}

.price-breakdown {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.price-row:last-child {
    border-bottom: none;
}

.price-row.total {
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid #0046be;
    font-size: 1.2rem;
}

.price-row span {
    color: #7f8c8d;
}

.price-row strong {
    color: #2C3E50;
    font-size: 1.1rem;
}

.price-row.total strong {
    color: #0046be;
    font-size: 1.5rem;
}

.delivery-info {
    margin-top: 15px;
    padding: 15px;
    background: #e8f0fe;
    border-radius: 6px;
    text-align: center;
}

.delivery-info p {
    margin: 0;
    color: #2C3E50;
}

.btn-order-now {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #0046be 0%, #003a9e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(0, 70, 190, 0.3);
}

.btn-order-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 70, 190, 0.4);
}

.btn-order-now:active {
    transform: translateY(0);
}

/* Sipariş Formu */
.order-form-section {
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.order-form-section h3 {
    font-size: 1.1rem;
    color: #2C3E50;
    margin-bottom: 15px;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-option {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-option input {
    display: none;
}

.payment-option span {
    font-weight: 600;
    color: #7f8c8d;
}

.payment-option:has(input:checked) {
    border-color: #0046be;
    background: #e8f0fe;
}

.payment-option:has(input:checked) span {
    color: #0046be;
}

.bank-info {
    margin-top: 15px;
    padding: 15px;
    background: #fff9e6;
    border: 1px solid #f1c40f;
    border-radius: 6px;
}

.bank-details {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #2C3E50;
}

.btn-submit-order {
    width: 100%;
    padding: 15px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 15px;
}

.btn-submit-order:hover {
    background: #229954;
}

/* =================================
   RESPONSIVE
   ================================= */

@media (max-width: 1600px) {
    .designer-layout {
        grid-template-columns: 320px 1fr 350px;
        gap: 20px;
    }
}

@media (max-width: 1400px) {
    .designer-layout {
        grid-template-columns: 300px 1fr;
    }

    .designer-summary {
        grid-column: 1 / -1;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 1024px) {
    .designer-layout {
        grid-template-columns: 1fr;
    }

    .designer-controls {
        max-height: none;
    }

    .canvas-area {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .designer-header h1 {
        font-size: 1.8rem;
    }

    .color-grid,
    .texture-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .canvas-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* =================================
   LOADING & ANIMATIONS
   ================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #ecf0f1;
    border-top-color: #0046be;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================
   MOBILE DESIGNER ENHANCEMENTS (PHASE 40)
   ================================= */

@media (max-width: 1024px) {
    .mat-designer-advanced-container {
        overflow-x: hidden;
        padding: 15px 10px;
    }

    .designer-layout {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding-bottom: 100px;
        /* Space for sticky footer */
    }

    /* Preview Area - En alta, seçeneklerden sonra */
    .designer-canvas-wrapper {
        order: 2;
        /* Seçeneklerden sonra */
        position: relative;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        padding: 15px;
        background: #fff;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .canvas-area {
        min-height: 200px !important;
        padding: 10px;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        width: 100%;
    }

    .canvas-header {
        padding: 0 0 10px 0;
        margin-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
    }

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

    .canvas-footer {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }

    /* Canvas - %100 genişlik */
    #mat-canvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 50vh !important;
        object-fit: contain;
        display: block;
    }

    /* Mobile Tabs - Ortada */
    .mobile-designer-tabs {
        order: 1;
        /* Seçeneklerden sonra, canvas'tan önce */
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        border-radius: 10px;
        padding: 8px;
        gap: 8px;
        scrollbar-width: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-designer-tabs::-webkit-scrollbar {
        display: none;
    }

    .m-tab-btn {
        flex: 1 0 auto;
        padding: 10px 16px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        color: #64748b;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .m-tab-btn.active {
        background: #0046be;
        color: #fff;
        border-color: #0046be;
        box-shadow: 0 2px 8px rgba(0, 70, 190, 0.3);
    }

    /* Control Panes - En üstte */
    .designer-controls {
        order: 0;
        /* En üstte - seçenekler ilk görünür */
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        background: #fff;
        border-radius: 12px;
        min-height: auto;
        width: 100%;
        box-sizing: border-box;
    }

    .m-tab-pane {
        display: none;
    }

    .m-tab-pane.active {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }

    .control-section {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    /* Order Summary - En altta */
    .designer-summary {
        display: flex !important;
        order: 3;
        /* Canvas'tan sonra, en altta */
        flex-direction: column;
        gap: 15px;
        background: #fff;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .designer-summary .price-breakdown {
        padding: 15px;
    }

    .designer-summary .btn-order-now {
        padding: 14px;
        font-size: 1rem;
    }

    /* Hide redundant header description */
    .designer-header p {
        display: none !important;
    }

    /* Floating Footer */
    .mobile-designer-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 12px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        border-top: 1px solid #f0f0f0;
    }

    .m-price-label {
        font-size: 12px;
        color: #64748b;
        display: block;
    }

    #m-price-total {
        font-size: 1.2rem;
        color: #0046be;
        font-weight: 800;
    }

    .m-btn-next,
    .m-btn-order {
        padding: 12px 24px;
        background: #0046be;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-weight: 700;
        font-size: 1rem;
    }

    .m-btn-order {
        background: #27ae60;
    }
}

@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}

/* UTILITY */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================
   UTILITY CLASSES
   ================================= */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* =================================
   GLOBAL MOBILE ELEMENT RESETS
   ================================= */
.mobile-preview-bar,
.fullscreen-preview-modal,
.onboarding-overlay {
    display: none;
    /* Hidden by default on desktop */
}

/* =================================
   MOBILE WIZARD SYSTEM
   ================================= */

@media (max-width: 1024px) {

    /* Force show mobile elements */
    .mobile-preview-bar {
        display: flex;
    }

    /* Minimalist Wizard Header */
    .wizard-steps {
        display: block;
        /* Stack vertical */
        padding: 0 0 15px 0;
        background: transparent;
        box-shadow: none;
        margin-bottom: 10px;
    }

    .wizard-step {
        display: none;
        /* Hide individual steps icons */
    }

    /* New Minimal Header Structure */
    .mobile-wizard-header {
        margin-bottom: 15px;
    }

    .wizard-title-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .wizard-current-title {
        font-size: 18px;
        font-weight: 800;
        color: #1e293b;
    }

    .wizard-step-counter {
        font-size: 12px;
        font-weight: 600;
        color: #94a3b8;
        background: #f1f5f9;
        padding: 4px 10px;
        border-radius: 20px;
    }

    /* Simple Progress Bar */
    .wizard-progress-track {
        width: 100%;
        height: 4px;
        background: #e2e8f0;
        border-radius: 2px;
        overflow: hidden;
    }

    .wizard-progress-fill {
        height: 100%;
        background: #0046be;
        width: 25%;
        /* Dynamic via JS */
        transition: width 0.3s ease;
        border-radius: 2px;
    }

    /* Clean Content Area */
    .designer-controls {
        background: transparent;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .control-section {
        background: #fff;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 15px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    }

    .control-section h3 {
        display: none;
        /* Hide repetition since header has title */
    }

    /* Refined Onboarding Card */
    .onboarding-card {
        background: rgba(255, 255, 255, 0.95);
        /* Slight transparency */
        backdrop-filter: blur(10px);
        border-radius: 24px;
        /* More round */
        max-width: 340px;
        width: 90%;
        padding: 40px 30px;
        text-align: center;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    .btn-start-design {
        background: linear-gradient(135deg, #0046be 0%, #003a9e 100%);
        /* Gradient */
        padding: 16px;
        /* Taller button */
        border-radius: 14px;
        font-size: 16px;
        letter-spacing: 0.5px;
        box-shadow: 0 10px 20px rgba(0, 70, 190, 0.3);
        transition: transform 0.2s;
    }

    .btn-start-design:active {
        transform: scale(0.98);
    }


    /* Sabit Alt Bar - MASTER NAVIGATION */
    .mobile-preview-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        display: flex;
        align-items: center;
        padding: 0 20px;
        gap: 15px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
        z-index: 2000;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .preview-thumbnail {
        width: 50px;
        height: 50px;
        border-radius: 8px;
        overflow: hidden;
        border: 2px solid #e2e8f0;
        cursor: pointer;
        transition: all 0.2s;
        flex-shrink: 0;
    }

    .preview-thumbnail:hover {
        border-color: #0046be;
        transform: scale(1.05);
    }

    .preview-thumbnail img,
    .preview-thumbnail canvas {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .preview-info {
        flex: 1;
        min-width: 0;
    }

    .preview-step-info {
        font-size: 10px;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        font-weight: 700;
        margin-bottom: -2px;
    }

    .preview-price {
        font-size: 18px;
        font-weight: 800;
        color: #0046be;
        line-height: 1.2;
    }

    .preview-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .btn-prev-step,
    .btn-next-step {
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 12px;
        font-weight: 700;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
        padding: 0 16px;
    }

    .btn-prev-step {
        background: #f1f5f9;
        color: #64748b;
        padding: 0 10px;
    }

    .btn-next-step {
        background: #0046be;
        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 70, 190, 0.2);
    }

    .btn-next-step:active {
        transform: scale(0.96);
    }

    .btn-next-step.finish {
        background: #10b981;
        color: #fff;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
        padding: 0 12px;
        font-size: 13px;
    }

    /* Tam Ekran Önizleme Modal */
    .fullscreen-preview-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.9);
        z-index: 3000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .fullscreen-preview-modal.active {
        display: flex;
    }

    .fullscreen-preview-content {
        max-width: 100%;
        max-height: 80vh;
    }

    .fullscreen-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: #fff;
        border: none;
        border-radius: 50%;
        font-size: 24px;
        cursor: pointer;
    }

    /* Summary Responsive */
    /* Summary Responsive */
    .designer-summary {
        padding: 15px !important;
        width: 100% !important;
        max-width: 100vw !important;
        /* Ensure no overflow */
        box-sizing: border-box;
        overflow-x: hidden;
        /* Prevent horizontal scroll */
    }

    .designer-summary h3 {
        font-size: 18px !important;
        /* Match wizard title exactly */
        font-weight: 800;
        color: #1e293b;
        margin-bottom: 20px;
    }

    .designer-summary .price-breakdown {
        padding: 12px;
    }

    .designer-summary .price-row {
        padding: 8px 0;
        font-size: 14px;
    }

    .designer-summary .price-row.total {
        font-size: 16px;
    }

    /* Onboarding Overlay */
    .onboarding-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.85);
        z-index: 5000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .onboarding-overlay.active {
        display: flex;
    }

    .onboarding-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 24px;
        max-width: 340px;
        width: 90%;
        padding: 40px 30px;
        text-align: center;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.6);
        animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(40px) scale(0.95);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .onboarding-icon {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .onboarding-title {
        font-size: 20px;
        font-weight: 800;
        color: #1e293b;
        margin-bottom: 10px;
    }

    .onboarding-text {
        font-size: 14px;
        color: #64748b;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .onboarding-steps {
        text-align: left;
        margin-bottom: 25px;
    }

    .onboarding-step {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .onboarding-step:last-child {
        border-bottom: none;
    }

    .onboarding-step-num {
        width: 28px;
        height: 28px;
        background: #0046be;
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 12px;
        flex-shrink: 0;
    }

    .onboarding-step-text {
        font-size: 13px;
        color: #334155;
    }

    .btn-start-design {
        width: 100%;
        padding: 14px;
        background: #0046be;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-weight: 700;
        font-size: 16px;
        cursor: pointer;
        margin-bottom: 10px;
    }

    /* =================================
   INTERACTION FIXES
   ================================= */
    #draggable-container,
    .draggable-item {
        touch-action: none !important;
        user-select: none;
        -webkit-user-select: none;
    }
}

/* =================================
   DESKTOP TYPOGRAPHY & LAYOUT
   ================================= */
@media (min-width: 1025px) {

    /* Better Font Sizes */
    /* Better Font Sizes */
    .designer-controls h3,
    .designer-summary h3,
    .control-section h3 {
        font-size: 20px !important;
        /* Unified 1.25rem ~ 20px */
        font-weight: 700 !important;
        margin-bottom: 20px;
        color: #1e293b;
        line-height: 1.4;
        text-transform: none;
        /* Ensure no case diffs */
    }

    .control-section {
        margin-bottom: 30px;
    }

    /* Summary Section */
    .designer-summary {
        font-size: 1rem;
    }

    .designer-summary .price-row.total {
        font-size: 1.4rem;
    }

    /* Hide mobile elements again to be safe */
    .mobile-wizard-header,
    .mobile-preview-bar,
    .onboarding-overlay,
    .fullscreen-preview-modal {
        display: none !important;
    }
}

/* Desktop Onboarding Tooltip */
@media (min-width: 1025px) {
    .onboarding-tooltip {
        position: absolute;
        background: #1e293b;
        color: #fff;
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 13px;
        max-width: 250px;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .onboarding-tooltip::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 20px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 8px solid #1e293b;
    }

    .tooltip-close {
        position: absolute;
        top: 8px;
        right: 8px;
        background: none;
        border: none;
        color: #94a3b8;
        cursor: pointer;
        font-size: 16px;
    }
}