/* ===================================
   RESPONSIVE STYLES
   Mobile-First Approach
   =================================== */

/* Mobile devices (portrait) - 320px to 480px */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .section-padding {
        padding: 50px 0;
    }

    .container {
        padding: 0 15px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: transparent;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 20px;
        box-shadow: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-link {
        color: var(--white);
        font-size: 1.25rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .hero-section {
        height: 100vh;
        min-height: 500px;
    }

    .hero-content {
        padding: 0 20px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .story-content {
        grid-template-columns: 1fr;
    }

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

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Mobile devices (landscape) and small tablets - 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .section-padding {
        padding: 60px 0;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: transparent;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 25px;
        box-shadow: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-link {
        color: var(--white);
        font-size: 1.25rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

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

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

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

    .story-content {
        grid-template-columns: 1fr;
    }

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

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

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

/* Tablets - 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 960px;
    }

    .nav-menu {
        gap: 25px;
    }

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

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

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

/* Large tablets and small laptops - 1025px to 1280px */
@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        max-width: 1140px;
    }
}

/* Large screens - 1281px and above */
@media (min-width: 1281px) {
    .container {
        max-width: 1200px;
    }

    .section-padding {
        padding: 100px 0;
    }
}

/* Height-based media queries for better mobile landscape support */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px;
        height: auto;
        padding: 100px 0 50px;
    }

    .section-padding {
        padding: 40px 0;
    }
}

/* High-resolution screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .responsive-img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 18px 45px;
        font-size: 1.125rem;
    }

    .nav-link {
        padding: 15px 0;
        font-size: 1.125rem;
    }

    .product-card,
    .testimonial-card,
    .stat-card {
        transition: none;
    }

    .product-card:active,
    .testimonial-card:active,
    .stat-card:active {
        transform: translateY(-5px);
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .newsletter,
    .cta-banner,
    .scroll-top,
    .nav-toggle {
        display: none !important;
    }

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

    .section-padding {
        padding: 30px 0;
    }
}

/* Accessibility: 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;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can be enabled if needed */
    /* body {
        background-color: var(--bg-dark);
        color: var(--text-light);
    } */
}

/* Specific component responsive adjustments */

/* Hero adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
}

/* Product card adjustments */
@media (max-width: 480px) {
    .product-image {
        height: 250px;
    }

    .product-info {
        padding: 20px;
    }
}

/* Footer adjustments */
@media (max-width: 768px) {
    .footer {
        padding: 40px 0 20px;
    }

    .footer-grid {
        margin-bottom: 30px;
    }

    .footer-col {
        text-align: center;
    }

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

/* Form adjustments */
@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }

    .newsletter-input {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

/* Scroll to top button adjustments */
@media (max-width: 768px) {
    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

/* Grid system adjustments */
@media (max-width: 480px) {
    .content-grid,
    .product-grid,
    .testimonial-grid,
    .impact-stats {
        gap: 20px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .content-grid,
    .product-grid,
    .testimonial-grid,
    .impact-stats {
        gap: 25px;
    }
}

/* Image optimizations for smaller screens */
@media (max-width: 768px) {
    .image-box {
        margin-bottom: 20px;
    }

    .story-image {
        margin-bottom: 20px;
    }
}

/* Typography adjustments for readability */
@media (max-width: 768px) {
    .lead-text {
        font-size: 1.25rem;
    }

    .story-quote {
        font-size: 1.25rem;
    }

    .testimonial-text {
        font-size: 1rem;
    }
}

/* Section header adjustments */
@media (max-width: 480px) {
    .section-header {
        margin-bottom: 40px;
    }

    .section-label {
        font-size: 0.75rem;
    }
}

/* Stat card adjustments */
@media (max-width: 480px) {
    .stat-card {
        padding: 30px 15px;
    }

    .stat-icon {
        font-size: 2.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 1rem;
    }
}

/* Navigation brand adjustments */
@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.5rem;
    }

    .nav-container {
        height: 70px;
    }

    .hero-section {
        margin-top: 70px;
    }
}

/* Ensure proper spacing on all devices */
@media (max-width: 768px) {
    .section-padding {
        padding: 50px 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .section-padding {
        padding: 70px 0;
    }
}

@media (min-width: 1025px) {
    .section-padding {
        padding: 80px 0;
    }
}
