/* Mobile CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile Header Styles */
.mobile-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    height: 100%;
}

.mobile-logo {
    height: 32px;
    width: auto;
    display: block;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-icon {
    color: #666;
    text-decoration: none;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-touch-callout: none;
}

.header-icon svg {
    width: 24px;
    height: 24px;
}

.menu-toggle {
    background: none;
    border: none;
    color: #666;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Mobile Menu */
.mobile-menu {
    background: white;
    position: fixed;
    top: 60px;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 999;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-menu a {
    display: block;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    -webkit-touch-callout: none;
}

.mobile-menu a:active {
    background: #f5f5f5;
}

.desktop-link {
    background: #f0f0f0;
    font-size: 14px;
}

/* Main Content */
.mobile-main {
    padding-top: 60px;
    padding-bottom: 20px;
    min-height: 100vh;
}

/* Hero Section */
.mobile-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 15px 30px;
    color: white;
}

.hero-content h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 20px;
    opacity: 0.95;
}

.hero-image {
    margin-top: 20px;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* CTA Buttons */
.cta-button {
    display: inline-block;
    padding: 12px 24px;
    background: #99cc33;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    border: none;
    cursor: pointer;
    text-align: center;
}

.cta-button:active {
    transform: scale(0.98);
}

.cta-button.secondary {
    background: white;
    color: #333;
    border: 2px solid #ddd;
}

.cta-button.primary {
    background: #99cc33;
}

/* Products Section */
.mobile-products {
    padding: 25px 15px;
}

.mobile-products h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.product-card h3 {
    font-size: 1.25rem;
    margin: 15px 15px 10px;
    color: #99cc33;
    font-weight: 600;
}

.product-card p {
    font-size: 0.95rem;
    color: #666;
    margin: 0 15px 15px;
    line-height: 1.5;
}

.product-link {
    color: #99cc33;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin: 0 15px 15px;
    font-size: 1rem;
}

/* Quick Access Section */
.mobile-quick-access {
    padding: 25px 15px;
    background: white;
}

.mobile-quick-access h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: #f8f8f8;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.quick-link:active {
    background: #e5e5e5;
}

.quick-link svg {
    margin-bottom: 8px;
    color: #99cc33;
}

.quick-link span {
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

/* Ketcher Demo Section */
.mobile-demo {
    padding: 25px 15px;
    background: #f5f5f5;
}

.mobile-demo h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.mobile-demo p {
    margin-bottom: 20px;
    color: #666;
    font-size: 0.95rem;
}

.ketcher-mobile-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ketcher-mobile-container iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
}

.demo-note {
    font-size: 0.85rem;
    color: #999;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Contact CTA Section */
.mobile-cta {
    padding: 30px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.mobile-cta h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.mobile-cta p {
    margin-bottom: 20px;
    opacity: 0.95;
    font-size: 0.95rem;
}

.cta-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 15px;
    text-align: center;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.95;
}

/* Footer */
.mobile-footer {
    background: white;
    color: #333;
    padding: 25px 15px;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo img {
    height: 32px;
    width: auto;
}

.footer-contact {
    margin-bottom: 20px;
}

.footer-contact p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.footer-contact a {
    color: #99cc33;
    text-decoration: none;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #99cc33;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* iPhone-specific adjustments */
@supports (-webkit-touch-callout: none) {
    /* iOS only styles */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    .mobile-header {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    
    .mobile-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-main {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Safe area adjustments for iPhone X and later */
@supports (padding: max(0px)) {
    .mobile-header {
        padding-top: max(0px, env(safe-area-inset-top));
        height: calc(60px + env(safe-area-inset-top));
    }
    
    .mobile-menu {
        top: calc(60px + env(safe-area-inset-top));
        height: calc(100vh - 60px - env(safe-area-inset-top));
    }
    
    .mobile-main {
        padding-top: calc(60px + env(safe-area-inset-top));
    }
}

/* Small phone adjustments */
@media (max-width: 375px) {
    .hero-content h1 {
        font-size: 1.35rem;
    }
    
    .mobile-products h2,
    .mobile-quick-access h2,
    .mobile-demo h2,
    .mobile-cta h2 {
        font-size: 1.35rem;
    }
    
    .quick-links-grid {
        gap: 10px;
    }
    
    .quick-link {
        padding: 15px 8px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .header-icon {
        padding: 6px;
    }
}

/* Landscape adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-header {
        height: 50px;
    }
    
    .header-container {
        padding: 5px 15px;
    }
    
    .mobile-menu {
        top: 50px;
        height: calc(100vh - 50px);
    }
    
    .mobile-main {
        padding-top: 50px;
    }
    
    .mobile-hero {
        padding: 15px;
    }
    
    .ketcher-mobile-container iframe {
        height: 300px;
    }
}