/* ===== Mobile App Experience ===== */
@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        scroll-behavior: smooth;
    }

    body {
        overflow-x: hidden;
        -webkit-tap-highlight-color: rgba(108, 60, 225, 0.2);
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Compact app-style header */
    .header {
        background: rgba(15, 10, 26, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    }

    .navbar {
        padding: 10px 0;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .logo-text strong {
        font-size: 1.05rem;
    }

    .logo-text small {
        font-size: 0.62rem;
    }

    .nav-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .login-btn {
        width: auto;
        min-height: 44px;
        padding: 0 14px;
    }

    /* Login/Account bottom nav me hai — header se hatao */
    .nav-actions .login-btn,
    .nav-actions a.nav-btn[title="Profile"] {
        display: none;
    }

    .hamburger {
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: var(--dark-3);
    }

    /* Full-screen mobile drawer */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    body.menu-open {
        overflow: hidden;
    }

    .nav-menu {
        left: auto !important;
        right: -100%;
        width: min(88vw, 320px);
        padding: 88px 16px 24px;
        border-right: none;
        border-left: 1px solid rgba(108, 60, 225, 0.2);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.open {
        left: auto !important;
        right: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 48px;
    }

    .dropdown-menu,
    .dropdown-menu-wide {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 12px;
        max-height: none;
        display: none;
        margin-top: 4px;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown > a .fa-chevron-down {
        margin-left: auto;
        font-size: 0.75rem;
        transition: transform 0.25s;
    }

    .dropdown.open > a .fa-chevron-down {
        transform: rotate(180deg);
    }

    /* Bottom tab bar — app style */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1100;
        background: rgba(26, 18, 37, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(108, 60, 225, 0.2);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 4px;
        min-height: 52px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 600;
        border-radius: 12px;
        transition: var(--transition);
        -webkit-user-select: none;
        user-select: none;
    }

    .mobile-nav-item i {
        font-size: 1.15rem;
        transition: transform 0.2s;
    }

    .mobile-nav-item.active {
        color: var(--primary-light);
        background: rgba(108, 60, 225, 0.12);
    }

    .mobile-nav-item.active i {
        transform: scale(1.08);
    }

    .mobile-nav-vvip.active i {
        color: var(--secondary);
    }

    .mobile-nav-item:active {
        transform: scale(0.96);
    }

    /* Hero & sections */
    .hero {
        min-height: 82vh;
    }

    .hero-slide {
        padding: 100px 0 120px;
        align-items: center;
    }

    .hero-nav {
        display: none;
    }

    .scroll-indicator {
        display: none;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 7vw, 2.1rem);
        margin-bottom: 12px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.55;
    }

    .hero-slide-inner .btn-lg {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .hero-dots {
        bottom: 28px;
    }

    .stats-section {
        margin-top: 0;
        padding: 16px 0 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 18px 12px;
    }

    .search-section {
        margin-top: 12px;
        padding: 0 0 50px;
    }

    .hero-content h1 {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

    .hero-content p {
        font-size: 0.92rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .search-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .search-tab {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .numbers-section,
    .categories-section,
    .blogs-section,
    .cta-section {
        padding: 50px 0;
    }

    .section-header {
        margin-bottom: 32px;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    /* Cards — app tiles */
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ncard-inner {
        min-height: 340px;
        padding: 14px 12px 12px;
        border-radius: 16px;
    }

    .ncard-price {
        font-size: 1.05rem;
    }

    .ncard-number {
        font-size: 1.05rem;
        letter-spacing: 0.5px;
        min-height: 44px;
    }

    .ncard-btn {
        min-height: 44px;
        padding: 12px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .categories-grid:not(.categories-scroll),
    .categories-grid-compact:not(.categories-scroll) {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .categories-scroll-wrap {
        margin: 0 -16px;
        overflow: hidden;
    }

    .categories-scroll {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px 16px 14px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .categories-scroll::-webkit-scrollbar {
        display: none;
    }

    .categories-scroll .category-card {
        flex: 0 0 min(78vw, 260px);
        width: min(78vw, 260px);
        scroll-snap-align: start;
        min-height: 140px;
    }

    .category-card,
    .category-list-card {
        padding: 18px;
        border-radius: 16px;
        min-height: 48px;
    }

    .blog-card {
        border-radius: 16px;
    }

    /* Page layouts */
    .page-header {
        padding: 100px 0 32px;
    }

    .page-header h1 {
        font-size: 1.65rem;
    }

    .page-header-compact {
        padding: 96px 0 20px;
    }

    .page-content {
        padding: 32px 0 48px;
    }

    /* Shop */
    .shop-section {
        padding: 0 0 48px;
    }

    .shop-search-box {
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .shop-search-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 8px 8px 0;
        gap: 6px;
    }

    .shop-search-tabs::-webkit-scrollbar {
        display: none;
    }

    .shop-search-tab {
        flex: 0 0 auto;
        min-width: auto;
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 0.78rem;
        min-height: 44px;
    }

    .shop-search-panel {
        padding: 16px;
    }

    .shop-search-inline-form {
        flex-direction: column;
        border-radius: 12px;
    }

    .shop-search-input,
    .shop-search-select {
        border-left: none !important;
        border-right: none !important;
        border-top: 1px solid rgba(108, 60, 225, 0.15);
        max-width: none !important;
        min-height: 48px;
    }

    .shop-search-inline-form > :first-child {
        border-top: none;
    }

    .shop-search-btn {
        width: 100%;
        min-height: 48px;
        padding: 14px;
    }

    .shop-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .shop-filter-toggle {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    /* Auth */
    .auth-container {
        padding: 28px 20px;
        border-radius: 16px;
        margin: 0 4px;
    }

    .auth-form input {
        min-height: 48px;
        font-size: 16px;
    }

    /* Cart full-screen feel */
    .cart-sidebar {
        width: 100%;
        max-width: 100%;
        right: -100%;
        border-left: none;
    }

    .cart-item {
        padding: 16px;
        min-height: 48px;
    }

    .cart-item-remove {
        min-width: 44px;
        min-height: 44px;
    }

    /* Footer compact */
    .footer-main {
        padding: 40px 0 28px;
    }

    .footer-col h4 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        margin-bottom: 0;
        border-bottom: 1px solid rgba(108, 60, 225, 0.1);
    }

    .footer-col h4::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 0.75rem;
        color: var(--text-muted);
        transition: transform 0.25s;
    }

    .footer-col.collapsed h4::after {
        transform: rotate(-90deg);
    }

    .footer-col.collapsed ul,
    .footer-col.collapsed p,
    .footer-col.collapsed .footer-social {
        display: none;
    }

    .footer-col:first-child h4 {
        cursor: default;
    }

    .footer-col:first-child h4::after {
        display: none;
    }

    /* Buttons touch-friendly */
    .btn {
        min-height: 48px;
    }

    .btn-sm {
        min-height: 40px;
    }

    /* Scroll top above bottom nav & WhatsApp */
    .scroll-top {
        bottom: calc(150px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .whatsapp-float {
        bottom: calc(82px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        min-width: 560px;
    }

    /* Profile & checkout */
    .profile-nav {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .profile-nav::-webkit-scrollbar {
        display: none;
    }

    .profile-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .checkout-summary,
    .checkout-form {
        border-radius: 16px;
    }

    /* Policy */
    .policy-nav {
        gap: 8px;
    }

    .policy-nav a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    /* Best offer / steps */
    .best-offer-banner {
        min-height: 360px;
        margin: 0 12px;
    }

    .best-offer-content {
        padding: 40px 16px;
    }

    .best-offer-number {
        letter-spacing: 3px;
        font-size: clamp(1.75rem, 8vw, 2.4rem);
    }

    .best-offer-title {
        font-size: 1.45rem;
        margin-bottom: 16px;
    }

    .best-offer-card {
        flex-direction: column;
        text-align: center;
        border-radius: 16px;
    }

    .step-card {
        border-radius: 16px;
        padding: 24px 20px;
    }

    /* Prevent iOS zoom on inputs in search forms */
    .search-form input,
    .search-form select,
    .shop-search-input,
    .shop-filter-group input,
    .shop-filter-group select {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .numbers-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .ncard-inner {
        min-height: 320px;
    }

    .mobile-nav-item span {
        font-size: 0.6rem;
    }
}

/* Hide bottom nav on larger screens */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }

    .nav-overlay {
        display: none;
    }
}
