/* ==========================================
   EXCEED SOLAR - RESPONSIVE STYLESHEET
   Mobile-first responsive design
   ========================================== */

/* ==========================================
   TABLET (768px - 1024px)
   ========================================== */
@media (max-width: 1024px) {
    /* Header */
    .header-content {
        padding: var(--spacing-sm) 0;
        align-items: center;
    }

    .logo-link {
        justify-content: center;
    }

    .logo-mark {
        width: 108px;
        max-height: 76px;
    }

    .header-cta {
        margin-left: auto;
    }

    .header-cta .btn {
        padding: 10px 16px;
        font-size: var(--font-size-small);
    }

    .phone-link {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 500px;
        padding: 80px 0;
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-visual {
        justify-self: center;
        width: min(100%, 420px);
    }

    .hero-highlight {
        position: static;
        left: auto;
        bottom: auto;
        max-width: none;
        margin-top: -18px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Sections */
    section, .section {
        padding: var(--spacing-xl) 0;
    }

    /* Grids */
    .card-grid,
    .services-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calculator-wrapper,
    .quote-wrapper,
    .contact-grid,
    .about-grid,
    .two-column {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
    }

    .two-column {
        gap: var(--spacing-md);
    }

    /* Footer */
    .footer-content, .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Partners Grid - Tablet */
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Testimonials - Tablet */
    .testimonial-card {
        flex: 0 0 calc(50% - var(--spacing-md));
    }
}

@media (max-width: 900px) {
    .header-content {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .logo {
        flex: 1 1 auto;
    }

    .header-cta {
        display: none;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(86vw, 360px);
        height: 100vh;
        background-color: var(--color-white);
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-normal);
        z-index: 1001;
        overflow-y: auto;
        padding-top: 18px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-xl) var(--spacing-md);
        gap: 0;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid var(--color-gray-light);
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: var(--color-gray-light);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
        padding: 0;
        min-width: 0;
    }

    .dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: var(--spacing-sm);
    }

    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
        z-index: 1002;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .quote-intro,
    .quote-form-wrapper,
    .calculator-form,
    .calculator-results,
    .form-card {
        padding: var(--spacing-md);
    }

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

    .footer-content,
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .footer-brand-text,
    .footer-links,
    .footer-contact {
        text-align: center;
    }
}

/* ==========================================
   MOBILE (Below 768px)
   ========================================== */
@media (max-width: 767px) {
    :root {
        --font-size-h1: 32px;
        --font-size-h2: 28px;
        --font-size-h3: 22px;
        --font-size-h4: 18px;
        --font-size-body: 15px;
        --spacing-sm: 12px;
        --spacing-md: 16px;
        --spacing-lg: 24px;
        --spacing-xl: 32px;
        --spacing-xxl: 40px;
    }

    section {
        padding: var(--spacing-xl) 0;
    }

    /* ==========================================
       HEADER - MOBILE
       ========================================== */
    .header-content {
        padding: var(--spacing-sm) 0;
    }

    .logo-mark {
        width: 92px;
        max-height: 66px;
    }

    .header-content {
        flex-wrap: nowrap;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: 60px 0;
    }

    .hero .container {
        grid-template-columns: 1fr;
    }

    .hero-content {
        text-align: center;
        gap: 16px;
    }

    .hero-visual {
        justify-self: center;
        width: min(100%, 320px);
    }

    .hero-highlight {
        position: static;
        max-width: none;
        margin-top: 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-cta, .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-cta .btn,
    .hero-actions .btn {
        width: 100%;
        max-width: 100%;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .hero-stat {
        padding: var(--spacing-sm);
    }

    .hero-stat strong {
        font-size: 1.25rem;
    }

    /* Page Hero */
    .page-hero, .page-header {
        padding: 60px 0;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    /* Sections */
    section, .section {
        padding: var(--spacing-lg) 0;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: var(--spacing-md);
    }

    /* Grids - Single column on mobile */
    .card-grid,
    .services-grid,
    .features-grid,
    .testimonials-grid,
    .mvv-grid,
    .cert-grid,
    .team-grid,
    .benefits-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cards */
    .card {
        padding: var(--spacing-sm);
    }

    .card-icon,
    .feature-icon,
    .benefit-icon,
    .mvv-icon,
    .contact-icon {
        transform: scale(0.92);
    }

    /* Buttons */
    .btn {
        padding: 12px 20px;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 1rem;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .calculator-wrapper,
    .quote-wrapper,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile form improvements */
    input,
    select,
    textarea {
        min-height: 44px; /* WCAG 2.5.5 minimum touch target size */
        font-size: 16px; /* Prevent iOS auto-zoom on focus */
        padding: 12px 14px;
    }

    textarea {
        min-height: 80px; /* Reduce from default 120px on mobile */
    }

    button[type="submit"],
    .btn {
        min-height: 48px; /* Larger touch target for primary actions */
        font-size: 16px;
        padding: 14px 24px;
    }

    .form-message {
        font-size: 14px;
        max-width: 90vw;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Tables */
    .pricing-table,
    .subsidy-table table {
        font-size: var(--font-size-small);
    }

    .pricing-table,
    .subsidy-table {
        overflow-x: auto;
    }

    .pricing-table th,
    .pricing-table td,
    .subsidy-table th,
    .subsidy-table td {
        padding: var(--spacing-xs);
    }

    /* Hide some columns on mobile */
    .pricing-table th:nth-child(4),
    .pricing-table td:nth-child(4),
    .pricing-table th:nth-child(5),
    .pricing-table td:nth-child(5) {
        display: none;
    }

    /* FAQ */
    .faq-categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--spacing-sm);
    }

    .faq-cat-btn {
        white-space: nowrap;
    }

    /* Projects */
    .project-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--spacing-sm);
    }

    .filter-btn {
        white-space: nowrap;
    }

    .project-grid, .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-info {
        grid-template-columns: 1fr;
    }

    /* Tags */
    .tag-grid {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--spacing-sm);
    }

    .tag {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Timeline */
    .timeline-item, .process-step {
        flex-direction: column;
        text-align: center;
    }

    .timeline-item span, .step-number {
        margin: 0 auto var(--spacing-sm);
    }

    /* Process Steps */
    .process-steps {
        grid-template-columns: 1fr;
    }

    /* CTA */
    .cta-section {
        padding: var(--spacing-lg);
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 100%;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-sm);
    }

    .footer-content, .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-brand {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    .footer-links,
    .footer-contact {
        text-align: center;
    }

    /* Floating elements */
    .whatsapp-float, .floating-whatsapp {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 15px;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        right: 15px;
        bottom: 75px;
    }

    /* About page */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
    }

    .team-card {
        padding: var(--spacing-sm);
    }

    .about-photo-frame img {
        min-height: 280px;
    }

    /* Products */
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* Calculator Results */
    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-card .result-value {
        font-size: 1.25rem;
    }

    /* Quote benefits */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .benefit-item {
        padding: var(--spacing-sm);
    }

    .benefit-icon {
        font-size: 2rem;
    }

    /* Brand logos */
    .brand-logos, .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Partners Grid */
    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .partner-card {
        padding: var(--spacing-sm);
    }

    .partner-logo {
        width: 80px;
        height: 48px;
    }

    .partner-name {
        font-size: 0.75rem;
    }

    /* Testimonials Carousel */
    .testimonials-carousel {
        padding: var(--spacing-sm) 0;
    }

    .testimonial-card {
        flex: 0 0 calc(100% - var(--spacing-md));
        min-width: 280px;
    }

    .carousel-controls {
        gap: var(--spacing-sm);
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-summary,
    .tag-grid,
    .trust-badges,
    .cta-buttons,
    .social-links {
        justify-content: center;
    }
}

/* ==========================================
   SMALL MOBILE (Below 480px)
   ========================================== */
@media (max-width: 480px) {
    .container {
        width: 96%;
    }

    .logo-mark {
        width: 78px;
        max-height: 56px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.96rem;
    }

    .page-hero, .page-header {
        padding: 48px 0;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .results-grid,
    .brand-logos, .brands-grid,
    .partners-grid {
        grid-template-columns: 1fr;
    }

    .hero-photo-card,
    .about-photo-frame,
    .quote-form-wrapper,
    .calculator-form,
    .calculator-results,
    .form-card {
        padding: var(--spacing-sm);
    }

    .quote-intro {
        padding: 0;
    }

    .benefit-item,
    .partner-card,
    .result-card,
    .team-card {
        padding: var(--spacing-sm);
    }

    /* Hide less important table columns */
    .subsidy-table th:nth-child(3),
    .subsidy-table td:nth-child(3) {
        display: none;
    }
}

/* ==========================================
   LARGE SCREENS (Above 1400px)
   ========================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .header,
    .footer,
    .whatsapp-float,
    .floating-whatsapp,
    .back-to-top,
    .mobile-menu-toggle,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    .container {
        width: 100%;
        max-width: none;
    }

    section, .section {
        padding: 20px 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0044AA;
        --color-secondary: #008800;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4);
    }
}

/* ==========================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .filter-btn,
    .faq-cat-btn,
    .tag {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Remove hover effects on touch devices */
    .card:hover,
    .service-card:hover,
    .project-card:hover,
    .feature-item:hover {
        transform: none;
    }

    /* Dropdown behavior for touch */
    .dropdown-menu {
        transition: none;
    }
}

/* ==========================================
   LANDSCAPE MOBILE
   ========================================== */
@media (max-width: 896px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 40px 0;
    }

    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .page-hero, .page-header {
        padding: 40px 0;
    }
}
