/* ==========================================================================
   Aldin Cycles - Responsive Styles
   Ensures the website fits well on all device screens
   ========================================================================== */

/* ==========================================================================
   Base Mobile Styles (320px and up)
   ========================================================================== */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive typography */
html {
    font-size: 16px;
}

/* ==========================================================================
   Extra Small Devices (phones, less than 576px)
   ========================================================================== */
@media screen and (max-width: 35.5em) {
    /* Reduce section padding on mobile */
    section {
        padding-block: calc(2.5rem * var(--mantine-scale)) !important;
    }
    
    /* Smaller headings on mobile */
    h1, ._section-heading_1tbxf_11 {
        font-size: clamp(1.25rem, 6vw, 1.75rem) !important;
    }
    
    h2 {
        font-size: clamp(1.125rem, 5vw, 1.5rem) !important;
    }
    
    /* Stack grid items vertically */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Reduce padding in containers */
    ._container_1tbxf_1 {
        width: 92% !important;
        padding-inline: 0;
    }
    
    /* Fix button sizing on mobile */
    .m_77c9d27d, 
    [class*="mantine-Button"] {
        padding: calc(0.75rem * var(--mantine-scale)) calc(1.25rem * var(--mantine-scale)) !important;
        font-size: calc(0.875rem * var(--mantine-scale)) !important;
    }
    
    /* Ensure text doesn't overflow */
    p, span, a {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Footer grid on mobile */
    ._footer-grid_sc5n0_27 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Terms and Privacy page content */
    .terms-content,
    .privacy-content {
        padding: calc(1rem * var(--mantine-scale)) !important;
    }
    
    .terms-content h2,
    .privacy-content h2 {
        font-size: calc(1.25rem * var(--mantine-scale)) !important;
    }
    
    /* 404 page adjustments */
    .error-code {
        font-size: calc(5rem * var(--mantine-scale)) !important;
    }
    
    .error-title {
        font-size: calc(1.5rem * var(--mantine-scale)) !important;
    }
    
    .error-buttons {
        flex-direction: column !important;
    }
    
    .error-btn {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Helpful links on 404 */
    .helpful-links-list {
        flex-direction: column !important;
        gap: calc(0.75rem * var(--mantine-scale)) !important;
    }
    
    /* Header adjustments */
    main {
        padding-top: 70px !important;
    }
    
    /* Card padding reduction */
    [style*="padding: calc(2rem"] {
        padding: calc(1.25rem * var(--mantine-scale)) !important;
    }
    
    /* Flex wrap for button groups */
    [class*="mantine-Group"] {
        flex-wrap: wrap !important;
    }
    
    /* Download buttons stack */
    ._download-links-wrapper_rib52_65 {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    ._download-link_rib52_65,
    ._download-link_1b7v3_143 {
        width: 100% !important;
        max-width: 200px !important;
    }
}

/* ==========================================================================
   Small Devices (landscape phones, 576px to 768px)
   ========================================================================== */
@media screen and (min-width: 35.5em) and (max-width: 48em) {
    ._container_1tbxf_1 {
        width: 90% !important;
    }
    
    /* Two column grid where appropriate */
    ._footer-grid_sc5n0_27 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    /* Adjust section padding */
    section {
        padding-block: calc(3rem * var(--mantine-scale)) !important;
    }
}

/* ==========================================================================
   Medium Devices (tablets, 768px to 992px)
   ========================================================================== */
@media screen and (min-width: 48em) and (max-width: 62em) {
    ._container_1tbxf_1 {
        width: 92% !important;
    }
    
    /* Footer grid */
    ._footer-grid_sc5n0_27 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5rem !important;
    }
}

/* ==========================================================================
   Large Devices (desktops, 992px to 1200px)
   ========================================================================== */
@media screen and (min-width: 62em) and (max-width: 75em) {
    ._container_1tbxf_1 {
        width: 94% !important;
    }
    
    /* Footer grid */
    ._footer-grid_sc5n0_27 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ==========================================================================
   Extra Large Devices (large desktops, 1200px and up)
   ========================================================================== */
@media screen and (min-width: 75em) {
    ._container_1tbxf_1 {
        width: min(95%, 80rem) !important;
    }
    
    /* Footer grid */
    ._footer-grid_sc5n0_27 {
        grid-template-columns: 1.5fr repeat(3, 1fr) !important;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    a, button, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    a:hover, button:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    /* Hide non-essential elements */
    #header-component,
    #footer-component,
    .error-buttons,
    .helpful-links {
        display: none !important;
    }
    
    /* Reset backgrounds for printing */
    body, main, section {
        background: white !important;
        color: black !important;
    }
    
    /* Ensure text is readable */
    p, span, a, h1, h2, h3, h4, h5, h6 {
        color: black !important;
    }
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */
@media (prefers-contrast: high) {
    a {
        text-decoration: underline !important;
    }
    
    button, [role="button"] {
        border: 2px solid currentColor !important;
    }
}

/* ==========================================================================
   Landscape Orientation Fixes
   ========================================================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape on small screens */
    section {
        padding-block: calc(2rem * var(--mantine-scale)) !important;
    }
    
    main {
        padding-top: 60px !important;
    }
    
    /* Smaller hero sections */
    .error-page {
        min-height: 100vh !important;
        padding: calc(1rem * var(--mantine-scale)) !important;
    }
    
    .error-icon {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: calc(1rem * var(--mantine-scale)) !important;
    }
    
    .error-code {
        font-size: calc(4rem * var(--mantine-scale)) !important;
        margin-bottom: calc(0.5rem * var(--mantine-scale)) !important;
    }
}

/* ==========================================================================
   Safe Area Insets (for notched devices)
   ========================================================================== */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    #header-component {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    footer, ._footer_sc5n0_1 {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   Fix for inline styles with fixed widths
   ========================================================================== */
@media screen and (max-width: 48em) {
    /* Override inline grid styles */
    [style*="grid-template-columns: repeat(auto-fit, minmax(400px"] {
        grid-template-columns: 1fr !important;
    }
    
    [style*="grid-template-columns: repeat(auto-fit, minmax(300px"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Fix max-width constraints */
    [style*="max-width: 900px"],
    [style*="max-width: 1000px"],
    [style*="max-width: 1100px"] {
        max-width: 100% !important;
        padding-inline: calc(1rem * var(--mantine-scale));
    }
}

/* ==========================================================================
   Vehicle/E-bike Page Responsive Fixes
   ========================================================================== */
@media screen and (max-width: 48em) {
    /* FAQ items stack properly */
    [style*="display: grid"][style*="gap: calc(1.5rem"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Spec cards */
    [style*="display: flex"][style*="flex-wrap: wrap"] > div {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
}

/* ==========================================================================
   Location Page Responsive Fixes
   ========================================================================== */
@media screen and (max-width: 48em) {
    /* Map container */
    .locations-map-container {
        height: 300px !important;
    }
    
    /* Zone cards horizontal scroll */
    .zone-cards-container {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .zone-cards-container > div {
        flex: 0 0 280px !important;
        scroll-snap-align: start !important;
    }
}

/* ==========================================================================
   Partner Page Responsive Fixes
   ========================================================================== */
@media screen and (max-width: 48em) {
    /* Partners gallery */
    .partners-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (max-width: 35.5em) {
    .partners-gallery {
        grid-template-columns: 1fr !important;
    }
}
