/* ===== RESPONSIVE DESIGN - COMPLETE FIX ===== */

/* Universal Mobile Fix */
* {
    max-width: 100%;
    word-wrap: break-word;
}

img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
}

body {
    overflow-x: hidden !important;
}

/* Container Fix */
.container {
    max-width: 100%;
    padding: 0 15px;
    overflow-x: hidden;
}

/* Mobile (All Devices Below 768px) */
@media (max-width: 768px) {
    
    /* Top Bar Fix */
    .top-bar {
        padding: 8px 0;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .top-left, .top-right {
        width: 100%;
        justify-content: center;
    }
    
    .top-left span {
        font-size: 11px;
    }
    
    .top-link {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    /* Navbar Fix - ORDER: Logo | Search | Cart | Menu */
    .navbar {
        padding: 10px 0;
    }
    
    .nav-wrapper {
        flex-wrap: nowrap; /* Sab ek line mein */
        align-items: center;
        justify-content: flex-start;
    }
    
    /* 1. LOGO - Left Side (Chota) */
    .logo {
        order: 1;
        flex: 0 0 auto;
        margin-right: 8px;
    }
    
    .logo a {
        font-size: 16px; /* Chota logo */
        gap: 5px;
    }
    
    .logo i {
        font-size: 20px;
    }
    
    /* 2. SEARCH BAR - Center (Bada) */
    .search-bar {
        order: 2;
        flex: 1 1 auto; /* Yeh bada hoga */
        width: auto !important;
        max-width: none !important;
        margin-top: 0;
        margin-right: 8px;
    }
    
    .search-bar input {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 0 15px;
        font-size: 14px;
    }
    
    /* 3. NAV ICONS (Cart) - Right before Menu */
    .nav-icons {
        order: 3;
        flex: 0 0 auto;
        gap: 8px;
        margin-right: 5px;
    }
    
    .nav-icon {
        font-size: 20px;
        padding: 6px;
    }
    
    .cart-count {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    /* 4. MOBILE MENU BUTTON - Last */
    .mobile-menu-btn {
        display: block;
        order: 4;
        flex: 0 0 auto;
        font-size: 22px;
        padding: 6px 8px;
    }
    
    /* Navigation Links - Neeche Full Width */
    .nav-links {
        order: 5;
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-top: 10px;
    }
    
    .nav-links.active {
        max-height: 600px;
    }
    
    .nav-link {
        width: 100%;
        padding: 12px 0;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
    }
    
    /* Hero Section Mobile */
    .hero-section {
        padding: 30px 0 40px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 14px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }
    
    .stat-item i {
        font-size: 24px;
    }
    
    .stat-item strong {
        font-size: 18px;
    }
    
    /* Hero Image Fix */
    .hero-image-wrapper {
        max-width: 100%;
        overflow: hidden;
    }
    
    .hero-badge-float {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    /* Products Grid Mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .product-card {
        width: 100%;
    }
    
    .product-image {
        aspect-ratio: 1;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
        min-height: 36px;
    }
    
    .price-current {
        font-size: 18px;
    }
    
    .price-original {
        font-size: 13px;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-cart, .btn-view {
        width: 100%;
        padding: 10px;
        font-size: 12px;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-card {
        padding: 20px 10px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .category-card h3 {
        font-size: 14px;
    }
    
    /* Slider Mobile Fix */
    .slide-card {
        grid-template-columns: 1fr !important;
        min-height: auto;
    }
    
    .slide-content {
        padding: 20px 15px;
        order: 2;
    }
    
    .slide-image {
        order: 1;
        padding: 20px;
        min-height: 200px;
    }
    
    .slide-title {
        font-size: 20px;
    }
    
    .slide-price {
        font-size: 28px;
    }
    
    .slide-buttons {
        flex-direction: column;
    }
    
    .slide-btn-primary,
    .slide-btn-secondary {
        width: 100%;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-col h3 {
        font-size: 20px;
    }
    
    /* WhatsApp & Scroll Buttons */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }
    
    .scroll-top {
        width: 45px;
        height: 45px;
        font-size: 18px;
        bottom: 15px;
        left: 15px;
    }
    
    /* Product Detail Mobile */
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .product-gallery {
        position: static;
    }
    
    .product-detail-title {
        font-size: 20px;
    }
    
    .price-large {
        font-size: 28px;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
    
    .product-actions-detail {
        flex-direction: column;
    }
    
    /* Cart Mobile */
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-summary-container {
        position: static;
        order: -1;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 12px;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    /* Checkout Mobile */
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Filters Sidebar Mobile */
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 9999;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        padding: 20px;
    }
    
    .filters-sidebar.active {
        left: 0;
    }
    
    .mobile-filter-btn {
        display: flex;
    }
    
    .products-layout {
        grid-template-columns: 1fr;
    }
}

/* Extra Small Mobile (480px and below) */
@media (max-width: 480px) {
    
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Typography Fix */
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 13px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    /* Products Grid 1 Column */
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 24px;
    }
    
    .hero-badge {
        font-size: 12px;
        padding: 8px 15px;
    }
    
    /* Product Cards */
    .product-name {
        font-size: 14px;
    }
    
    .price-current {
        font-size: 20px;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 15px;
    }
    
    .footer-col h3 {
        font-size: 18px;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Landscape Mobile Fix */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Prevent Horizontal Scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== INSTAGRAM SECTION - VERTICAL LAYOUT FIX ===== */
@media (max-width: 768px) {
    
    .instagram-section {
        padding: 40px 0;
        overflow-x: hidden;
    }
    
    .instagram-section .container {
        padding: 0 15px;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Vertical Layout: Icon → Text → Button */
    .instagram-cta {
        display: flex;
        flex-direction: column; /* Vertical */
        align-items: center; /* Center aligned */
        justify-content: center;
        gap: 15px;
        padding: 30px 20px;
        text-align: center;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 1. ICON - Top */
    .instagram-icon {
        width: 70px;
        height: 70px;
        font-size: 36px;
        margin: 0;
        flex-shrink: 0;
        order: 1;
    }
    
    /* 2. TEXT - Middle */
    .instagram-text {
        width: 100%;
        max-width: 100%;
        text-align: center;
        order: 2;
    }
    
    .instagram-text h3 {
        font-size: 20px;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .instagram-text p {
        font-size: 13px;
        margin: 0;
        color: var(--bg-white);
        opacity: 0.9;
    }
    
    /* 3. BUTTON - Bottom (Small & Centered) */
    .instagram-button {
        order: 3;
        width: auto !important; /* Small button */
        max-width: 200px; /* Maximum width */
        min-width: 150px; /* Minimum width */
        padding: 10px 25px;
        font-size: 14px;
        box-sizing: border-box;
        margin: 0 auto;
        flex-shrink: 0;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    
    .instagram-section {
        padding: 30px 0;
    }
    
    .instagram-cta {
        padding: 25px 15px;
        gap: 12px;
    }
    
    /* Icon Smaller */
    .instagram-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    /* Text Smaller */
    .instagram-text h3 {
        font-size: 18px;
    }
    
    .instagram-text p {
        font-size: 12px;
    }
    
    /* Button Smaller */
    .instagram-button {
        max-width: 180px;
        min-width: 140px;
        padding: 9px 20px;
        font-size: 13px;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    
    .instagram-cta {
        padding: 20px 10px;
        gap: 10px;
    }
    
    .instagram-icon {
        width: 55px;
        height: 55px;
        font-size: 28px;
    }
    
    .instagram-text h3 {
        font-size: 16px;
    }
    
    .instagram-text p {
        font-size: 11px;
    }
    
    .instagram-button {
        max-width: 160px;
        min-width: 130px;
        padding: 8px 18px;
        font-size: 12px;
    }
}
@media (max-width: 768px) {
    .instagram-text * {
        color: var(--text-dark) !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
