/* 
 * Mobile Viewport & Touch Target Optimization
 * SEO & Accessibility Compliance
 */

/* Viewport Meta Tag Support */
@-ms-viewport {
    width: device-width;
    initial-scale: 1;
}

/* iOS Safari viewport fix */
@supports (-webkit-overflow-scrolling: touch) {
    html {
        -webkit-text-size-adjust: 100%;
    }
}

/* Android Chrome viewport fix */
@supports (display: -webkit-flex) {
    html {
        -webkit-text-size-adjust: 100%;
    }
}

/* Touch Target Minimum Sizes - WCAG Compliance */
button, 
input[type="button"], 
input[type="submit"], 
input[type="reset"], 
a, 
.clickable {
    min-width: 44px;
    min-height: 44px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Small touch targets fix */
.touch-target-small {
    min-width: 32px;
    min-height: 32px;
    padding: 8px;
}

/* Large touch targets for important actions */
.touch-target-large {
    min-width: 56px;
    min-height: 56px;
    padding: 16px;
}

/* Form element touch targets */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents iOS zoom */
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: #dc2626;
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Prevent iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"] {
        font-size: 16px !important;
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    font-size: 16px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    nav a {
        min-height: 44px;
        padding: 12px 16px;
        display: block;
        font-size: 16px;
    }
    
    .mobile-menu-button {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
        font-size: 18px;
    }
}

/* Card Interactions */
.card, .product-card, .service-card {
    padding: 16px;
    margin: 8px 0;
    border-radius: 12px;
    min-height: 120px;
}

.card h3, .product-card h3, .service-card h3 {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.card p, .product-card p, .service-card p {
    font-size: 16px;
    line-height: 1.6;
}

/* Breadcrumb Touch Targets */
.breadcrumb a {
    min-height: 32px;
    padding: 8px 12px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

/* Social Media Links */
.social-link {
    min-width: 44px;
    min-height: 44px;
    padding: 12px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Skip Links for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #dc2626;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    font-size: 16px;
}

.skip-link:focus {
    top: 6px;
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Landscape Mode Adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
    html {
        font-size: 14px;
    }
    
    .hero-slider h1 {
        font-size: clamp(20px, 4vw, 32px) !important;
    }
    
    .hero-slider p {
        font-size: clamp(16px, 2.5vw, 20px) !important;
    }
}

/* Tablet Specific Adjustments */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    html {
        font-size: 16px;
    }
    
    button, .btn {
        min-width: 48px;
        min-height: 48px;
        padding: 14px 28px;
    }
    
    input, textarea, select {
        min-height: 48px;
        padding: 14px 18px;
    }
}

/* Large Screen Optimization */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .text-responsive {
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1 { font-size: 18pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 14pt; }
    h4, h5, h6 { font-size: 12pt; }
    
    a:after {
        content: " (" attr(href) ")";
    }
    
    .no-print {
        display: none !important;
    }
}
