/* ====================================
   MODERN KOLLÃZS SZERKESZTÅ - STYLE.CSS
   ==================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure the new mobile bottom bar only shows on mobile */
.mobile-bottom-bar {
    display: none;
}
@media (max-width: 900px) {
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: white;
        border-top: 1px solid var(--border-color);
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        padding: 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .mobile-bottom-bar::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }
    .mobile-bottom-bar button {
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s;
        padding: 4px 8px;
        border-radius: 8px;
        flex: 0 0 auto;
        min-width: 70px;
        white-space: nowrap;
    }
    .mobile-bottom-bar button:hover {
        background: rgba(179, 18, 23, 0.1);
    }
    .mobile-bottom-bar button.active {
        color: var(--primary-color);
        background: linear-gradient(135deg, rgba(179, 18, 23, 0.15) 0%, rgba(143, 15, 19, 0.2) 100%);
        box-shadow: inset 0 -3px 0 var(--primary-color);
    }
    .mobile-bottom-bar i { 
        font-size: 18px;
        margin-bottom: 4px;
        transition: transform 0.2s ease;
    }
    
    .mobile-bottom-bar button.active i {
        transform: scale(1.1);
    }
    
    /* BiztosÃ­tjuk hogy a bottom bar mindig lÃ¡thatÃ³ */
    .mobile-bottom-bar {
        z-index: 1100 !important;
        background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
        border-top: 1px solid #e8e8e8;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }
}

/* Mobile action bar asztalon rejtve */
.mobile-action-bar {
    display: none;
}

/* images-actions-top asztalon rejtve (toolbar-ban vannak) */
.images-actions-top.mobile-only {
    display: none;
}

/* Asztali toolbar-ban lÃ©vÅ‘ gombok - jobbra igazÃ­tva */
.canvas-toolbar-bottom .toolbar-right-group {
    margin-left: auto;
    /* padding-left: 12px; */
    border-left: 1px solid #e0e0e0;
}

.canvas-toolbar-bottom #autoArrangeButton,
.canvas-toolbar-bottom #toggleGridButton {
    min-width: 176px;
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.canvas-toolbar-bottom #autoArrangeButton i,
.canvas-toolbar-bottom #toggleGridButton i {
    font-size: 13px;
    margin-right: 0;
}

.canvas-toolbar-bottom .desktop-text {
    display: inline;
    margin-left: 5px;
    font-size: 12px;
}

.canvas-toolbar-bottom #autoArrangeButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
}

:root {
    --primary-color: #b31217;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* === HEADER === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-link {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.8;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background: #8f0f13;
}

.btn-primary:disabled {
    cursor: wait !important;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn i {
    font-size: 16px;
}

.mobile-text {
    display: none;
}

/* === MAIN LAYOUT === */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 12px;
    padding: 76px 12px 12px 12px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: auto;
}

/* === LEFT SIDEBAR === */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow);
    height: fit-content;
    max-height: calc(152vh - 92px);
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.section-title i {
    color: var(--primary-color);
    font-size: 16px;
}

.upload-zone {
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.05);
}

.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.15);
    border-style: solid;
    transform: scale(1.02);
}

.upload-icon {
    /* font-size: 36px; */
    color: var(--primary-color);
    margin-bottom: 8px;
}

.upload-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

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

/* Actions above uploaded images */
.images-actions {
    display: flex;
    flex-direction: row;
    gap: 0px;
    margin: -12px 0 -7px 0;
}
.images-actions-top {
    display: flex;
    gap: 0px;
    flex-wrap: wrap;
    justify-content: space-between;
}
/* Side-by-side layout on desktop */
@media (min-width: 901px) {
  .images-actions-top > button {
      flex: 1 1 calc(50% - 4px);
  }
}
@media (max-width: 900px) {
    .images-actions-top {
        flex-direction: row;
        gap: 6px;
    }
}
.delete-all-images-btn {
    width: 100%;
    background: #dc3545; /* danger */
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: var(--shadow);
}
.delete-all-images-btn:hover {
    filter: brightness(0.95);
}

/* Slightly refine grid toggle look */
#toggleGridButton.tool-btn {
    border-radius: 10px;
    padding: 8px 12px;
}

/* Auto arrange pill look already defined; ensure full width in its container */
#autoArrangeButton.auto-arrange-btn {
    border-radius: 10px;
}

/* === CENTER CANVAS AREA === */
.canvas-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.size-selector-bar {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 0;
}

.size-selector-bar:empty,
.size-selector-bar .size-selector-scroll:empty {
    display: none;
}

.size-selector-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px;
}

.size-selector-scroll::-webkit-scrollbar {
    height: 6px;
}

.size-selector-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.size-option-horizontal {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.size-option-horizontal:hover {
    border-color: var(--primary-color);
}

.size-option-horizontal.active {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.1);
}

.size-preview-mini {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.size-preview-mini.landscape {
    width: 30px;
    height: 40px;
}

.size-preview-mini.square {
    width: 30px;
    height: 30px;
}

.size-info-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.size-name-mini {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.size-price-mini {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.canvas-wrapper {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    position: relative;
    overflow: hidden;
    max-width: 100%; /* Ne tolja szÃ©t a layoutot */
}

.canvas-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center; /* vertikális közép */
    justify-content: center; /* horizontális közép */
    text-align: center;
    padding: 16px;
    pointer-events: none;
}

.canvas-empty-card {
    background: #ffffff;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    max-width: min(92%, 720px);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.canvas-empty-card .icon {
    font-size: clamp(36px, 4.5vw, 54px);
    color: var(--primary-color);
    line-height: 1;
}

.canvas-empty-card .text { line-height: 1.35; }

.canvas-empty-title {
    font-weight: 700;
    color: #374151;
    font-size: clamp(16px, 1.8vw, 20px);
    margin-bottom: 2px;
}

.canvas-empty-sub {
    color: #6b7280;
    font-size: clamp(13px, 1.6vw, 16px);
}

/* Desktop nÃ©zeten korlÃ¡tozÃ¡s */
@media (min-width: 901px) {
    .canvas-wrapper {
        max-width: 750px; /* Maximum canvas wrapper szÃ©lessÃ©g desktop-on */
    }
}

#c {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.canvas-toolbar-bottom {
    background: white;
    border-radius: 12px;
    padding: 1px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    /* gap: 4px; */
}

.tool-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
    padding: 6px;
    font-size: 14px;
}

.tool-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

.divider-vertical-mini {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.toggle-switch-wrapper {
    display: none !important; /* Elrejtve a felhasznÃ¡lÃ³i kÃ©rÃ©s alapjÃ¡n */
    align-items: center;
    gap: 6px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.canvas-info-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-left: auto;
}

.canvas-info-inline i {
    color: var(--primary-color);
}

.divider-dot {
    color: var(--text-muted);
    margin: 0 4px;
}

/* === RIGHT SIDEBAR === */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: fit-content;
    overflow-y: auto;
}

.panel {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    background: white;
    transition: background 0.2s;
}

.panel-header:hover {
    background: var(--bg-light);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.panel-title i {
    color: var(--primary-color);
    font-size: 16px;
}

.panel-toggle {
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.panel:not(.collapsed) .panel-toggle {
    transform: rotate(180deg);
}

.panel-content {
    max-height: 600px;
    overflow-y: auto;
    /* padding: 12px; */
    border-top: 1px solid var(--border-color);
    transition: max-height 0.3s ease;
}

/* Number Template panel UI */
.number-template-content {
    padding: 12px;
}
.number-template-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}
.number-dropdowns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
.number-dropdowns .dropdown-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.number-dropdowns .dropdown-group select {
    width: 100%;
}
.number-tip {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.letter-template-content {
    padding: 12px;
}
.letter-template-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.letter-template-content .btn {
    width: 100%;
    margin-top: 10px;
}

.input-with-counter {
    position: relative;
}

.modern-input {
    width: 100%;
    padding: 10px 56px 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-light);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(179, 18, 23, 0.15);
    background: #fff;
}

.char-counter {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    padding: 0 4px;
    border-radius: 4px;
    pointer-events: none;
}
.char-counter.limit {
    color: var(--danger-color);
}

.panel.collapsed .panel-content {
    max-height: 0;
    padding: 0;
    border-top: none;
    overflow: hidden;
}

.templates-grid, .backgrounds-grid, .cliparts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

/* Collapsible categories for templates */
.template-categories {
    display: block; /* override .templates-grid */
}

.template-categories .category-container {
    margin-bottom: 12px;
}

.template-categories .category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #b31217 0%, #8f0f13 100%);
    color: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(179, 18, 23, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-categories .category-header:hover {
    box-shadow: 0 4px 12px rgba(179, 18, 23, 0.4);
    transform: translateY(-1px);
}

.template-categories .category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.template-categories .category-title i { color: #fff; }

.template-categories .category-count {
    margin-left: auto;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    min-width: 35px;
    text-align: center;
}

.template-categories .category-chevron {
    margin-left: 6px;
    transition: transform .2s ease;
}
.template-categories .category-header.open .category-chevron {
    transform: rotate(180deg);
}

/* Card container grid */
.template-categories .templates-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 16px 8px;
}

@media (max-width: 768px) {
    .template-categories .templates-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 12px 4px;
    }
    
    .template-categories .template-card-image {
        height: 120px;
    }
    
    /* Sablonok gÃ¶rgetÃ©se mobilon - teljes kategÃ³riÃ¡k */
    .template-categories {
        max-height: 60vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Egyedi kategÃ³ria gÃ¶rgetÃ©s is */
    .template-categories .category-body {
        max-height: 400px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Sablon kÃ¡rtya */
.template-categories .template-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.template-categories .template-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: #ff8c42;
}

/* KÃ¡rtya elÅ‘nÃ©zet kÃ©p */
.template-categories .template-card-image {
    width: 100%;
    height: 160px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.template-categories .template-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* KÃ¡rtya sablon nÃ©v */
.template-categories .template-card-name {
    padding: 10px 12px 6px 12px;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    text-align: center;
    border-top: 1px solid #f3f4f6;
}

/* KÃ¡rtya mÃ©ret */
.template-categories .template-card-size {
    padding: 0 12px 10px 12px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.template-categories .category-body {
    display: none;
    padding: 8px 4px 12px 4px;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
    margin-top: 2px;
}

/* === MOBILE NAVIGATION === */
.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    border-top: 1px solid var(--border-color);
    z-index: 1100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 72px;
}

.mobile-nav-item i {
    font-size: 20px;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

/* Mobil sidebar overlay */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
    display: none;
    transition: opacity 0.3s ease;
}

/* === RESPONSIVE === */
@media (max-width: 1400px) {
    .app-layout {
        grid-template-columns: 240px 1fr 280px;
        gap: 10px;
    }
}

@media (max-width: 1200px) {
    .app-layout {
        grid-template-columns: 220px 1fr 260px;
        gap: 8px;
        padding: 76px 8px 8px 8px;
    }
}

@media (max-width: 900px) {
    .app-layout {
        display: block;
        padding: 76px 8px 80px 8px;
    }
    
    .sizes-scroll-container {
        max-height: 50vh;
    }
    
    .horizontal-size-scroll {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .print-mode-selector {
        flex-direction: column;
        gap: 6px;
    }
    
    .mode-card {
        padding: 8px;
    }
    
    .mode-card .mode-text strong {
        font-size: 12px;
    }
    
    .mode-card .mode-text span {
        font-size: 10px;
    }
    
    .selected-size-display {
        padding: 3px;
    }
    
    .size-summary-text {
        font-size: 13px;
    }
    
    .print-type-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .header {
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .logo span {
        display: none;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .back-link {
        display: none;
    }
    
    .btn {
        padding: 6px 6px;
        font-size: 13px;
    }
    
    .btn span.desktop-text {
        display: none;
    }
    
    .mobile-text {
        display: inline;
    }
    
    /* LEFT SIDEBAR - ElegÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡ns fehÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©r modal */
    .left-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
        max-height: 75vh;
        min-height: 95vh;
        overflow-y: auto;
        border-radius: 0px 20px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1), 0 -2px 8px rgba(179, 18, 23, 0.1);
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        padding: 24px 14px 80px 7px;
        border-top: 3px solid var(--primary-color);
    }
    
    /* RIGHT SIDEBAR - ElegÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡ns fehÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©r modal */
    .right-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
        max-height: 99vh;
        /* min-height: 90vh; */
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1), 0 -2px 8px rgba(179, 18, 23, 0.1);
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        padding: 24px 16px 80px 16px;
        border-top: 3px solid var(--primary-color);
    }
    
    /* Scrim (Ã¡tfedÃ©s/hÃ¡ttÃ©r) - finomabb sÃ¶tÃ©tedÃ©s */
    .mobile-sheet-scrim {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* BezÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡rÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³ gomb - PIROS kerek gomb FEHÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â°R X */
    .mobile-sheet-close {
        position: absolute;
        top: 16px;
        right: 15px;
        z-index: 1003;
        background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
        color: white;
        border: none;
        width: 40px;
        height: 39px;
        border-radius: 50%;
        font-size: 21px;
        font-weight: bold;
        line-height: 0;
        padding-left: 14px;
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: start;
        box-shadow: 0 3px 10px rgba(244, 67, 54, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-sheet-close::before {
        content: '';
        position: absolute;
        top: 0px;
        left: 0px;
        right: 0;
        bottom: 0;
        /* background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%); */
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-sheet-close:active::before {
        opacity: 1;
    }
    
    .mobile-sheet-close:active {
        transform: scale(0.93);
        box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
    }
    
    /* Amikor a modal nyitva van */
    body.mobile-sheet-open.mobile-tab-upload .left-sidebar {
        transform: translateY(0);
    }
    
    body.mobile-sheet-open:not(.mobile-tab-upload) .right-sidebar {
        transform: translateY(0);
    }
    
    body.mobile-sheet-open .mobile-sheet-scrim {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* BezÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡rÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³ gomb csak akkor ha modal nyitva */
    body.mobile-sheet-open .left-sidebar .mobile-sheet-close,
    body.mobile-sheet-open .right-sidebar .mobile-sheet-close {
        display: flex;
    }
    
    /* AlapbÃ³l minden panel rejtve mobilon */
    body.mobile-sheet-open .right-sidebar .panel {
        display: none;
    }
    
    /* Csak a kivÃ¡lasztott tab paneljÃ©t mutatjuk */
    /* 1. MÃ©retek panel */
    body.mobile-tab-sizes .right-sidebar .panel:nth-of-type(1) {
        display: block !important;
    }
    
    /* 2. Sablonok panel */
    body.mobile-tab-templates .right-sidebar .panel:nth-of-type(2) {
        display: block !important;
    }
    
    /* 3. SzÃ¡m sablon panel */
    body.mobile-tab-numbers .right-sidebar .panel:nth-of-type(3) {
        display: block !important;
    }
    /* 4. BetÅ± kollÃ¡zs panel */
    body.mobile-tab-letters .right-sidebar .panel:nth-of-type(4) {
        display: block !important;
    }
    /* 5. HÃ¡tterek panel */
    body.mobile-tab-backgrounds .right-sidebar .panel:nth-of-type(5) {
        display: block !important;
    }
    
    /* 6. Clipartok panel */
    body.mobile-tab-cliparts .right-sidebar .panel:nth-of-type(6) {
        display: block !important;
    }
    
    /* 7. SzÃ¶veg panel */
    body.mobile-tab-text .right-sidebar .panel:nth-of-type(7) {
        display: block !important;
    }
    
    /* Mobilon a panelek ne legyenek Ã¶sszecsukhatÃ³k, mindig nyitva */
    body.mobile-sheet-open .right-sidebar .panel {
        border: none;
        border-radius: 12px;
        box-shadow: none;
        background: transparent;
        margin-bottom: 0;
    }
    body.mobile-sheet-open .right-sidebar .panel .panel-content {
        max-height: none !important;
        padding: 12px !important;
        border-top: 1px solid var(--border-color) !important;
        overflow-y: auto;
    }
    /* OpcionÃ¡lis: fejlÃ©c rejÃ©se mobil sheet-ben a kivÃ¡lasztott panelnÃ©l */
    body.mobile-sheet-open .right-sidebar .panel .panel-header {
        display: none;
    }
    
    body.mobile-sheet-open .right-sidebar .panel-header {
        background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
        padding: 12px 16px;
        border-radius: 10px;
        margin-bottom: 16px;
        border-left: 4px solid var(--primary-color);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }
    
    body.mobile-sheet-open .right-sidebar .panel-title {
        font-size: 15px;
        font-weight: 600;
        color: #333;
    }
    
    body.mobile-sheet-open .right-sidebar .panel-title i {
        color: var(--primary-color);
        margin-right: 8px;
    }
    
    body.mobile-sheet-open .right-sidebar .panel-toggle {
        display: none; /* NyÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­l elrejtÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©se mobilon */
    }
    
    body.mobile-sheet-open .right-sidebar .panel-content {
        display: block !important;
        max-height: none !important;
        padding: 0 8px;
    }
    
    /* mobile-nav-bar NEM hasznÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡lt, a mobile-bottom-bar az aktÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­v */
    .mobile-nav-bar {
        display: none !important;
    }
    
    /* Toolbar mobilon is lÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡thatÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³ ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©s gÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¶rÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¶g */
    .canvas-toolbar-bottom {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 4px;
        gap: 6px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        max-height: 52px;
        background: white;
        border-top: 1px solid #e0e0e0;
        position: fixed;
        bottom: 122px;
        left: 0;
        right: 0;
        z-index: 100;
    }
    
    .canvas-toolbar-bottom::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }
    
    /* MÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©ret ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¶sszefoglalÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³ mobilon lÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡thatÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â³ a canvas felett */
    .selected-size-display {
        display: block !important;
        margin: 0px 0px;
        text-align: center;
    }
    
    .size-display-content {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: rgba(179, 18, 23, 0.05);
        padding: 8px 16px;
        border-radius: 20px;
        border: 2px solid var(--primary-color);
    }
    
    .size-summary-text {
        font-weight: 600;
        color: #333;
        font-size: 14px;
    }
    
    .print-type-badge {
        background: var(--primary-color);
        color: white;
        padding: 3px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
    }
    
    /* Header mobilon - CSAK a vissza link */
    .app-header {
        padding: 0 !important;
        flex-wrap: nowrap;
        gap: 0;
        height: 48px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        background: white;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .header-title {
        display: none !important;
    }
    
    .header-actions {
        display: none !important;
    }
    
    /* Vissza link mobilon felÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¼l, TELJES header */
    .back-link {
        display: flex !important;
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
        padding: 0 16px !important;
        background: white !important;
        border-radius: 0 !important;
        font-size: 14px !important;
        font-weight: 600;
        color: #333 !important;
        text-decoration: none;
        gap: 8px;
        margin: 0;
    }
    
    .back-link i {
        font-size: 16px;
    }
    
    /* Upload zone mobilon elegÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡ns design */
    .desktop-upload-text,
    .desktop-upload-hint {
        display: none !important;
    }
    
    .mobile-upload-text {
        display: block !important;
        font-size: 16px;
        font-weight: 600;
    }
    
    .upload-zone {
        /* padding: 14px 20px !important; */
        cursor: pointer;
        background: linear-gradient(135deg, var(--primary-color) 0%, #8f0f13 100%);
        border: none !important;
        border-radius: 12px;
        box-shadow: 0 3px 8px rgba(179, 18, 23, 0.25);
        transition: all 0.3s ease;
    }
    
    .upload-zone:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(179, 18, 23, 0.2);
    }
    
    .upload-icon i {
        font-size: 28px;
        color: white;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    }
    
    .mobile-upload-text {
        color: white !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    
    /* KijelÃ¶lt kÃ©pek hozzÃ¡adÃ¡sa gomb mobilon */
    .add-selected-images-btn.mobile-only {
        display: block !important;
        width: 100%;
        margin-bottom: 10px;
        padding: 6px;
        font-size: 12px;
        font-weight: 600;
        border-radius: 10px;
    }
    
    /* KÃ©pek kijelÃ¶lÃ©se mobilon */
    @media (max-width: 900px) {
        .image-container {
            position: relative;
        }
        
        .image-container.selected::before {
            content: 'âœ“';
            position: absolute;
            top: 4px;
            right: 4px;
            width: 24px;
            height: 24px;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
            z-index: 2;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        
        .image-container.selected .uploaded-image {
            opacity: 0.7;
            border: 3px solid var(--primary-color);
        }
    }
    
    /* Mobil gombok animÃ¡ciÃ³i */
    #autoArrangeButtonMobile,
    #toggleGridButtonMobile {
        position: relative;
        overflow: hidden;
    }
    
    #autoArrangeButtonMobile::before,
        #toggleGridButtonMobile::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 100%);
            opacity: 0;
            transition: opacity 0.3s ease;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
            z-index: 2;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
    
    /* Left sidebar section title */
    body.mobile-sheet-open .left-sidebar .section-title {
        background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
        padding: 12px 16px;
        border-radius: 10px;
        margin-bottom: 16px;
        border-left: 4px solid var(--primary-color);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        font-size: 15px;
        font-weight: 600;
        color: #333;
    }
    
    body.mobile-sheet-open .left-sidebar .section-title i {
        color: var(--primary-color);
        margin-right: 8px;
    }
    
    /* Asztali gombok elrejtÃ©se mobilon */
    .canvas-toolbar-bottom #autoArrangeButton,
    .canvas-toolbar-bottom #toggleGridButton {
        display: none;
    }
    
    .canvas-toolbar-bottom .desktop-text {
        display: none;
    }
    
    /* Mobil gombok megjelenÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­tve */
    .images-actions-top.mobile-only {
        display: flex !important;
        position: fixed;
        bottom: 167px; /* canvas-toolbar-bottom (52px) + action bar (56px) + bottom bar (56px) + 14px padding */
        left: 4px;
        right: 4px;
        gap: 0px;
        z-index: 100;
        background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(250,250,250,0.95) 100%);
        backdrop-filter: blur(10px);
        padding: 2px;
        border-top: 1px solid rgba(224, 224, 224, 0.5);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    }
    
    #autoArrangeButtonMobile,
    #toggleGridButtonMobile {
        flex: 1;
        padding: 12px 16px !important;
        font-size: 13px !important;
        font-weight: 600;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: center;
        border: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }
    
    #autoArrangeButtonMobile::before,
    #toggleGridButtonMobile::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #autoArrangeButtonMobile:active::before,
    #toggleGridButtonMobile:active::before {
        opacity: 1;
    }
    
    /* AUTOMATA - Kellemes ZÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Å“LD */
    #autoArrangeButtonMobile {
        background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%) !important;
        color: white;
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
    }
    
    #autoArrangeButtonMobile:active {
        transform: scale(0.97);
        box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
    }
    
    #autoArrangeButtonMobile:disabled {
        background: linear-gradient(135deg, #e0e0e0 0%, #d5d5d5 100%) !important;
        color: #999;
        box-shadow: none;
        cursor: not-allowed;
    }
    
    /* RÃƒÆ’Ã†â€™Ãƒâ€šÃ‚ÂCS - Modern SZÃƒÆ’Ã†â€™Ãƒâ€¦Ã¢â‚¬Å“RKE */
    #toggleGridButtonMobile {
        background: linear-gradient(135deg, #78909C 0%, #607D8B 100%) !important;
        color: white;
        box-shadow: 0 4px 12px rgba(96, 125, 139, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
    }
    
    #toggleGridButtonMobile:active {
        transform: scale(0.97);
        box-shadow: 0 2px 6px rgba(96, 125, 139, 0.3);
    }
    
    #autoArrangeButtonMobile i,
    #toggleGridButtonMobile i {
        font-size: 15px;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    }
    
    /* HÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡ttÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©rek grid megjelenÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â­tÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©se mint a mÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©reteknÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©l */
    #backgroundsList {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        max-height: 60vh;
        overflow-y: auto;
        padding: 8px;
    }
    
    #backgroundsList img {
        width: 100% !important;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
        border: 2px solid #e0e0e0;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    #backgroundsList img:active {
        transform: scale(0.95);
        border-color: var(--primary-color);
    }
    
    /* Mobil action bar - elegÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¡ns fehÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©r-szÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¼rke */
    .mobile-action-bar {
        display: flex !important;
        position: fixed;
        bottom: 66px;
        left: 0;
        right: 0;
        height: 56px;
        background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%);
        border-top: 1px solid #e0e0e0;
        align-items: center;
        justify-content: space-around;
        padding: 0 12px;
        z-index: 100;
        box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.08);
    }
    
    /* Asztali action gombok elrejtÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â©se mobilon */
    .header-actions #saveButton,
    .header-actions #openSavedProductsButton,
    .header-actions #exportButton {
        display: none !important;
    }
    
    .mobile-action-bar #saveButton,
    .mobile-action-bar #openSavedProductsButton,
    .mobile-action-bar #exportButton {
        flex: 1;
        margin: 0 4px;
        padding: 11px 12px !important;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border-radius: 10px;
        min-width: auto;
        position: static;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        transition: all 0.3s ease;
        border: none;
    }
    
    .mobile-action-bar #saveButton {
        background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
        color: #555 !important;
    }
    
    .mobile-action-bar #saveButton:active {
        background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%) !important;
        transform: scale(0.97);
    }
    
    .mobile-action-bar #openSavedProductsButton {
        background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
        color: #555 !important;
    }
    
    .mobile-action-bar #openSavedProductsButton:active {
        background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%) !important;
        transform: scale(0.97);
    }
    
    .mobile-action-bar #exportButton {
        background: linear-gradient(135deg, var(--primary-color) 0%, #8f0f13 100%) !important;
        color: white !important;
        font-weight: 600;
        box-shadow: 0 3px 8px rgba(179, 18, 23, 0.3);
    }
    
    .mobile-action-bar #exportButton:active {
        background: linear-gradient(135deg, #8f0f13 0%, #6f0b0e 100%) !important;
        transform: scale(0.97);
    }
    
    .mobile-action-bar #saveButton span,
    .mobile-action-bar #openSavedProductsButton span,
    .mobile-action-bar #exportButton span {
        display: inline;
        font-size: 12px;
        font-weight: 600;
    }
    
    .mobile-action-bar #saveButton i,
    .mobile-action-bar #openSavedProductsButton i,
    .mobile-action-bar #exportButton i {
        font-size: 17px;
        margin-right: 0;
    }
    
    .toolbar-group {
        gap: 2px;
        flex-shrink: 0;
        display: inline-flex !important;
        align-items: center;
    }
    
    .tool-btn {
        min-width: 36px !important;
        height: 36px !important;
        padding: 6px !important;
        font-size: 16px !important;
        flex-shrink: 0;
    }
    
    .divider-vertical {
        height: 30px;
        flex-shrink: 0;
        margin: 0 4px;
        background: var(--border-color);
        width: 1px;
    }
    
    .divider-vertical-mini {
        width: 1px;
        height: 24px;
        background: var(--border-color);
        flex-shrink: 0;
        margin: 0 2px;
    }
    
    .toggle-switch-wrapper {
        flex-shrink: 0;
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        padding: 0 4px;
    }
    
    .toggle-switch {
        transform: scale(0.9);
    }
    
    .toggle-label {
        font-size: 11px !important;
        white-space: nowrap;
        font-weight: 500;
    }
    
    .canvas-info-inline {
        width: 100%;
        justify-content: center;
    }
    
    /* Canvas wrapper mobilon - fix mÃ©ret, arÃ¡nyosan illesztve */
    .canvas-wrapper {
        padding: 8px;
        margin: 0 auto;
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 380px); /* Header + mÃ©ret + toolbar + action bar + bottom bar */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: auto; /* Scroll ha nagyon nagy a canvas */
        position: relative;
    }
    
    .canvas-wrapper canvas {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
        display: block !important;
        margin: auto !important;
    }
    
    /* Canvas container pozicionÃ¡lÃ¡s mobilon */
    .canvas-wrapper #c {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-radius: 4px;
    }
    
    /* Center content mobilon - padding alul a mobil nav Ã©s action bar miatt */
    .center-content {
        padding-bottom: 224px !important; /* Toolbar (~52px) + gombok sÃ¡v (~52px) + action bar (56px) + bottom bar (56px) = ~216px */
        padding-top: 50px !important; /* Header alatt */
    }
    
    /* Header layout mobilon */
    .header {
        flex-wrap: nowrap !important;
        padding: 8px 10px !important;
        gap: 8px !important;
    }
    
    .logo {
        flex-shrink: 0;
        font-size: 14px !important;
    }
    
    .logo span {
        display: none !important;
    }
    
    .back-link {
        flex-shrink: 0;
        font-size: 12px !important;
        padding: 6px 8px !important;
    }
    
    .back-link i {
        margin-right: 4px;
    }
    
    .header-actions {
        display: flex !important;
        gap: 4px;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .header-actions .btn {
        padding: 6px 8px !important;
        font-size: 12px !important;
        white-space: nowrap;
        min-width: unset !important;
    }
    
    .header-actions .btn span {
        display: none !important;
    }
    
    .header-actions .btn i {
        margin-right: 0 !important;
        font-size: 16px;
    }
}

@media (min-width: 901px) {
    .back-link {
        display: flex;
    }
}

/* === HELPER CLASSES === */
.hidden {
    display: none !important;
}

/* === UPLOAD OVERLAY === */
#uploadOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#uploadOverlay[style*="display: flex"],
#uploadOverlay[style*="display:flex"] {
    display: flex !important;
}

.uploadLoader {
    font-size: 20px;
    color: white;
    font-weight: 600;
    animation: fadeInOut 1.5s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* === KRITIKUS RÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â°GI ELEMEK (script.js kompatibilitÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡s) === */
#floating-preview {
    display: none;
    position: fixed;
    padding: 8px;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    border-radius: 8px;
    background: white;
    z-index: 1000;
}

.images-list img, .images-grid img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.images-list img:hover, .images-grid img:hover {
    transform: scale(1.05);
}

.template-list, .templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.template-list img, .templates-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.template-list img:hover, .templates-grid img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.backgrounds-list, .backgrounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.backgrounds-list img, .backgrounds-grid img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.backgrounds-list img:hover, .backgrounds-grid img:hover {
    border-color: var(--primary-color);
}

.background-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 6px;
}

.background-color-picker label {
    font-size: 13px;
    font-weight: 600;
}

.background-color-picker input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 6px;
}

.toolbar select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

.toolbar input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.toolbar i {
    font-size: 16px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.toolbar i:hover {
    color: var(--primary-color);
}

.text-area {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.text-options {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border: 1px solid #e5e7eb;
}

.font-selector-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.font-selector-container i {
    color: var(--primary-color);
    font-size: 16px;
}

.font-selector-container select,
#newFontSelector, #fontSelector {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}

.font-selector-container select:focus,
#newFontSelector:focus, #fontSelector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

.text-options-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    flex: 1;
}

.color-picker-container i {
    color: var(--primary-color);
    font-size: 16px;
}

.color-picker-container input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-picker-container input[type="color"]:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.text-area-container {
    background: white;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.text-area-container textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s;
}

.text-area-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

/* Canvas mask overlay */
#canvas-mask {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

/* Modal stilusok */
.modal, .modal_vagas {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"],
.modal[style*="display:flex"],
.modal_vagas[style*="display: flex"],
.modal_vagas[style*="display:flex"] {
    display: flex !important;
}

.modal-content, .modal-content_vagas {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.close-button, .close-crop-modal {
    float: right;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
}

.close-button:hover, .close-crop-modal:hover {
    color: var(--danger-color);
}

/* Saved products modal */
.saved-products-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    align-items: center;
    justify-content: center;
}

.saved-products-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
}

.saved-products-close-button {
    float: right;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
}

.saved-products-close-button:hover {
    color: var(--danger-color);
}

/* Mug message */
.mug-message {
    display: none;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
}

.mug-left, .mug-center, .mug-right {
    flex: 1;
    text-align: center;
    padding: 5px;
    background: white;
    border-radius: 4px;
    margin: 0 5px;
}

/* Info section */
.info-section {
    display: none;
    align-items: center;
    padding: 10px;
    background: #fff1f2;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
}

.info-section i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* Custom button */
.custom-button {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-button:hover {
    background: #8f0f13;
}

/* Auto arrange button */
.auto-arrange-btn {
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auto-arrange-btn:hover {
    background: #8f0f13;
}

.auto-arrange-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* Buttons container (rÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â©gi) - ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡tirÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡nyÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â­tjuk a modern toolbar-ra */
.buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-top: 12px;
}

.buttons-container button {
    padding: 8px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.buttons-container button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Image item with delete button */
.image-item {
    position: relative;
}

.delete-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    z-index: 2;
}

.image-item:hover .delete-image-btn {
    opacity: 1;
}

/* Cliparts grid */
.cliparts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.cliparts-grid img {
    width: 100%;
    height: 60px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

.cliparts-grid img:hover {
    transform: scale(1.1);
}

/* Print mode selector (vÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡szon/poszter vÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡lasztÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â³) */
.print-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    padding: 0 4px;
    flex-direction: row;
}

.mode-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-card i {
    font-size: 18px;
    color: var(--text-muted);
}

.mode-card .mode-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.mode-card .mode-text strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.mode-card .mode-text span {
    font-size: 11px;
    color: var(--text-muted);
}

.mode-card:hover {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.05);
}

.mode-card.selected {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.1);
}

.mode-card.selected i {
    color: var(--primary-color);
}

/* VÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡lasztott mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â©ret megjelenÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â­tÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â©se */
.selected-size-display {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 10px;
    /* padding: 12px; */
   margin-top: -14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(179, 18, 23, 0.15);
}

.size-display-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.size-summary-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.print-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Sizes scroll container */
.sizes-scroll-container {
    margin-bottom: 12px;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sizes-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.sizes-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.sizes-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sizes-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.horizontal-size-scroll {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 0px;
}

.size-option,
.size-option-card,
.horizontal-size-scroll .size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.size-option .size-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.size-option .size-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.size-option .size-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.size-option:hover,
.size-option-card:hover,
.horizontal-size-scroll .size-card:hover {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.05);
    transform: translateY(-2px);
}

.size-option.selected,
.size-option-card.selected,
.horizontal-size-scroll .size-card.selected {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.1);
}

.size-preview-box {
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 0 auto;
}

.size-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.size-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.size-dimensions {
    font-size: 11px;
    color: var(--text-muted);
}

/* Template selector product (mÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â©retvÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¡lasztÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â³) */
.template-selector-product {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.product-option:hover {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.05);
}

.product-option.selected {
    border-color: var(--primary-color);
    background: rgba(179, 18, 23, 0.1);
}

.product-preview {
    width: 60px;
    height: 50px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.product-details {
    font-size: 11px;
    color: var(--text-muted);
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* === Uploaded Images - improved thumbnails & delete icon === */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
}

.image-container {
    position: relative;
    display: inline-block;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(179, 18, 23, 0.35);
}

.uploaded-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.delete-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    z-index: 2;
}

.image-container:hover .delete-icon {
    opacity: 1;
}

/* === Auto arrange & Grid buttons (left panel) === */
#autoArrangeButton,
#toggleGridButton {
    padding: 8px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow);
    justify-content: center;
}

#autoArrangeButton {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8f0f13 100%);
    color: #fff;
    border: none;
}

#autoArrangeButton:hover {
    filter: brightness(0.98);
    transform: translateY(-1px);
}

#toggleGridButton:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

#autoArrangeButton i,
#toggleGridButton i {
    font-size: 14px;
}

#mobileSheetClose { display: none; }
@media (max-width: 900px) { #mobileSheetClose { display: block; } }

/* === SABLON TÃƒâ€“RLÃƒâ€°SE GOMB === */
.clear-template-button {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.clear-template-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

.clear-template-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.clear-template-button i {
    font-size: 16px;
}

/* ðŸŽ¨ LOADING MODAL - SzÃ©p loading kÃ©pernyÅ‘ */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-modal-overlay {
    position: absolute; /* ðŸ”¥ ABSOLUTE - szÃ¼lÅ‘ #overlay-en belÃ¼l */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1; /* SzÃ¼lÅ‘n belÃ¼l alul */
}

.loading-modal-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 50px 60px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: modalFadeIn 0.4s ease-out;
    z-index: 2; /* ðŸ”¥ SzÃ¼lÅ‘ #overlay-en belÃ¼l felÃ¼l */
}

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

/* SpinneranimÃ¡ciÃ³ */
.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #8f0f13;
    animation-duration: 1.8s;
    animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #6f0b0e;
    animation-duration: 2.1s;
    animation-delay: -0.6s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* SzÃ¶vegek */
.loading-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.loading-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0 0 30px 0;
    font-weight: 400;
}

/* Progress bar */
.loading-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b31217 0%, #8f0f13 50%, #6f0b0e 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
        background-position: 0% 0%;
    }
    50% {
        width: 70%;
        background-position: 100% 0%;
    }
    100% {
        width: 100%;
        background-position: 200% 0%;
    }
}

/* Mobilra optimalizÃ¡lÃ¡s */
@media (max-width: 768px) {
    .loading-modal-content {
        padding: 40px 30px;
        max-width: 90%;
    }
    
    .loading-spinner {
        width: 100px;
        height: 100px;
    }
    
    .loading-title {
        font-size: 20px;
    }
    
    .loading-subtitle {
        font-size: 14px;
    }
}

/* ðŸŽ¨ UPLOAD LOADING MODAL - KÃ©pfeltÃ¶ltÃ©s modal */
#uploadOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.upload-modal-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 45px 50px;
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: uploadModalFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100000;
}

@keyframes uploadModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Upload Cloud Icon */
.upload-icon-wrapper {
    margin-bottom: 25px;
}

.upload-cloud {
    display: inline-block;
    animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

.upload-arrow {
    animation: arrowPulse 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes arrowPulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(5px);
    }
}

/* SzÃ¶vegek */
.upload-title {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.upload-subtitle {
    font-size: 15px;
    color: #7f8c8d;
    margin: 0 0 25px 0;
    font-weight: 400;
}

/* Progress Container */
.upload-progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.upload-progress-bar {
    flex: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #b31217 0%, #8f0f13 50%, #6f0b0e 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
    0% {
        background-position: 200% 0%;
    }
    100% {
        background-position: -200% 0%;
    }
}

.upload-percentage {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 50px;
}

/* Hint */
.upload-hint {
    font-size: 13px;
    color: #95a5a6;
    margin: 0;
    padding: 12px 20px;
    background: rgba(179, 18, 23, 0.05);
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
}

/* Mobilra optimalizÃ¡lÃ¡s */
@media (max-width: 768px) {
    .upload-modal-content {
        padding: 35px 25px;
        max-width: 90%;
    }
    
    .upload-cloud svg {
        width: 60px;
        height: 60px;
    }
    
    .upload-title {
        font-size: 22px;
    }
    
    .upload-subtitle {
        font-size: 14px;
    }
    
    .upload-percentage {
        font-size: 16px;
    }
    
    .upload-hint {
        font-size: 12px;
        padding: 10px 15px;
    }
}

/* ðŸŽ¨ PREVIEW GENERATION MODAL - ElÅ‘nÃ©zeti kÃ©p generÃ¡lÃ¡s */
#previewGenerationOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal-overlay {
    position: fixed; /* ðŸ”¥ FIXED hogy mindig tetejÃ©n legyen */
    top: 0;
    left: 0;
    width: 100vw; /* Teljes viewport szÃ©lessÃ©g */
    height: 100vh; /* Teljes viewport magassÃ¡g */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999; /* ðŸ”¥ LEGMAGASABB rÃ©teg */
}

.preview-modal-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 50px 55px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: previewModalFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100000;
}

@keyframes previewModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Preview Icon */
.preview-icon-wrapper {
    margin-bottom: 30px;
}

.preview-icon-wrapper svg {
    animation: previewIconPulse 2s ease-in-out infinite;
}

@keyframes previewIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.preview-frame {
    animation: frameRotate 3s linear infinite;
    transform-origin: center;
}

@keyframes frameRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.preview-lens {
    animation: lensZoom 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes lensZoom {
    0%, 100% {
        r: 4;
        opacity: 1;
    }
    50% {
        r: 5;
        opacity: 0.7;
    }
}

.preview-flash {
    animation: flashBlink 1s ease-in-out infinite;
}

@keyframes flashBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Preview szÃ¶vegek */
.preview-title {
    font-size: 25px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.preview-subtitle {
    font-size: 15px;
    color: #7f8c8d;
    margin: 0 0 30px 0;
    font-weight: 400;
}

/* Animated dots */
.preview-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.dot {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #b31217 0%, #8f0f13 100%);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobilra optimalizÃ¡lÃ¡s */
@media (max-width: 768px) {
    .preview-modal-content {
        padding: 40px 30px;
        max-width: 90%;
    }
    
    .preview-icon-wrapper svg {
        width: 80px;
        height: 80px;
    }
    
    .preview-title {
        font-size: 22px;
    }
    
    .preview-subtitle {
        font-size: 14px;
    }
    
    .dot {
        width: 12px;
        height: 12px;
    }
}

/* ðŸ”„ RENDEZÃ‰SI KONTROLLOK - FeltÃ¶ltÃ¶tt kÃ©pek rendezÃ©se */
.images-sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

.images-sort-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin: 0;
    white-space: nowrap;
}

.images-sort-controls label i {
    font-size: 14px;
    color: var(--primary-color);
}

.sort-dropdown {
    flex: 1;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.sort-dropdown:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(179, 18, 23, 0.15);
}

.sort-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(179, 18, 23, 0.1);
}

.sort-dropdown option {
    padding: 8px;
}

/* Mobilra optimalizÃ¡lÃ¡s */
@media (max-width: 768px) {
    .images-sort-controls {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .images-sort-controls label {
        font-size: 12px;
    }
    
    .images-sort-controls label i {
        font-size: 13px;
    }
    
    .sort-dropdown {
        font-size: 12px;
        padding: 7px 10px;
    }
}