/* Mobile Styles - 767px and below */
@media (max-width: 767px) {

    /* Mobile Container */
    .container {
        padding: 0 12px;
    }

    /* Mobile Header - Enhanced */
    .main-header {
        padding: 12px 0;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid #e9ecef;
    }

    /* Ensure header text is visible */
    .header-icon-link {
        color: var(--text-primary) !important;
        padding: 10px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header-icon-link:hover {
        color: var(--primary-orange) !important;
        background: rgba(251, 119, 1, 0.08);
        transform: translateY(-2px);
    }

    .header-content {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 12px;
    }

    /* Mobile Logo */
    .header-logo img {
        height: 40px;
        width: auto;
    }

    /* Mobile Search */
    .header-search {
        grid-column: 1 / span 3;
        width: 100%;
        margin-top: 8px;
        position: relative;
    }

    .search-input {
        width: 100%;
        padding: 12px 45px 12px 16px;
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        font-size: 14px;
        background: #f8f9fa;
        transition: all 0.3s ease;
    }

    .search-input:focus {
        border-color: var(--primary-orange);
        background: white;
        box-shadow: 0 0 0 4px rgba(251, 119, 1, 0.1);
        outline: none;
    }

    .search-btn {
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--primary-orange);
        color: white;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .search-btn:hover {
        background: var(--primary-orange-hover);
        transform: translateY(-50%) scale(1.05);
    }

    /* Mobile Header Icons */
    .header-icons {
        grid-column: 3;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .header-icon-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 11px;
        color: var(--text-primary);
        position: relative;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    .header-icon-link:hover {
        background: rgba(251, 119, 1, 0.05);
        color: var(--primary-orange);
        transform: translateY(-1px);
    }

    .header-icon-link svg {
        width: 22px;
        height: 22px;
        margin: 0;
        transition: transform 0.3s ease;
        stroke: var(--text-primary);
        fill: var(--text-primary);
    }

    .header-icon-link:hover svg {
        transform: scale(1.1);
    }

    .header-icon-link span:not(.badge-count) {
        display: none;
        /* Hide text labels on mobile */
    }

    .badge-count {
        position: absolute;
        top: -4px;
        right: -4px;
        background: var(--primary-orange);
        color: white;
        font-size: 10px;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 9px;
        font-weight: 900;
        border: 2px solid white;
    }

    /* Mobile Product Grid - Forced Single Column */
    body .product-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 20px 16px !important;
    }

    .product-card {
        background: white;
        border-radius: 20px;
        /* Slightly more rounded for larger format */
        overflow: hidden;
        position: relative;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid #f0f0f0;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    }

    .product-card:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .product-img-wrapper {
        width: 100%;
        aspect-ratio: 1/1;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        position: relative;
        overflow: hidden;
    }

    .product-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .product-card:active .product-img {
        transform: scale(0.95);
    }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 14px;
        color: var(--text-primary);
        margin: 0 0 10px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
        height: 40px;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        transition: color 0.3s ease;
    }

    .product-card:hover .product-title {
        color: var(--primary-orange);
    }

    .product-price-row {
        display: flex;
        align-items: baseline;
        gap: 4px;
        margin-bottom: 6px;
    }

    .price-current {
        font-size: 16px;
        font-weight: 800;
        color: var(--primary-orange);
    }

    .price-symbol {
        font-size: 11px;
        font-weight: 600;
    }

    .product-meta {
        font-size: 10px;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    .sales-count {
        background: linear-gradient(135deg, #FFF0E5 0%, #FFE8D1 100%);
        color: var(--primary-orange);
        padding: 2px 8px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 10px;
    }

    /* Mobile Buttons */
    .btn {
        padding: 14px 20px;
        font-size: 14px;
        font-weight: 700;
        gap: 8px;
        border-radius: 16px;
        background: linear-gradient(135deg, #FB7701 0%, #ff4d00 100%);
        box-shadow: 0 4px 12px rgba(251, 119, 1, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .btn:hover::before {
        left: 100%;
    }

    .btn:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .btn svg {
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
    }

    .btn:hover svg {
        transform: scale(1.1);
    }

    /* Mobile News Poster */
    .news-poster-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .news-poster-item {
        background: linear-gradient(135deg, #FF9100 0%, var(--primary-orange) 100%);
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(251, 119, 1, 0.2);
        color: white;
        position: relative;
        overflow: hidden;
        transition: transform 0.3s ease;
    }

    .news-poster-item:active {
        transform: scale(0.98);
    }

    .news-poster-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
        color: #ffffff;
        font-weight: 900;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .news-poster-message {
        font-size: 1rem;
        font-weight: 500;
        opacity: 0.95;
        line-height: 1.5;
    }

    /* Mobile Forms */
    .variant-select {
        display: block;
        width: 100%;
        padding: 10px 12px;
        margin-bottom: 10px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        font-size: 13px;
        background: white;
        transition: all 0.3s ease;
        min-height: 44px;
        /* Touch-friendly */
    }

    .variant-select:focus {
        border-color: var(--primary-orange);
        box-shadow: 0 0 0 4px rgba(251, 119, 1, 0.1);
        outline: none;
    }

    /* Mobile Footer */
    .footer {
        padding: 24px 12px;
        font-size: 11px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
        margin-top: 40px;
        text-align: center;
    }

    /* Mobile Language Selector */
    .premium-lang-selector {
        position: fixed;
        top: 8px;
        right: 8px;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(251, 119, 1, 0.2);
        padding: 6px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .premium-lang-item {
        padding: 6px 10px;
        font-size: 10px;
        font-weight: 800;
        color: var(--text-secondary);
        border-radius: 6px;
        transition: all 0.3s ease;
        cursor: pointer;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .premium-lang-item.active {
        background: var(--primary-orange);
        color: white;
        box-shadow: 0 2px 8px rgba(251, 119, 1, 0.3);
    }

    .premium-lang-item:hover:not(.active) {
        background: rgba(251, 119, 1, 0.1);
        color: var(--primary-orange);
    }

    /* Mobile Cart Layout - Hide Order Summary */
    .cart-summary-sidebar {
        display: none !important;
    }

    /* Mobile Sticky Footer */
    .cart-sticky-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: white !important;
        padding: 12px 16px !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid #f0f0f0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        z-index: 1000000 !important;
        box-sizing: border-box !important;
    }

    .cart-sticky-footer .btn {
        flex: 1;
        min-height: 48px;
        font-size: 14px;
        font-weight: 800;
        border-radius: 12px;
        background: linear-gradient(135deg, #fb7701 0%, #ff4d00 100%);
        border: none;
        color: white;
        box-shadow: 0 4px 12px rgba(251, 119, 1, 0.3);
        transition: all 0.3s ease;
    }

    .cart-sticky-footer .btn:active {
        transform: scale(0.98);
    }

    /* Enhanced OTP Verification Form */
    .otp-form {
        margin-top: 20px;
    }

    .otp-input-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .otp-input {
        text-align: center;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: 12px;
        padding: 16px;
        border: 2px solid #e9ecef;
        border-radius: 16px;
        background: #f8f9fa;
        transition: all 0.3s ease;
        position: relative;
        z-index: 2;
    }

    .otp-input:focus {
        border-color: var(--primary-orange);
        background: white;
        box-shadow: 0 0 0 4px rgba(251, 119, 1, 0.1);
        outline: none;
    }

    .otp-input-dots {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        gap: 8px;
        pointer-events: none;
        z-index: 1;
    }

    .otp-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #dee2e6;
        border: 2px solid #e9ecef;
        transition: all 0.3s ease;
    }

    .otp-input:focus+.otp-dot:nth-child(1) {
        background: var(--primary-orange);
        border-color: var(--primary-orange);
        transform: scale(1.2);
    }

    .otp-input:focus+.otp-dot:nth-child(2) {
        background: var(--primary-orange);
        border-color: var(--primary-orange);
        transform: scale(1.2);
    }

    .btn-verify {
        background: linear-gradient(135deg, #FB7701 0%, #ff4d00 100%);
        padding: 18px 24px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 16px;
        margin-top: 20px;
        box-shadow: 0 4px 12px rgba(251, 119, 1, 0.3);
    }

    .btn-verify:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(251, 119, 1, 0.4);
    }

    .auth-actions {
        display: flex;
        gap: 12px;
        margin-top: 24px;
        justify-content: center;
    }

    .btn-outline {
        background: transparent;
        border: 2px solid var(--text-primary);
        color: var(--text-primary);
        padding: 12px 20px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }

    .btn-outline:hover {
        background: var(--text-primary);
        color: white;
        transform: translateY(-1px);
    }

    /* Mobile Touch Optimizations */
    .product-card,
    .btn,
    .header-icon-link,
    .variant-select {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Mobile Animations */
    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .product-card {
        animation: slideInUp 0.4s ease forwards;
    }

    .product-card:nth-child(1) {
        animation-delay: 0.05s;
    }

    .product-card:nth-child(2) {
        animation-delay: 0.1s;
    }

    .product-card:nth-child(3) {
        animation-delay: 0.15s;
    }

    .product-card:nth-child(4) {
        animation-delay: 0.2s;
    }

    /* Mobile Header Cleanup - Remove redundant nav */
    .header-icons .desktop-only {
        display: none !important;
    }

    .header-content {
        gap: 12px;
    }

    /* Mobile Scroll Optimizations */
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Mobile Bottom Navigation - Modern Ergonomics */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        display: flex;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.08);
        z-index: 2000;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 700;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        flex: 1;
        padding: 8px 0;
        border-radius: 12px;
        margin: 4px;
    }

    .nav-item svg {
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
        stroke: currentColor;
        stroke-width: 1.5;
        fill: none !important;
    }

    .nav-item.active svg {
        transform: scale(1.1);
    }

    /* Small adjustments to avoid overlapping with bottom nav */
    body {
        padding-bottom: 80px !important;
    }

    .floating-chat-btn {
        bottom: 90px !important;
    }

    /* Mobile Safe Area Support */
    @supports (padding: max(0px)) {
        .main-header {
            padding-top: max(8px, env(safe-area-inset-top, 0px));
        }

        .mobile-bottom-nav {
            height: calc(65px + env(safe-area-inset-bottom, 0px));
        }
    }
}

/* Small Mobile Styles - 480px and below */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    body .product-grid {
        grid-template-columns: 1fr !important;
        /* Single column on smallest screens */
        gap: 20px !important;
        padding: 16px !important;
    }

    .product-info {
        padding: 15px;
        /* More padding for 1-column layout */
    }

    .product-title {
        font-size: 15px;
        /* Larger text for larger card */
        height: auto;
        margin-bottom: 8px;
    }

    .price-current {
        font-size: 16px;
    }

    .btn {
        font-size: 14px;
        padding: 12px 16px;
        border-radius: 12px;
        min-height: 44px;
    }
}