/* ============================================
   pTreks Marketing Website - Responsive Styles
   Mobile-First Responsive Design
   ============================================ */

/* ============================================
   Tablet Breakpoint (max-width: 1024px)
   ============================================ */

@media (max-width: 1024px) {
    .container {
        width: min(100% - 2rem, var(--container-max));
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .hero__content {
        max-width: 100%;
    }

    section {
        padding: 3rem 0;
    }

    .grid--4 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* ============================================
   Mobile Breakpoint (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {

    /* Mobile Navigation Toggle Button */
    .nav-toggle {
        display: inline-flex;
        z-index: 1001;
    }

    /* Hide desktop nav wrapper on mobile */
    .primary-nav__wrapper {
        position: absolute;
        top: 100%;
        right: 0;
        width: 280px;
        max-height: 0;
        overflow: hidden;
        background: #ffffff;
        border-radius: 8px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        z-index: 1000;
    }

    .primary-nav__wrapper.is-open {
        max-height: 500px;
        opacity: 1;
        border: 1px solid #e2e8f0;
    }

    /* Remove nav element from flow */
    .primary-nav__wrapper>nav {
        padding: 1rem 0;
    }

    /* Primary navigation list */
    .primary-nav {
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
    }

    .primary-nav>li {
        border-bottom: 1px solid #e2e8f0;
    }

    .primary-nav>li:last-child {
        border-bottom: none;
    }

    /* Navigation links - make them clearly clickable */
    .primary-nav>li>a {
        display: block;
        padding: 0.875rem 1.25rem;
        color: #0f172a;
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.2s ease;
        background: #ffffff;
    }

    .primary-nav>li>a:hover {
        background: #f1f5f9;
        color: #2563eb;
        padding-left: 1.5rem;
    }

    /* Auth buttons in mobile nav */
    .nav-auth-buttons {
        flex-direction: column;
        padding: 1rem 1.25rem;
        gap: 0.75rem;
        border-top: 2px solid #e2e8f0;
    }

    .nav-auth-buttons .button {
        width: 100%;
        justify-content: center;
    }

    /* Hero */
    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero__title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .hero__cta {
        flex-direction: column;
    }

    .hero__cta .button {
        width: 100%;
        justify-content: center;
    }

    .hero__download-buttons {
        flex-direction: column;
    }

    .download-button {
        width: 100%;
        justify-content: center;
    }

    /* Sections */
    section {
        padding: 2.5rem 0;
    }

    .section-heading {
        margin-bottom: 2rem;
    }

    /* Grids */
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Cards */
    .card {
        padding: 1.5rem;
    }

    /* Steps */
    .step {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .step__number {
        margin: 0 auto;
    }

    .step__content {
        text-align: center;
    }

    /* Pricing */
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .footer__links {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Button group spacing on mobile */
    .hero__cta,
    div[style*="text-align: center"] {
        gap: 0.75rem !important;
    }

    .hero__cta .button,
    div[style*="text-align: center"] .button {
        margin: 0.5rem 0;
    }
}

/* ============================================
   Small Mobile Breakpoint (max-width: 480px)
   ============================================ */

@media (max-width: 480px) {
    :root {
        font-size: 15px;
    }

    .container {
        width: min(100% - 1.5rem, var(--container-max));
    }

    .brand__name {
        font-size: 1.1rem;
    }

    .hero {
        padding: 2rem 0 2rem;
    }

    .hero__eyebrow {
        font-size: 0.75rem;
    }

    .hero__title {
        font-size: clamp(1.5rem, 8vw, 2rem);
        margin-bottom: 1rem;
    }

    .hero__subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    section {
        padding: 2rem 0;
    }

    .section-heading__title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .button {
        padding: 0.75rem 1.2rem;
        font-size: 0.95rem;
    }

    .card {
        padding: 1.25rem;
    }

    .feature-card__icon {
        width: 52px;
        height: 52px;
        font-size: 1.75rem;
    }

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

    .pricing-card__price {
        font-size: 2.5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {

    .site-header,
    .site-footer,
    .nav-toggle,
    .button,
    .hero__cta,
    .hero__download-buttons {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    .hero {
        background: #fff;
        color: #000;
        padding: 1rem 0;
    }

    .hero__title,
    .hero__subtitle {
        color: #000;
    }

    section {
        page-break-inside: avoid;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}