/* Mobile Responsiveness Fixes for Craig Hite LLC Website */
/* This file fixes all identified mobile UX issues */

/* TOUCH TARGET IMPROVEMENTS */
/* Make all clickable elements at least 44px in height/width for better touch accessibility */

/* Footer links */
.footer-link,
.footer a {
    min-height: 44px !important;
    padding: 12px 16px !important;
    display: inline-block !important;
    font-size: 16px !important;
    line-height: 20px !important;
}

/* Phone number links */
.flow-phone,
a[href^="tel:"] {
    min-height: 44px !important;
    padding: 12px 16px !important;
    display: inline-block !important;
    font-size: 18px !important;
    line-height: 20px !important;
}

/* Product action links */
.product-link,
.view-product-link,
a[href*="product"] {
    min-height: 44px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    line-height: 20px !important;
    display: inline-block !important;
}

/* Header logo */
.logo-text,
.logo-link {
    min-height: 44px !important;
    padding: 12px 8px !important;
    font-size: 18px !important;
    line-height: 20px !important;
    display: inline-block !important;
}

/* Back navigation links */
.back-link,
.nav-back {
    min-height: 44px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Cart action buttons */
.cart-action-btn,
.cart-reload,
.cart-clear {
    min-height: 44px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    line-height: 20px !important;
}

/* Product buttons */
.flow-button,
.action-buttons .btn,
.btn-primary,
.btn-secondary {
    min-height: 48px !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    line-height: 24px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Tab buttons */
.tab-btn {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 24px !important;
}

/* FORM IMPROVEMENTS */
/* Better input modes and touch targets for forms */

/* Email inputs */
input[type="email"],
input[name="email"] {
    inputmode: email !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    line-height: 24px !important;
}

/* Phone inputs */
input[type="tel"],
input[name*="phone"],
input[name*="Phone"] {
    inputmode: tel !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 24px !important;
}

/* Number inputs */
input[type="number"],
input[name*="quantity"] {
    inputmode: numeric !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 24px !important;
}

/* Text inputs and textareas */
input[type="text"],
textarea,
.flow-input {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 24px !important;
}

/* Textarea specific */
textarea {
    min-height: 120px !important;
    resize: vertical !important;
}

/* Select dropdowns */
select,
.equipment-dropdown,
.engine-dropdown {
    min-height: 48px !important;
    padding: 12px 40px 12px 16px !important;
    font-size: 16px !important;
    line-height: 24px !important;
    background-size: 20px !important;
    background-position: right 12px center !important;
}

/* TEXT READABILITY IMPROVEMENTS */
/* Ensure all text is at least 14px for better readability */

/* Small text elements */
.product-description p,
.feature-item,
.shipping-badge,
.small-text,
.footer-text {
    font-size: 14px !important;
    line-height: 22px !important;
}

/* MOBILE TEXT SPACING FIXES */
/* Fix cramped text descriptions on mobile */
@media (max-width: 768px) {
    .product-description p {
        margin: 0 0 16px 0 !important;
        line-height: 1.6 !important;
        font-size: 15px !important;
        color: rgba(255, 255, 255, 0.7) !important;
    }
    
    .product-description {
        padding: 24px 0 !important;
        margin-bottom: 32px !important;
    }
    
    /* Feature items spacing */
    .feature-item {
        padding: 12px 0 !important;
        margin-bottom: 8px !important;
        line-height: 1.5 !important;
    }
    
    /* Tab panel text spacing */
    .tab-panel p {
        margin-bottom: 16px !important;
        line-height: 1.6 !important;
        font-size: 14px !important;
    }
    
    .tab-panel ul li {
        padding: 8px 0 !important;
        line-height: 1.5 !important;
    }
}

/* Very small links */
.view-product-link,
.view-details-link,
.view-service-link {
    font-size: 14px !important;
    line-height: 20px !important;
    padding: 8px 12px !important;
    min-height: 38px !important;
    display: inline-block !important;
}

/* PRODUCT IMAGE FIXES FOR MOBILE */
/* Ensure product images display properly on mobile */
@media (max-width: 768px) {
    .main-image-container {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        min-height: 300px !important;
        margin-bottom: 20px !important;
    }
    
    .main-image {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        padding: 20px !important;
        display: block !important;
    }
    
    .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
        margin-top: 16px !important;
    }
    
    .thumbnail {
        aspect-ratio: 1 !important;
        min-height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .thumbnail img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        padding: 8px !important;
    }
    
    /* Product gallery mobile spacing */
    .product-gallery {
        margin-bottom: 32px !important;
        position: relative !important;
        top: 0 !important;
    }
}

/* MOBILE-SPECIFIC LAYOUT IMPROVEMENTS */
@media (max-width: 768px) {

    /* Mobile header spacing adjustments - keep text large but fit properly */
    .logo-text,
    .logo-link {
        font-size: 16px !important; /* Slightly smaller but still bold */
        padding: 10px 6px !important; /* Tighter padding */
        letter-spacing: 0.05em !important; /* Tighter letter spacing */
    }

    .minimal-nav-link span {
        font-size: 14px !important; /* Keep readable but compact */
        padding: 0 !important;
    }

    .minimal-nav-link {
        padding: 10px 10px !important; /* Less padding */
        margin: 0 2px !important; /* Minimal gap between buttons */
    }

    .flow-header {
        padding: 10px 0 !important; /* Reduce header height */
    }

    .header-content {
        gap: 8px !important; /* Tighter gap between logo and nav */
    }

    .minimal-nav-buttons {
        gap: 4px !important; /* Less space between nav buttons */
    }

    /* Prevent horizontal scrolling */
    body,
    html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Container max-width fixes */
    .flow-container,
    .container,
    .content {
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        overflow-x: hidden !important;
    }
    
    /* Product grid mobile optimization */
    .flow-grid,
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        margin-top: 24px !important;
    }
    
    /* Action buttons mobile layout */
    .action-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
    }
    
    .action-buttons .flow-button {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Product hero mobile improvements */
    .product-hero-content {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 0 16px !important;
    }
    
    /* Product info mobile spacing */
    .product-info {
        padding: 24px 16px !important;
    }
    
    .product-name {
        font-size: 24px !important;
        line-height: 28px !important;
        margin-bottom: 16px !important;
    }
    
    .product-subtitle {
        font-size: 16px !important;
        line-height: 22px !important;
        margin-bottom: 24px !important;
    }
    
    /* Price section mobile layout */
    .price-section {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 16px !important;
        margin-bottom: 24px !important;
    }
    
    .price-value {
        font-size: 32px !important;
        line-height: 36px !important;
    }
    
    /* Tab navigation mobile improvements */
    .tabs-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    
    .tabs-nav::-webkit-scrollbar {
        display: none !important;
    }
    
    .tab-btn {
        flex-shrink: 0 !important;
        min-width: 120px !important;
        white-space: nowrap !important;
    }
    
    /* Tab content mobile spacing */
    .tabs-content {
        padding: 24px 16px !important;
    }
    
    /* Service interface mobile improvements */
    .service-interface {
        padding: 24px 16px !important;
        margin: 0 !important;
    }
    
    .service-form h3 {
        font-size: 20px !important;
        line-height: 24px !important;
    }
    
    /* Questions mobile layout */
    .question-buttons {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 20px !important;
    }
    
    .btn-yes,
    .btn-no {
        width: 80px !important;
        height: 80px !important;
        font-size: 14px !important;
    }
    
    /* Service options mobile */
    .service-options {
        gap: 12px !important;
    }
    
    .service-option-btn {
        padding: 20px 16px !important;
        text-align: left !important;
    }
    
    .service-option-content h4 {
        font-size: 18px !important;
        line-height: 22px !important;
    }
    
    .service-option-content p {
        font-size: 14px !important;
        line-height: 20px !important;
    }
    
    /* Cart widget mobile positioning */
    .cart-widget {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .cart-expanded {
        width: 280px !important;
        max-width: calc(100vw - 40px) !important;
    }
}

/* ACCESSIBILITY IMPROVEMENTS */

/* Focus states for better keyboard navigation */
.flow-button:focus,
.btn:focus,
.tab-btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--flow-cyan) !important;
    outline-offset: 2px !important;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}