/* Mobile Optimization - Prevent Horizontal Overflow */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive Tables */
table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

@media (max-width: 768px) {
    table {
        font-size: 0.85rem;
    }
}

/* Prevent Text Overflow */
.article-body {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Container Max Width */
.container,
.article-layout {
    max-width: 100%;
    overflow-x: hidden;
}

/* Hero Section Mobile Fix */
.hero {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.hero h1,
.hero h2 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Info/Warning/Verdict Boxes Mobile */
.info-box,
.warning-box,
.verdict-box,
.checklist-box {
    max-width: 100%;
    overflow: hidden;
}

/* Breadcrumb Mobile Fix */
.breadcrumb {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.breadcrumb-inner {
    white-space: nowrap;
    min-width: min-content;
}

/* Navigation Mobile Fix */
nav ul {
    padding: 0;
    margin: 0;
}

/* Footer Mobile Fix */
.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Specific Mobile Breakpoints */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .article-layout {
        padding: 0 16px 40px;
        margin: 20px auto;
    }
    
    .hero {
        padding: 40px 16px !important;
    }
    
    .hero h1,
    .hero h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .article-body h2 {
        font-size: 1.25rem;
        margin: 28px 0 12px;
        word-wrap: break-word;
    }
    
    .article-body h3 {
        font-size: 1.05rem;
        margin: 20px 0 8px;
    }
    
    .article-body p {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 14px;
    }
    
    .article-body ul,
    .article-body ol {
        font-size: 0.95rem;
        padding-left: 20px;
    }
    
    .article-body li {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    
    .compare-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 16px -16px 20px;
        padding: 0 16px;
    }
    
    .compare-table table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .info-box,
    .warning-box,
    .checklist-box {
        padding: 14px 16px;
        margin: 20px 0;
    }
    
    .verdict-box {
        padding: 20px 18px;
        margin: 24px 0;
    }
    
    .breadcrumb {
        font-size: 0.78rem;
    }
    
    .breadcrumb-inner {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .article-layout {
        padding: 0 12px 30px;
    }
    
    .hero h1,
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .hero p {
        font-size: 0.92rem;
    }
    
    .article-body h2 {
        font-size: 1.15rem;
        margin: 24px 0 10px;
    }
    
    .article-body h3 {
        font-size: 0.98rem;
        margin: 18px 0 8px;
    }
    
    .article-body p {
        font-size: 0.9rem;
    }
    
    .article-body ul,
    .article-body ol {
        font-size: 0.9rem;
    }
    
    .article-body li {
        font-size: 0.9rem;
    }
    
    .compare-table {
        margin: 16px -12px 20px;
        padding: 0 12px;
    }
    
    .compare-table table {
        min-width: 480px;
        font-size: 0.8rem;
    }
    
    .compare-table th,
    .compare-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .verdict-box {
        padding: 16px 14px;
    }
    
    .verdict-box h3 {
        font-size: 0.95rem;
    }
    
    .verdict-box p,
    .verdict-box li {
        font-size: 0.82rem;
    }
}

/* Prevent Horizontal Scroll on All Devices */
@media (max-width: 1024px) {
    * {
        max-width: 100%;
    }
    
    pre,
    code {
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}
