/* =====================================================================
   Champ Electric — Responsive Stylesheet
   Mobile-first: base = ~375px phones. Breakpoints add up.
   ===================================================================== */

/* --- Small phones (375px+) already covered by style.css base ------- */
@media (max-width: 639px) {
    #hero {
        background-position: center center;
        background-size: cover;
        min-height: 100svh;
    }
}

/* --- Tablets (640px+) --------------------------------------------- */
@media (min-width: 640px) {

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

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

    .testimonials-grid {
        overflow-x: visible;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    .testimonial-card { flex: unset; }

    /* Carousel stays as flex scroll row at all mobile/tablet sizes */
    .carousel-wrap.carousel-active .testimonials-grid {
        display: flex;
        grid-template-columns: unset;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: none;
    }
    .carousel-wrap.carousel-active .testimonial-card {
        flex: 0 0 min(85vw, 340px);
    }

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

    .about-badges {
        gap: 1rem;
    }

    .trust-item {
        font-size: 0.82rem;
        padding: 0.7rem 1.1rem;
    }
}

/* --- Desktop (1024px+) -------------------------------------------- */
@media (min-width: 1024px) {

    /* Navigation */
    .hamburger { display: none; }
    .nav-links  { display: flex; }
    .mobile-menu { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    /* About — two-column layout */
    #about .about-inner {
        flex-direction: row;
        align-items: flex-start;
        gap: 5rem;
    }
    .about-image-wrap {
        max-width: 440px;
        flex-shrink: 0;
    }
    .about-content { flex: 1; }

    /* Testimonials — three-column grid (non-carousel) */
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Carousel on desktop: auto-scrolling horizontal row */
    .carousel-wrap.carousel-active .testimonials-grid {
        display: flex;
        grid-template-columns: unset;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: none;
        cursor: ew-resize;
        gap: 1.5rem;
        user-select: none;
        padding-bottom: 0.75rem;
    }
    .carousel-wrap.carousel-active .testimonials-grid.dragging { cursor: grabbing; }
    .carousel-wrap.carousel-active .testimonial-card { flex: 0 0 340px; }
    .carousel-btn  { display: none; }
    .carousel-dots { display: none; }
    .carousel-wrap.carousel-active { padding: 0; }

    /* Gallery — four columns */
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }

    /* Contact — side by side */
    #contact .contact-inner {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: start;
    }

    /* Footer */
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* --- Large desktop (1280px+) -------------------------------------- */
@media (min-width: 1280px) {

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

    .services-grid {
        gap: 2.5rem;
    }

    #about .about-inner {
        gap: 6rem;
    }
}

/* --- Trust bar marquee -------------------------------------------- */
.trust-track {
    display: flex;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    #trust-bar .container.marquee-active {
        justify-content: center;
        overflow: visible;
    }
    .trust-track ~ .trust-track { display: none; }
}

@keyframes trust-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@media (max-width: 1023px) {
    #trust-bar .container.marquee-active {
        justify-content: flex-start;
        overflow: hidden;
    }
    .trust-track {
        animation: trust-marquee 22s linear infinite;
    }
}

/* --- Mobile Nav: show hamburger ----------------------------------- */
@media (max-width: 1023px) {
    .hamburger { display: flex; }
    .nav-links  { display: none; }

    .nav-logo img {
        max-width: 180px;
        height: auto;
        max-height: 60px;
    }

    .carousel-wrap.carousel-active {
        padding: 0;
        overflow-y: hidden;
    }
    .carousel-wrap.carousel-active .testimonials-grid {
        overflow-y: hidden;
    }
    .carousel-btn  { display: none; }
    .carousel-dots { display: none; }

}

/* --- Reduced motion support --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}
