@media (max-width: 768px) {
    .header-container {
        flex-direction: row; 
        justify-content: space-between;
        padding: 0.75rem 1.5rem;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: flex !important;
        width: 45px;
        height: 45px;
        background: var(--bg-soft);
        border: 2px solid var(--mc-green);
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: var(--mc-green-dark);
        cursor: pointer;
        order: 2;
    }

    nav {
        display: none; 
        width: 100%;
        order: 3;
        background: white;
        margin-top: 1rem;
        border-radius: 12px;
        border: 2px solid var(--mc-green);
        overflow: hidden;
        animation: slideInDown 0.3s ease;
    }

    nav.active {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu li {
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-menu a {
        padding: 1rem 1.5rem;
        width: 100%;
    }

    .header-actions {
        order: 1; 
        margin-left: auto;
        margin-right: 15px;
    }

    .user-name {
        display: none; 
    }

    @keyframes slideInDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .btn-login,
    .btn-register {
        width: 100%;
    }

    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.8rem 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem;
        justify-content: center;
    }

    .mc-card {
        margin: 0 auto;
        width: 100%;
    }

    .section-title {
        font-size: 2rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .features-section {
        padding: 2rem 1.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .footer-container {
        padding: 2rem 1rem 0.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .product-image {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }

    .logo::before {
        font-size: 1.5rem;
    }

    .nav-menu {
        gap: 0.25rem;
        font-size: 0.85rem;
    }

    .nav-menu a {
        padding: 0.4rem 0.8rem;
    }

    .btn-login,
    .btn-register {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 1.7rem;
        margin-bottom: 0.75rem;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.7rem 1rem;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-content: center;
    }

    .mc-card {
        max-width: 380px;
        margin: 0 auto;
        width: 100%;
    }

    .product-image {
        height: 120px;
        font-size: 2.5rem;
    }

    .product-content {
        padding: 1rem;
    }

    .product-title {
        font-size: 1.1rem;
    }

    .price {
        font-size: 1.5rem;
    }

    .btn-buy {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .features-section {
        padding: 1.5rem 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature {
        padding: 1rem;
    }

    .feature-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .feature-title {
        font-size: 1rem;
    }

    .feature-description {
        font-size: 0.85rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .footer-container {
        padding: 1.5rem 1rem 0.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section h3 {
        font-size: 1rem;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        padding-top: 1.5rem;
        font-size: 0.9rem;
    }

    .footer-links {
        padding: 0 0.5rem;
    }

    .nav-menu li:last-child {
        display: none;
    }
}

@media (max-width: 360px) {
    .logo {
        font-size: 1.1rem;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 0;
    }

    .nav-menu li {
        flex: 1;
    }

    .nav-menu a {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-height: 500px) and (max-width: 900px) {
    .hero {
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 1200px) {
    main {
        padding: 4rem 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        font-size: 4rem;
    }
}

@media (min-width: 1600px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero h1 {
        font-size: 4.5rem;
    }
}

@media print {
    header,
    footer,
    .btn-primary,
    .btn-secondary,
    .btn-buy {
        display: none;
    }

    main {
        padding: 0;
    }

    .product-card {
        page-break-inside: avoid;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image {
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    }
}


@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .btn-buy {
        min-height: 44px;
        min-width: 44px;
        padding: 0.8rem 1.5rem;
    }

    .social-links a {
        width: 50px;
        height: 50px;
    }

    .nav-menu a {
        padding: 0.75rem 1.25rem;
    }
}


