/* ==========================================================================
   EnergyGuard Pro — Responsive Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet Landscape (1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .feature-detail {
        gap: 2rem;
    }

    .pricing-card--featured {
        transform: scale(1);
    }

    .pricing-card--featured:hover {
        transform: translateY(-4px);
    }

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

    .contact-grid {
        gap: 2rem;
    }
}

/* --------------------------------------------------------------------------
   Tablet Portrait / Primary Breakpoint (768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* --- Navigation: Mobile --- */
    .nav-toggle-label {
        display: block;
        cursor: pointer;
        padding: 0.5rem;
        z-index: 10;
    }

    .hamburger {
        display: block;
        width: 25px;
        height: 20px;
        position: relative;
    }

    .hamburger__line {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--eg-white);
        border-radius: 2px;
        position: absolute;
        left: 0;
        transition: all var(--transition-med);
    }

    .hamburger__line:nth-child(1) { top: 0; }
    .hamburger__line:nth-child(2) { top: 50%; transform: translateY(-50%); }
    .hamburger__line:nth-child(3) { bottom: 0; }

    /* X transform when open */
    .nav-toggle:checked ~ .nav-toggle-label .hamburger__line:nth-child(1) {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .nav-toggle:checked ~ .nav-toggle-label .hamburger__line:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle:checked ~ .nav-toggle-label .hamburger__line:nth-child(3) {
        bottom: 50%;
        transform: translateY(50%) rotate(-45deg);
    }

    /* Mobile nav panel */
    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--eg-dark-blue);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        transition: right var(--transition-med);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .nav-toggle:checked ~ .site-nav {
        right: 0;
    }

    .site-nav__list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .site-nav__link {
        display: block;
        padding: 1rem;
        font-size: 1.125rem;
        border-radius: 8px;
    }

    .site-nav__link:hover,
    .site-nav__link--active {
        background: rgba(0, 230, 118, 0.08);
    }

    .site-nav__cta {
        margin-top: 1.5rem;
        width: 100%;
        text-align: center;
    }

    /* --- Grids: Single column --- */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

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

    /* --- Questions: Single column --- */
    .questions-grid {
        grid-template-columns: 1fr;
    }

    /* --- Feature Detail: Stack --- */
    .feature-detail,
    .feature-detail--reversed {
        flex-direction: column;
        gap: 2rem;
    }

    /* --- Audience: Stack --- */
    .audience-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    /* --- Stats: 2 columns --- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- Footer: Stack --- */
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    /* --- Section padding --- */
    .section {
        padding: 4rem 1.5rem;
    }

    /* --- Pricing: Stack --- */
    .pricing-cards {
        flex-direction: column;
        align-items: center;
    }

    .pricing-card {
        max-width: 100%;
        width: 100%;
    }

    /* --- Contact: Stack --- */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* --- Comparison table: scroll --- */
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Newsletter: Stack --- */
    .newsletter-form {
        flex-direction: column;
    }
}

/* --------------------------------------------------------------------------
   Mobile (480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .hero {
        min-height: 85vh;
        padding: 5rem 1.5rem 3rem;
    }

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

    .hero__actions .btn {
        width: 100%;
    }

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

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .cta-banner__actions {
        flex-direction: column;
    }

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

    .btn-lg {
        width: 100%;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .pricing-card {
        padding: 2rem 1.5rem;
    }
}
