/* Mobile Optimization for Legal Documents */

/* Base mobile fixes */
body {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive typography */
@media (max-width: 768px) {
    body {
        padding: 15px !important;
        font-size: 15px;
        line-height: 1.7;
    }
    
    h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 20px !important;
    }
    
    h2 {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin-top: 25px !important;
        margin-bottom: 12px !important;
    }
    
    h3 {
        font-size: 17px !important;
        line-height: 1.4 !important;
        margin-top: 18px !important;
        margin-bottom: 8px !important;
    }
    
    p {
        font-size: 15px !important;
        line-height: 1.7 !important;
        margin-bottom: 12px !important;
    }
    
    .info-block {
        padding: 15px !important;
        margin: 15px 0 !important;
        border-radius: 8px !important;
    }
    
    ul, ol {
        padding-left: 20px !important;
        margin-left: 0 !important;
    }
    
    li {
        margin-bottom: 8px !important;
        font-size: 15px;
        line-height: 1.6;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 14px;
    }
    
    th, td {
        padding: 10px 8px !important;
        font-size: 14px !important;
    }
    
    .tariff-card {
        min-width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
    }
    
    .tariffs-container {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .tariff-price {
        font-size: 32px !important;
    }
    
    .tariff-name {
        font-size: 20px !important;
    }
    
    .warning {
        padding: 12px !important;
        margin: 15px 0 !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    body {
        padding: 10px !important;
    }
    
    h1 {
        font-size: 22px !important;
    }
    
    h2 {
        font-size: 18px !important;
    }
    
    .tariff-card {
        padding: 20px !important;
    }
    
    .info-block {
        padding: 12px !important;
    }
}

/* Touch targets */
a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
    text-decoration: underline;
    color: #E92452;
    word-break: break-word;
}

/* Better readability */
p, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
}

/* Prevent text overflow */
.info-block, table, pre, code {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* iOS fixes */
@supports (-webkit-touch-callout: none) {
    body {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px !important;
    }
    
    h1 {
        margin-bottom: 15px !important;
    }
}

/* Print optimization */
@media print {
    body {
        padding: 0 !important;
        max-width: 100% !important;
        font-size: 12pt !important;
    }
    
    h1 {
        font-size: 18pt !important;
    }
    
    h2 {
        font-size: 16pt !important;
    }
    
    .info-block {
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    a {
        text-decoration: underline !important;
        color: #000 !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: #000;
    }
    
    a {
        color: #0000ff;
    }
    
    .info-block {
        border: 2px solid #000;
    }
}
