/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVE DESIGN
   2x2 PRODUCT GRID WITH PERFECT SPACING
   ======================================== */

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: #ffffff;
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        padding: 20px 0;
        gap: 15px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex !important;
    }

    .container {
        padding: 0 16px;
    }
}

/* Hero Section Mobile */
@media (max-width: 768px) {
    .hero-ecommerce {
        padding: 30px 0 40px;
    }

    .hero-grid-new {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-title-big {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .highlight-text {
        font-size: 2.3rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 14px 28px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }

    .hero-cta-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .hero-trust-badges {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .hero-banner-large {
        height: 220px;
    }

    .hero-banner-secondary {
        height: 150px;
    }

    .hero-deals-ticker {
        padding: 12px 16px;
        flex-direction: column;
        text-align: center;
    }
}

/* Category Chips */
@media (max-width: 768px) {
    .categories-section {
        padding: 20px 0;
    }

    .categories-scroll {
        overflow-x: auto;
        display: flex;
        gap: 10px;
        padding: 10px 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .categories-scroll::-webkit-scrollbar {
        display: none;
    }

    .category-chip {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Section Headers */
@media (max-width: 768px) {
    .section {
        padding: 30px 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .section-header-enhanced {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }
}

/* ========================================
   PERFECT 2x2 PRODUCT GRID
   ======================================== */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
        padding: 0;
        margin-top: 16px;
    }

    .product-card {
        border-radius: 12px;
        padding: 0;
        box-shadow: 0 2px 12px rgba(1,74,150,0.08);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .product-image-link {
        width: 100%;
    }

    .product-card .product-image,
    .product-image {
        height: 140px !important;
        width: 100%;
        border-radius: 12px 12px 0 0;
        object-fit: contain !important;
        background: #f8f9fa;
        padding: 10px;
    }

    .product-card-body {
        padding: 10px !important;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .product-brand {
        font-size: 0.7rem !important;
        margin-bottom: 3px !important;
        letter-spacing: 0.3px;
    }

    .product-name {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
        line-height: 1.25 !important;
        height: 2.5em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-weight: 600;
    }

    .product-description {
        display: none !important;
    }

    .product-rating {
        font-size: 0.7rem !important;
        margin-bottom: 6px !important;
    }

    .product-rating .star {
        font-size: 0.8rem !important;
    }

    .product-rating .rating-text {
        font-size: 0.65rem !important;
    }

    .product-footer {
        flex-direction: column !important;
        gap: 8px !important;
        padding-top: 6px !important;
        align-items: stretch !important;
        margin-top: auto;
    }

    .price-section {
        text-align: center;
    }

    .product-price {
        font-size: 1.05rem !important;
        font-weight: 800 !important;
    }

    .btn-add-cart {
        width: 100% !important;
        padding: 9px 8px !important;
        font-size: 0.8rem !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border-radius: 8px;
        font-weight: 700;
    }

    .btn-add-cart svg {
        width: 14px !important;
        height: 14px !important;
    }

    .product-actions-top {
        top: 6px;
        right: 6px;
        gap: 5px;
    }

    .action-btn {
        width: 30px !important;
        height: 30px !important;
    }

    .action-btn svg {
        width: 15px !important;
        height: 15px !important;
    }

    .low-stock-badge,
    .badge-trending {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        top: 6px;
        left: 6px;
    }
}

/* SINGLE PRODUCT - CENTERED */
@media (max-width: 768px) {
    .products-grid:has(.product-card:only-child) {
        grid-template-columns: 1fr !important;
        max-width: 90%;
        margin: 0 auto;
    }

    .products-grid:has(.product-card:only-child) .product-image {
        height: 240px !important;
        padding: 20px;
    }

    .products-grid:has(.product-card:only-child) .product-card-body {
        padding: 18px !important;
    }

    .products-grid:has(.product-card:only-child) .product-name {
        font-size: 1.1rem !important;
        height: auto !important;
        -webkit-line-clamp: unset;
    }

    .products-grid:has(.product-card:only-child) .product-description {
        display: block !important;
        font-size: 0.9rem !important;
    }

    .products-grid:has(.product-card:only-child) .product-price {
        font-size: 1.4rem !important;
    }

    .products-grid:has(.product-card:only-child) .btn-add-cart {
        padding: 14px 12px !important;
        font-size: 1rem !important;
    }
}

/* All product sections */
@media (max-width: 768px) {
    .section .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
}

/* Filters */
@media (max-width: 768px) {
    .toggle-filters-btn {
        display: flex !important;
    }

    .filters-container {
        display: none;
        padding: 20px 16px;
    }

    .filters-container.active {
        display: block;
    }

    .filter-row {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }
}

/* Products Header */
@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .products-count {
        text-align: center;
        font-size: 0.95rem;
    }

    .products-control-bar {
        padding: 16px 12px;
    }

    .products-toolbar {
        width: 100%;
        flex-direction: column;
    }

    .search-box,
    .filter-select {
        width: 100%;
    }
}

/* Modals */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 20px;
        padding: 20px 15px;
    }

    .quick-view-content {
        flex-direction: column;
    }

    .quick-view-images,
    .quick-view-details {
        width: 100%;
    }

    .quick-view-main-image img {
        height: 280px;
    }
}

/* Cart */
@media (max-width: 768px) {
    .cart-wrapper {
        grid-template-columns: 1fr !important;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .cart-summary {
        position: static;
    }
}

/* Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* Testimonials */
@media (max-width: 768px) {
    .testimonial-card {
        padding: 24px 16px;
    }

    .testimonial-card p {
        font-size: 0.95rem;
    }
}

/* Newsletter */
@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }

    .newsletter-form input[type="email"],
    .newsletter-form button {
        border-radius: 10px;
        width: 100%;
    }
}

/* Page Headers */
@media (max-width: 768px) {
    .page-header {
        padding: 40px 0 30px;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }
}

/* Deal Banners */
@media (max-width: 768px) {
    .hero-deals {
        flex-direction: column;
        gap: 16px;
    }

    .deal-card {
        width: 100%;
    }
}

/* Various Grids */
@media (max-width: 768px) {
    .featured-categories-grid,
    .special-offers-grid,
    .brand-spotlight-grid,
    .values-grid,
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .brand-logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .showcase-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Contact */
@media (max-width: 768px) {
    .contact-wrapper {
        flex-direction: column;
    }

    .contact-form-container,
    .contact-info {
        max-width: 100%;
        padding: 20px 16px;
    }
}

/* Utilities */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Extra Small Screens */
@media (max-width: 375px) {
    .products-grid {
        gap: 10px !important;
    }

    .product-card .product-image {
        height: 120px !important;
    }

    .product-name {
        font-size: 0.8rem !important;
    }

    .product-price {
        font-size: 0.95rem !important;
    }

    .btn-add-cart {
        font-size: 0.75rem !important;
        padding: 8px 6px !important;
    }
}
