/* ===================================================
   69SHOP.IN - MOBILE ENHANCEMENTS
   Bottom Navigation, Hero Fix, Product Cards
   =================================================== */

/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white, #ffffff);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--medium-grey, #666666);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.mobile-nav-item span {
    font-size: 0.65rem;
    letter-spacing: 0.3px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--blue-primary, #0066ff);
}

.mobile-nav-item.active {
    background: rgba(0, 102, 255, 0.08);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #ff4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Cart button special styling */
.mobile-nav-item.cart-nav-item {
    position: relative;
}

.mobile-nav-item.cart-nav-item i {
    color: inherit;
}

/* ===== HERO SECTION MOBILE FIX ===== */
@media (max-width: 768px) {
    /* Show mobile bottom navigation */
    .mobile-bottom-nav {
        display: block;
    }

    /* Add bottom padding to body for navigation space */
    body {
        padding-bottom: 70px;
        padding-top: 70px; /* Space for fixed header */
    }

    /* Fix hero section collision with fixed header */
    .category-grid-hero {
        padding-top: 30px !important;
        margin-top: 0 !important;
    }

    /* Flash sale banner adjustment */
    .flash-sale-banner {
        margin-top: 0;
    }

    /* Adjust main content for hero - remove default padding since body has it */
    .main-content {
        padding-top: 0 !important;
    }

    /* Hero container adjustments */
    .hero-container {
        padding-top: 20px;
    }

    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    /* Category grid mobile improvements */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        min-height: 100px !important;
        padding: 16px !important;
    }

    .category-card.featured {
        grid-column: span 2;
        min-height: 120px !important;
    }

    .category-card h3 {
        font-size: 0.95rem;
    }

    .category-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Trust bar mobile */
    .hero-trust-bar {
        padding: 16px 12px;
        margin-top: 20px;
    }

    .trust-item {
        font-size: 0.75rem;
        gap: 6px;
    }

    .trust-item i {
        font-size: 1rem;
    }
}

/* ===== PRODUCT CARDS MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {
    /* Products grid - 2 columns for tablets/large phones */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Product card compact design */
    .product-card {
        border-radius: 12px;
        overflow: hidden;
    }

    .product-image-wrapper {
        height: 150px !important;
        aspect-ratio: 1;
    }

    .product-image-wrapper img {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }

    /* Product details compact */
    .product-details {
        padding: 12px !important;
    }

    .product-category {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }

    .product-title {
        font-size: 0.85rem !important;
        line-height: 1.3;
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: auto;
        min-height: 2.2em;
    }

    .product-rating {
        margin-bottom: 6px;
    }

    .product-rating .rating-score {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .product-rating .rating-count {
        font-size: 0.65rem;
    }

    .product-price-section {
        margin-bottom: 8px;
    }

    .current-price {
        font-size: 1rem !important;
    }

    .original-price {
        font-size: 0.75rem;
    }

    .discount-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    /* Product actions stacked on mobile */
    .product-actions {
        flex-direction: row;
        gap: 8px;
    }

    .btn-add-to-cart {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .btn-wishlist {
        width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-wishlist span {
        display: none;
    }

    /* Quick actions overlay */
    .product-quick-actions {
        bottom: 8px;
        right: 8px;
        gap: 6px;
    }

    .quick-action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Product badges */
    .product-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
    }

    /* Seller info compact */
    .product-seller-info {
        font-size: 0.7rem;
        padding: 6px 0;
    }

    /* Stock indicator */
    .stock-indicator {
        font-size: 0.65rem;
    }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
    /* Single column for very small screens */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Even more compact cards */
    .product-image-wrapper {
        height: 130px !important;
    }

    .product-details {
        padding: 10px !important;
    }

    .product-title {
        font-size: 0.8rem !important;
    }

    .current-price {
        font-size: 0.95rem !important;
    }

    /* Category grid single column */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-card.featured {
        grid-column: span 2;
    }

    /* Hero section even smaller */
    .hero-title {
        font-size: 1.4rem;
    }

    /* Trust bar 2x2 grid */
    .hero-trust-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Filters mobile */
    .filter-bar {
        padding: 10px 12px;
    }

    .filter-tag {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    /* Mobile nav items smaller */
    .mobile-nav-item {
        padding: 6px 12px;
    }

    .mobile-nav-item i {
        font-size: 1.1rem;
    }

    .mobile-nav-item span {
        font-size: 0.6rem;
    }
}

/* ===== FILTER SIDEBAR MOBILE ===== */
@media (max-width: 768px) {
    .filters-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1002;
        transition: left 0.3s ease;
        background: var(--white, #ffffff);
        width: 85%;
        max-width: 320px;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .filters-sidebar.active {
        left: 0;
    }

    .filters-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
    }

    .filters-overlay.active {
        display: block;
    }
}

/* ===== HEADER MOBILE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .header-content {
        padding: 12px 0;
    }

    .logo-icon {
        width: 40px;
        height: 56px;
    }

    .logo-text .site-name {
        font-size: 1.1rem;
    }

    .logo-text .tagline {
        font-size: 0.65rem;
    }

    .header-actions {
        gap: 8px;
    }

    .cart-btn,
    .wishlist-header-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .cart-count,
    .wishlist-count {
        font-size: 0.6rem;
        min-width: 14px;
        height: 14px;
    }

    .user-profile-btn {
        padding: 6px 10px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .user-chevron {
        display: none;
    }
}

/* ===== CHECKOUT PANEL MOBILE ===== */
@media (max-width: 768px) {
    .checkout-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .checkout-content {
        flex-direction: column;
    }

    .checkout-column {
        width: 100%;
    }
}

/* ===== CART SIDEBAR MOBILE ===== */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .cart-item {
        padding: 12px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-name {
        font-size: 0.85rem;
    }

    .cart-item-price {
        font-size: 0.9rem;
    }
}

/* ===== PROFILE SIDEBAR MOBILE ===== */
@media (max-width: 768px) {
    .profile-sidebar {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== HIDE DESKTOP PROFILE BUTTON ON MOBILE ===== */
@media (max-width: 768px) {
    /* Profile button text hidden, only avatar shown */
    .user-profile-btn .user-name {
        display: none;
    }
}

/* ===== SMOOTH SCROLL BEHAVIOR ===== */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }
}

/* ===== PRODUCT LIST VIEW MOBILE ===== */
@media (max-width: 768px) {
    /* When in list view on mobile */
    .products-grid.list-view {
        grid-template-columns: 1fr;
    }

    .products-grid.list-view .product-card {
        display: flex;
        flex-direction: row;
    }

    .products-grid.list-view .product-image-wrapper {
        width: 120px;
        height: 120px !important;
        flex-shrink: 0;
    }

    .products-grid.list-view .product-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* ===== FLOATING ELEMENTS ADJUSTMENTS ===== */
@media (max-width: 768px) {
    /* Compare widget adjustment for bottom nav */
    .compare-widget {
        bottom: 80px;
    }

    /* Scroll to top button */
    .scroll-to-top {
        bottom: 80px;
    }

    /* Toast notifications */
    .toast-container {
        bottom: 80px;
    }

    /* Any floating action buttons */
    .fab,
    .floating-btn {
        bottom: 80px;
    }
}

/* ===== ANIMATION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav,
    .mobile-nav-item,
    .mobile-nav-item i {
        transition: none;
    }
}
/* ===== MOBILE HEADER - CENTERED LOGO ===== */
@media (max-width: 768px) {
    /* Fixed header on mobile */
    .header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        padding: 8px 0 !important;
        background: var(--primary-black, #1A1A1A) !important;
    }
    
    /* Center the header content */
    .header-content {
        justify-content: center !important;
        position: relative;
        padding: 8px 0 !important;
    }
    
    /* Logo centered - THIS IS THE KEY */
    .header .logo {
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        margin: 0 auto !important;
    }
    
    /* Hide all header actions - handled by bottom nav */
    .header-actions,
    .mobile-menu-toggle,
    .search-mobile-toggle,
    .user-profile-btn,
    .cart-btn,
    .wishlist-header-btn,
    .search-container {
        display: none !important;
    }
    
    /* Hide main navigation - handled by bottom nav */
    .main-nav {
        display: none !important;
    }
    
    .header .container {
        padding: 0 16px;
    }
    
    /* Logo styling */
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .logo-text .site-name {
        font-size: 1.1rem;
    }
    
    .logo-text .tagline {
        font-size: 0.65rem;
    }
}

/* ===== HIDE FLASH SALE BANNER ===== */
/* Flash sale banner is hidden by default - visible on scroll/interaction only */
.flash-sale-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.flash-sale-banner.visible {
    transform: translateY(0);
}

/* On mobile, hide flash sale completely to avoid pull-to-refresh issues */
@media (max-width: 768px) {
    .flash-sale-banner {
        display: none !important;
    }
}

/* ===== HIDE FILTER BAR ON MOBILE FOR CATEGORY PAGES ===== */
/* Category pages have mobile bottom sheet navigation instead */
@media (max-width: 768px) {
    .category-filter-bar {
        display: none !important;
    }
    
    /* Also hide filter bar in shop page - filters in sidebar */
    .filter-bar-container {
        display: none !important;
    }
}