/* Mobile App Styles - Enhanced Native App Experience */

/* Mobile App Container */
@media (max-width: 1024px) {
    /* App-like container */
    body {
        background: #f8f9fa !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    /* Native app header */
    header {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding: 0.75rem 1rem !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        height: 56px !important;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05) !important;
    }

    header.scrolled {
        background: rgba(255, 255, 255, 0.98) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }

    /* Logo adjustments for mobile */
    .logo {
        flex: 1 !important;
    }

    .logo-text {
        font-size: 1.4rem !important;
        font-weight: 800 !important;
        background: linear-gradient(135deg, #fbb03b 0%, #ff8c00 100%) !important;
        background-clip: text !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
    }

    .rotating-words span {
        font-size: 1.4rem !important;
        color: var(--primary-orange) !important;
        font-weight: 700 !important;
    }

    /* Hide desktop navigation completely */
    nav ul {
        display: none !important;
    }

    .header-icons {
        display: none !important;
    }

    /* Main content area */
    main {
        padding-top: 56px !important;
        padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        min-height: calc(100vh - 132px) !important;
        background: #ffffff !important;
    }

    /* Hero section mobile app style */
    .hero {
        background: linear-gradient(135deg, #fbb03b 0%, #ff8c00 100%) !important;
        padding: 2rem 1rem !important;
        margin: 0 !important;
        border-radius: 0 0 24px 24px !important;
        min-height: 200px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    .hero h1 {
        font-size: 1.8rem !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        color: white !important;
        margin-bottom: 1rem !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }

    .hero p {
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        margin-bottom: 1.5rem !important;
        line-height: 1.4 !important;
    }

    /* Mobile search bar */
    .hero-search {
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 12px !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    .hero-search input {
        background: transparent !important;
        color: white !important;
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }

    .hero-search input::placeholder {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .hero-search button {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
    }

    /* Sections mobile app style */
    section {
        padding: 2rem 1rem !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    .section-title h2 {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: #1a1a1a !important;
        margin-bottom: 1.5rem !important;
    }

    /* Product grid mobile app */
    .products-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 0 !important;
    }

    .product-item {
        background: #ffffff !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
        overflow: hidden !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    .product-item:active {
        transform: scale(0.95) !important;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12) !important;
    }

    .product-img-box {
        padding: 1rem !important;
        background: #f8f9fa !important;
        position: relative !important;
    }

    .product-img-box img {
        border-radius: 12px !important;
        object-fit: cover !important;
    }

    .product-item h4 {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        color: #1a1a1a !important;
        margin: 0.75rem 1rem 0.5rem !important;
        line-height: 1.3 !important;
    }

    .price-box {
        padding: 0 1rem 1rem !important;
        gap: 0.5rem !important;
    }

    .new-price {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #1a1a1a !important;
    }

    /* Category grid mobile app */
    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 0 !important;
    }

    .cat-card {
        background: #ffffff !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
        overflow: hidden !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        position: relative !important;
    }

    .cat-card:active {
        transform: scale(0.95) !important;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12) !important;
    }

    .cat-card img {
        width: 100% !important;
        height: 120px !important;
        object-fit: cover !important;
    }

    .cat-card h3 {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent) !important;
        color: white !important;
        padding: 1rem 0.75rem !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        margin: 0 !important;
    }

    /* Newsletter mobile app */
    .newsletter-orange {
        background: linear-gradient(135deg, #fbb03b 0%, #ff8c00 100%) !important;
        padding: 2rem 1rem !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 2rem 0 0 0 !important;
    }

    .newsletter-orange h2 {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: white !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }

    .newsletter-box {
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 12px !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    .newsletter-box input {
        background: transparent !important;
        color: white !important;
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }

    .newsletter-box input::placeholder {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .newsletter-box button {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
    }

    /* Footer hidden on mobile */
    footer {
        display: none !important;
    }

    /* Enhanced bottom navigation */
    .mobile-bottom-nav {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        height: 60px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        border-radius: 20px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        z-index: 1500 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-around !important;
        padding: 0 8px !important;
    }

    .mobile-bottom-nav a {
        flex: 1 !important;
        text-decoration: none !important;
        color: #8e8e93 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        padding: 8px 4px !important;
        border-radius: 12px !important;
        transition: all 0.2s ease !important;
        position: relative !important;
        min-width: 0 !important;
    }

    .mobile-bottom-nav a i {
        font-size: 1.2rem !important;
        line-height: 1 !important;
        transition: all 0.2s ease !important;
    }

    .mobile-bottom-nav a span {
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.1px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        transition: all 0.2s ease !important;
    }

    .mobile-bottom-nav a.active {
        color: #fbb03b !important;
        background: rgba(251, 176, 59, 0.1) !important;
    }

    .mobile-bottom-nav a.active i {
        color: #fbb03b !important;
        transform: scale(1.1) !important;
    }

    .mobile-bottom-nav a.active span {
        color: #fbb03b !important;
        font-weight: 700 !important;
    }

    .mobile-bottom-nav .nav-cart-badge {
        position: absolute !important;
        top: 4px !important;
        right: 8px !important;
        background: #ff3b30 !important;
        color: white !important;
        font-size: 0.6rem !important;
        font-weight: 700 !important;
        min-width: 16px !important;
        height: 16px !important;
        padding: 0 4px !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 2px solid rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }

    /* Touch feedback */
    .mobile-bottom-nav a:active {
        transform: scale(0.9) !important;
        opacity: 0.7 !important;
    }

    /* Safe area handling for notched devices */
    @supports (padding: max(0px)) {
        .mobile-bottom-nav {
            padding-left: max(8px, env(safe-area-inset-left)) !important;
            padding-right: max(8px, env(safe-area-inset-right)) !important;
        }
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem !important;
    }

    .section-title h2 {
        font-size: 1.3rem !important;
    }

    .products-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .mobile-bottom-nav {
        height: 56px !important;
        left: 6px !important;
        right: 6px !important;
    }

    .mobile-bottom-nav a i {
        font-size: 1.1rem !important;
    }

    .mobile-bottom-nav a span {
        font-size: 0.6rem !important;
    }
}

/* Very small mobile */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.4rem !important;
    }

    .section-title h2 {
        font-size: 1.2rem !important;
    }

    .mobile-bottom-nav {
        height: 52px !important;
    }

    .mobile-bottom-nav a i {
        font-size: 1rem !important;
    }

    .mobile-bottom-nav a span {
        font-size: 0.55rem !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        height: 48px !important;
    }

    main {
        padding-top: 48px !important;
    }

    .hero {
        min-height: 120px !important;
        padding: 1rem !important;
    }

    .hero h1 {
        font-size: 1.4rem !important;
    }

    .mobile-bottom-nav {
        height: 50px !important;
    }
}
