/* Globális Stílusjegyek a prompt alapján */
html, body.layout-body {
    background-color: #f4f7f6;
    font-family: 'Poppins', sans-serif;
    
    /* LÁBLÉC LERAGASZTÁSA ÉS ALAP BEÁLLÍTÁSOK */
    height: 100%;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Asztali nézet: Belső görgethető konténer az aloldalaknak (A JAVÍTOTT RÉSZ!) */
.scrollable-page-container {
    overflow-y: auto !important;
    min-height: 0 !important;
    height: 0 !important; /* Rákényszerítjük, hogy maradjon a szülő keretein belül */
    flex: 1 1 0 !important; /* Kitölti a maradék helyet, és azon belül görget */
    display: block;
    width: 100%;
}

/* A lábléc sosem nyomódhat össze, és mindig alul marad */
footer, .footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* --- ASZTALI NÉZET (Desktop) SZIGORÚ SZABÁLYAI --- */
@media (min-width: 992px) {
    body.layout-body {
        height: 100vh !important; 
        overflow: hidden !important; 
    }
    
    .main-wrapper {
        min-height: 0 !important;
        flex: 1 1 0 !important; /* PC-n ez sem lóghat túl a képernyőn! */
    }
    
    .left-panel {
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 4px !important; 
    }
    
    .mobile-canvas {
        min-height: 0 !important;
    }
}

/* --- EGYEDI, LETISZTULT GÖRGETŐSÁV --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent; 
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #ced4da; 
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd; 
}

#pdf-show-price:checked {
        background-color: #ffc107 !important; /* Bootstrap Warning sárga */
        border-color: #ffc107 !important;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23212529'/%3e%3c/svg%3e") !important; /* Fekete pötty */
    }
    #pdf-show-price {
        cursor: pointer;
        width: 2.5em;
        height: 1.25em;
    }

/* --- KÖZEPES NÉZET (Tablet) SZABÁLYAI --- */
@media (max-width: 991px) {
    .mobile-canvas {
        height: 50vh !important;
        min-height: 350px !important;
    }
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* SaaS Kártya dizájn */
.saas-card {
    background-color: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    padding: 10px 12px; 
    margin-bottom: 10px; 
}

.btn-custom {
    border-radius: 6px;
    font-weight: 600;
}

#canvas-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.shadow-inner {
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.stats-badge {
    border-radius: 6px;
}

#alert-container .alert {
    padding: 0.4rem 0.8rem;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

/* =========================================
   MOBIL NÉZET OPTIMALIZÁLÁS (768px alatt)
   ========================================= */
@media (max-width: 768px) {
    /* 1. SZIGORÚ MOBIL GÖRGETÉS: A teljes oldal (body) görögjön, ne a belső dobozok! */
    html, body.layout-body {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: visible !important; 
        overflow-x: hidden !important;
    }

    /* Kiszabadítjuk a konténert a belső görgetésből mobilon! */
    .scrollable-page-container {
        overflow-y: visible !important;
        height: auto !important;
        flex: 1 0 auto !important;
    }

    /* Főoldal konténere mobilon ne nyúljon meg! */
    .main-wrapper {
        height: auto !important;
        overflow-y: visible !important;
        flex: 0 0 auto !important; 
    }
    
    .left-panel {
        height: auto !important;
        overflow-y: visible !important;
    }

    /* Csak az aloldalak konténerei kilökik a láblécet */
    .container.flex-grow-1 {
        height: auto !important;
        overflow-y: visible !important;
        flex: 1 0 auto !important; 
    }

    /* A jobb oszlop és a kártya ne nyúljon el! */
    .col-lg-9[style*="height: 100%"] {
        height: auto !important;
    }
    .saas-card.flex-grow-1 {
        flex: 0 0 auto !important;
        height: auto !important;
    }

    /* A 3D CANVAS BEBETONOZÁSA */
    #canvas-container.mobile-canvas {
        height: 450px !important; 
        min-height: 450px !important;
        max-height: 450px !important; 
        flex: 0 0 auto !important; 
        border-radius: 10px;
        margin-top: 15px;
        margin-bottom: 20px;
        border: 1px solid #dee2e6;
    }

    /* Fejléc elemeinek szép középre rendezése mobilon */
    .navbar .ms-auto {
        margin-top: 12px;
        width: 100%;
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    .navbar .me-3 {
        margin-right: 0 !important; 
    }

    .container-fluid, .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .saas-card {
        margin-bottom: 15px !important;
    }

    /* Főoldali és aloldali elemek felnagyítása kizárólag mobilon */
    .saas-card h6, h4 {
        font-size: 1rem !important; 
        margin-bottom: 0.75rem !important;
    }
    .saas-card .form-label {
        font-size: 0.85rem !important; 
        margin-bottom: 2px !important;
    }
    .saas-card .form-control-sm, 
    .saas-card .form-select-sm,
    .form-control {
        font-size: 1rem !important; 
        padding: 0.5rem 0.6rem !important;
        min-height: 42px !important; 
    }
    .saas-card .btn-custom, 
    .saas-card .btn-sm,
    .btn {
        font-size: 0.95rem !important;
        padding-top: 0.6rem !important;
        padding-bottom: 0.6rem !important;
        min-height: 42px !important;
    }
    .row.g-1 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
}