/**
 * Brake IQ - Media Queries & Mobile Responsiveness
 */

/* Desktop / Large Screens (Default state is desktop-first, let's adjust margins) */
@media (max-width: 1200px) {
    :root {
        --width-container: 960px;
    }
    
    .hero h1 {
        font-size: 2.75rem;
    }
}

/* Tablet (Landscape and Portrait) */
@media (max-width: 1024px) {
    :root {
        --width-container: 720px;
        --space-2xl: 3rem;
        --space-3xl: 4.5rem;
    }
    
    .hero {
        min-height: auto;
        padding-top: calc(var(--height-header) + var(--space-xl));
        padding-bottom: var(--space-2xl);
    }
    
    .hero-container {
        flex-direction: column;
    }
    
    .hero-content {
        max-width: 100%;
        text-align: center;
        margin-bottom: var(--space-2xl);
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    /* Hero Visual stacks below text */
    .hero-visual {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        height: auto;
        max-width: 600px;
        margin-right: auto;
        margin-left: auto;
        margin-top: var(--space-xl);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

/* Mobile Screens (Landscape & Large Phones) */
@media (max-width: 768px) {
    :root {
        --width-container: 100%;
        --space-xl: 1.5rem;
        --space-2xl: 2.5rem;
        --space-3xl: 3.5rem;
        --height-header: 70px;
    }
    
    body {
        padding-bottom: 60px; /* Space for mobile bottom sticky CTA bar */
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .page-header {
        padding-top: calc(var(--height-header) + var(--space-xl));
        padding-bottom: var(--space-xl);
    }
    
    .page-header p {
        font-size: 1.1rem;
    }
    
    /* Show mobile hamburger navigation */
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--height-header);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--height-header));
        background-color: var(--color-bg-primary);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-lg);
        border-top: 1px solid var(--color-border);
        transform: translateX(100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
    }
    
    .nav-menu.open {
        transform: translateX(0);
    }
    
    .nav-item {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid var(--color-border);
    }
    
    .nav-link {
        width: 100%;
        padding: var(--space-md) 0;
        font-size: 1.1rem;
    }
    
    /* Sub-menu Dropdown on Mobile */
    .dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        background-color: transparent;
        padding-left: var(--space-md);
        display: none; /* Controlled via JS */
        width: 100%;
    }
    
    .nav-item.open .dropdown-menu {
        display: block;
    }
    
    .dropdown-link {
        padding: var(--space-sm) 0;
        font-size: 0.95rem;
    }
    
    .nav-cta {
        display: none; /* Hide header CTA button on mobile, sticky bar takes over */
    }
    
    /* Telemetry Labels adjustments for mobile */
    .telemetry-pin {
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-sm);
    }
    
    .telemetry-label {
        font-size: 0.7rem;
    }
    
    .telemetry-value {
        font-size: 0.7rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .services-overview {
        padding: var(--space-lg) 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    /* Mobile Sticky CTA Bar Display */
    .mobile-cta-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: #04070f;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
        z-index: 90;
    }
    
    .mobile-cta-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--color-text-secondary);
        font-size: 0.75rem;
        font-weight: 500;
        text-decoration: none;
        border-right: 1px solid var(--color-border);
        transition: all var(--transition-fast);
    }
    
    .mobile-cta-item:last-child {
        border-right: none;
    }
    
    .mobile-cta-item svg {
        margin-bottom: 2px;
    }
    
    .mobile-cta-item:hover,
    .mobile-cta-item:active {
        color: var(--color-accent-primary);
        background-color: rgba(255, 255, 255, 0.02);
    }
    
    .mobile-cta-item.cta-whatsapp {
        background-color: rgba(37, 211, 102, 0.05);
    }
    
    .mobile-cta-item.cta-whatsapp:hover,
    .mobile-cta-item.cta-whatsapp:active {
        color: #25D366;
        background-color: rgba(37, 211, 102, 0.1);
    }
    
    .mobile-cta-item.cta-book {
        background-color: rgba(0, 180, 216, 0.05);
        color: var(--color-accent-primary);
    }
    
    .mobile-cta-item.cta-book:hover,
    .mobile-cta-item.cta-book:active {
        background-color: rgba(0, 180, 216, 0.1);
        color: var(--color-accent-hover);
    }
}

/* Small Phones */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .hero h1 {
        font-size: 2.15rem;
    }
    
    .footer-banner {
        padding: var(--space-xl) var(--space-md);
    }
    
    .footer-banner h2 {
        font-size: 1.5rem;
    }
}
