/**
 * diskret.me - Mobil-optimalisering
 */

/* KRITISK: Forhindre horisontal scroll på body */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Alle tabeller må kunne scrolle */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.comparison-table,
.price-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

/* Table wrapper for ekstra sikkerhet */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem -1rem;
    padding: 0 1rem;
}

/* Generelle elementer */
img, video, iframe, pre, code {
    max-width: 100%;
}

/* Mobil breakpoint */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Tabeller */
    table, .comparison-table, .price-table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem 0.5rem !important;
    }
    
    /* Grid til én kolonne */
    .info-grid,
    .reviews-grid,
    .cards-grid,
    .features-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Flex wrapping */
    .service-header,
    .service-body,
    .meta-row {
        flex-wrap: wrap !important;
    }
}

/* Små mobiler */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
    h3 { font-size: 1.1rem !important; }
    
    table, .comparison-table, .price-table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.4rem 0.35rem !important;
    }
    
    .hero { padding: 1.5rem 0 !important; }
    section, .section { padding: 1.5rem 0 !important; }
    
    .cta-button, .btn {
        width: 100%;
        text-align: center;
    }
}

/* Veldig små skjermer */
@media (max-width: 360px) {
    body {
        font-size: 13px;
    }

    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    table, .comparison-table, .price-table {
        font-size: 0.7rem;
    }

    th, td {
        padding: 0.3rem 0.25rem !important;
    }
}

/* ===== Sticky mobil-banner for hemli.me ===== */
.hemli-mobile-banner {
    display: none;
}

@media (max-width: 768px) {
    /* Vis banneret kun på mobil */
    .hemli-mobile-banner {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
        padding: 0.6rem 1rem;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .hemli-mobile-banner .hemli-logo-link {
        display: flex;
        align-items: center;
        text-decoration: none;
        flex-shrink: 0;
    }

    .hemli-mobile-banner .hemli-logo-svg {
        height: 26px;
        width: auto;
    }

    .hemli-mobile-banner .hemli-tagline {
        font-size: 0.75rem;
        color: #7a7a7a;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hemli-mobile-banner .hemli-cta {
        display: inline-block;
        background: linear-gradient(135deg, #6366f1, #ec4899);
        color: white;
        padding: 0.5rem 1.25rem;
        border-radius: 20px;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
        transition: opacity 0.2s;
    }

    .hemli-mobile-banner .hemli-cta:hover {
        opacity: 0.9;
    }

    /* Legg til padding i bunnen av body så banneret ikke dekker innhold */
    body {
        padding-bottom: 60px !important;
    }

    /* Pros-cons til en kolonne */
    .pros-cons {
        grid-template-columns: 1fr !important;
    }

    /* Rating items til en kolonne */
    .rating-items {
        grid-template-columns: 1fr !important;
    }

    /* Alternative-box responsivitet */
    .alternative-box {
        padding: 1.5rem !important;
    }

    /* Related links som blokk */
    .related-links a {
        display: block !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
}
