/* ============================================
   ViaLuma — Responsive Design
   Mobile-First Approach
   ============================================ */

/* ============================================
   BASE MOBILE (320px - 479px)
   ============================================ */
@media (max-width: 479px) {
    /* Typography Scale Down */
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    h4 { font-size: var(--text-lg); }

    /* Hero */
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .hero-content {
        padding-top: 100px;
    }

    .hero-title .line-1 {
        font-size: var(--text-4xl);
        letter-spacing: -0.02em;
    }

    .hero-title .line-2 {
        font-size: var(--text-xl);
    }

    .hero-subtitle {
        font-size: var(--text-base);
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .hero-scroll-indicator {
        display: none;
    }

    /* Header */
    .site-header {
        padding: var(--space-md) 0;
    }

    .site-logo-text {
        font-size: var(--text-base);
    }

    .header-actions .btn-quote-nav {
        display: none;
    }

    .header-actions .account-link span {
        display: none;
    }

    /* Sections */
    .section {
        padding: var(--space-3xl) 0;
    }

    .section-lg {
        padding: var(--space-3xl) 0 var(--space-2xl);
    }

    .section-header {
        margin-bottom: var(--space-2xl);
    }

    .section-header h2 {
        font-size: var(--text-2xl);
    }

    /* Grids */
    .products-grid,
    .commercial-grid,
    .benefits-grid,
    .industries-grid {
        grid-template-columns: 1fr;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    /* Process Steps */
    .process-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .process-steps::before {
        display: none;
    }

    .process-step {
        flex: none;
        width: 100%;
        flex-direction: row;
        text-align: left;
        gap: var(--space-lg);
        padding: var(--space-lg);
        background: var(--color-surface);
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-border);
    }

    .process-step-number {
        width: 48px;
        height: 48px;
        font-size: var(--text-sm);
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .process-step-desc {
        max-width: none;
    }

    .process-step-arrow {
        display: none;
    }

    /* CTA Section */
    .cta-section {
        padding: var(--space-3xl) 0;
    }

    .cta-section h2 {
        font-size: var(--text-2xl);
    }

    .cta-section .cta-sub {
        font-size: var(--text-lg);
    }

    .cta-section p {
        font-size: var(--text-sm);
    }

    /* ViaZONE */
    .viazone-header h2 {
        font-size: var(--text-2xl);
    }

    .viazone-visual {
        aspect-ratio: 3/4;
        border-radius: var(--radius-lg);
    }

    .zone-marker {
        transform: scale(0.7);
    }

    .zone-marker:hover,
    .zone-marker.active {
        transform: scale(0.8);
    }

    .zone-label {
        font-size: 8px;
    }

    .zone-label .zone-tag {
        font-size: 7px;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .quote-form {
        padding: var(--space-xl);
    }

    /* Power Finder */
    .power-finder {
        padding: 100px 0 var(--space-2xl);
    }

    .wizard-step-title {
        font-size: var(--text-xl);
    }

    .wizard-step-subtitle {
        font-size: var(--text-sm);
    }

    .power-finder-progress {
        gap: 4px;
    }

    .progress-dot {
        width: 6px;
        height: 6px;
    }

    /* Results */
    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-item {
        padding: var(--space-md);
    }

    .result-item-value {
        font-size: var(--text-2xl);
    }

    /* Account */
    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: static;
        padding: var(--space-lg);
    }

    .account-nav-item {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--text-xs);
    }

    .account-main {
        padding: var(--space-lg) 0;
    }

    /* Footer */
    .site-footer {
        padding: var(--space-3xl) 0 var(--space-lg);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    /* Product Card Details (Solutions Page) */
    .product-card h3 {
        font-size: var(--text-xl);
    }

    .product-card-capacity {
        font-size: var(--text-3xl);
    }

/* Industries Page Alternating Layout */
.industry-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    align-items: center;
    margin-bottom: var(--space-5xl);
}

.industry-row.reverse {
    direction: rtl;
}

.industry-row > * {
    direction: ltr;
}

@media (max-width: 767px) {
    .industry-row {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }
    
    .industry-row.reverse {
        direction: ltr;
    }
    
    /* How It Works Steps */
    .hiw-step {
        flex-direction: column !important;
        text-align: center;
        gap: var(--space-lg);
    }
    
    .hiw-step-num {
        width: 60px;
        height: 60px;
    }
    
    .hiw-step-content {
        max-width: none;
    }
}

/* Power Map */
.power-map-visual {
    aspect-ratio: 3/4;
    margin-bottom: var(--space-2xl);
}

.power-map-zone {
    padding: var(--space-xs);
}

.power-map-zone-label {
    font-size: 7px;
}

.power-map-zone-unit {
    font-size: 6px;
}

/* Login/Register Grid */
.login-register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

@media (max-width: 767px) {
    .login-register-grid {
        grid-template-columns: 1fr;
    }
    
    .login-register-grid > div {
        order: -1;
    }
    
    /* Quick Actions Grid */
    .quick-actions-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Power Map Zone Legend */
.power-map-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.power-map-legend-item {
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

    /* Stats Row */
    .stats-row {
        flex-wrap: wrap;
        gap: var(--space-xl);
        padding: var(--space-xl) 0;
    }

    .stat-item {
        flex: 0 0 calc(50% - var(--space-md));
    }

    .stat-value {
        font-size: var(--text-3xl);
    }

    /* Buttons */
    .btn {
        font-size: var(--text-xs);
        padding: var(--space-sm) var(--space-lg);
    }

    .btn-lg {
        font-size: var(--text-sm);
        padding: var(--space-md) var(--space-2xl);
    }

    /* Mobile Nav */
    .mobile-nav {
        padding: var(--space-xl);
    }

    .mobile-nav .nav-link {
        font-size: var(--text-xl);
        margin-bottom: var(--space-sm);
    }

    /* Quick Actions Grid (Account Dashboard) */
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    /* Breadcrumbs */
    .breadcrumbs {
        font-size: 10px;
        padding: var(--space-md) 0;
    }

    /* Tag */
    .tag {
        font-size: 9px;
        padding: 3px 10px;
    }
}

/* ============================================
   MOBILE MEDIUM (480px - 767px)
   ============================================ */
@media (min-width: 480px) and (max-width: 767px) {
    .hero-title .line-1 {
        font-size: var(--text-5xl);
    }

    .hero-title .line-2 {
        font-size: var(--text-2xl);
    }

    .products-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .commercial-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .option-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-step {
        flex: 0 0 calc(50% - var(--space-md));
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        flex: 0 0 calc(50% - var(--space-md));
    }
}

/* ============================================
   TABLET (768px - 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .commercial-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .industries-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-steps {
        flex-wrap: wrap;
        gap: var(--space-lg);
        justify-content: center;
    }

    .process-steps::before {
        display: none;
    }

    .process-step {
        flex: 0 0 calc(33.333% - var(--space-md));
    }

    .process-step-arrow {
        display: none;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl);
    }

    .option-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .account-layout {
        grid-template-columns: 200px 1fr;
    }
}

/* ============================================
   LAPTOP (1025px - 1439px)
   ============================================ */
@media (min-width: 1025px) and (max-width: 1439px) {
    .main-nav {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .mobile-nav {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .commercial-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .industries-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .process-steps {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .process-step {
        flex: 1;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .account-layout {
        grid-template-columns: 240px 1fr;
    }
}

/* ============================================
   LARGE DESKTOP (1440px+)
   ============================================ */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .hero-title .line-1 {
        font-size: 6rem;
    }

    .account-layout {
        grid-template-columns: 260px 1fr;
    }
}

/* ============================================
   ULTRAWIDE (1920px+)
   ============================================ */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .hero-title .line-1 {
        font-size: 7rem;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover,
    .benefit-card:hover,
    .industry-card:hover,
    .commercial-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .zone-marker:hover .zone-tooltip {
        opacity: 0;
        visibility: hidden;
    }

    .zone-marker.active .zone-tooltip {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-3xl) 0;
    }

    .hero-content {
        padding-top: 80px;
    }

    .hero-scroll-indicator {
        display: none;
    }
}

/* ============================================
   SAFE AREA (Notched Devices)
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
    }

    .mobile-nav {
        padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-left,
    .fade-in-right {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .zone-dot,
    .energy-line,
    .hero-scroll-indicator {
        animation: none;
    }

    .product-card,
    .benefit-card,
    .industry-card,
    .commercial-card {
        transition: none;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (forced-colors: active) {
    .btn-primary {
        border: 2px solid currentColor;
    }

    .zone-dot {
        border: 2px solid currentColor;
    }

    .tag {
        border: 1px solid currentColor;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .mobile-nav,
    .mobile-menu-toggle,
    .hero-scroll-indicator,
    .energy-lines,
    .scroll-top,
    .btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .section {
        padding: 2rem 0;
        page-break-inside: avoid;
    }

    .product-card,
    .benefit-card,
    .industry-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* ============================================
   MOBILE UTILITY CLASSES
   ============================================ */
@media (max-width: 767px) {
    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Show on mobile only */
    .show-mobile {
        display: block !important;
    }
    
    /* Full width on mobile */
    .full-width-mobile {
        width: 100% !important;
    }
    
    /* Stack buttons on mobile */
    .btn-group-mobile {
        flex-direction: column;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* Reduce padding on mobile */
    .section-mobile-sm {
        padding-top: var(--space-2xl) !important;
        padding-bottom: var(--space-2xl) !important;
    }
    
    .section-mobile-xs {
        padding-top: var(--space-xl) !important;
        padding-bottom: var(--space-xl) !important;
    }
}

/* ============================================
   TABLET & UP UTILITY CLASSES
   ============================================ */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}
