/* ===================================
   MOBILE RESPONSIVE FIXES
   Header + Hero + Products Page
   =================================== */

/* =====================================
   HEADER MOBILE FIXES
   ===================================== */

@media (max-width: 767px) {
    .top-bar {
        padding: 8px 0 !important;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .top-bar {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .header-main .container {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 15px;
    }

    .logo {
        font-size: 1.5rem !important;
    }

    .search-bar {
        order: 3;
        width: 100%;
    }

    .header-action span {
        display: none;
    }
}

@media (max-width: 991px) {
    .main-nav {
        overflow-x: auto;
    }

    .nav-list {
        flex-wrap: nowrap;
        gap: 0 !important;
    }

    .nav-link {
        padding: 12px 15px !important;
        font-size: 0.9rem !important;
        white-space: nowrap;
    }
}

/* =====================================
   HERO SECTION FIXES
   ===================================== */

.hero-sidebar {
    width: 220px !important;
}

.main-slider {
    position: relative;
    height: 300px !important;
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width: 991px) {
    .hero-sidebar {
        display: none !important;
    }

    .main-slider {
        height: 260px !important;
    }
}

@media (max-width: 575px) {
    .main-slider {
        height: 220px !important;
    }
}

/* =====================================
   PRODUCTS PAGE - RESPONSIVE GRID
   ===================================== */

/* Products grid - 5 columns on desktop */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 15px !important;
}

/* Products page responsive */
@media (max-width: 1399px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 991px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    /* Hide the filter sidebar */
    .row>.col[style*="flex: 0 0 280px"] {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

@media (max-width: 400px) {
    .products-grid {
        gap: 8px !important;
    }
}

/* =====================================
   ENHANCED MOBILE PRODUCT CARDS
   ===================================== */

/* Base card styles enhanced for all screens */
.product-card {
    border-radius: 12px !important;
    border: 1px solid #eee !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.25s ease !important;
    overflow: hidden !important;
    background: #fff !important;
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-4px) !important;
    border-color: transparent !important;
}

/* Product image */
.product-img-wrapper {
    position: relative !important;
    padding-top: 100% !important;
    overflow: hidden !important;
    background: linear-gradient(145deg, #f8f9fa 0%, #f0f2f5 100%) !important;
}

.product-img-wrapper img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 10px !important;
    transition: transform 0.4s ease !important;
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.05) !important;
}

/* Sale badge */
.product-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    z-index: 2 !important;
}

/* Product content area */
.product-content {
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Store/vendor name */
.product-category {
    font-size: 0.7rem !important;
    color: #888 !important;
    margin-bottom: 4px !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Product title */
.product-title {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    line-height: 1.35 !important;
    height: 2.3em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    color: #333 !important;
}

.product-title a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Rating stars */
.product-rating {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    margin-bottom: 8px !important;
    font-size: 0.7rem !important;
    color: #ffc107 !important;
}

.product-rating i {
    font-size: 0.65rem !important;
}

.product-rating span {
    color: #999 !important;
    font-size: 0.65rem !important;
    margin-left: 2px !important;
}

/* Price display */
.product-price {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    margin-bottom: 10px !important;
}

.product-price .new-price {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--primary-700, #0369a1) !important;
}

.product-price .old-price {
    font-size: 0.75rem !important;
    color: #999 !important;
    text-decoration: line-through !important;
}

/* Action buttons in footer */
.product-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-top: auto !important;
}

.btn-add-cart {
    padding: 8px 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    background: #e8f5e9 !important;
    color: var(--primary-700, #0369a1) !important;
    border: 1px solid #c8e6c9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.btn-add-cart:hover {
    background: var(--primary-600, #0284c7) !important;
    color: #fff !important;
    border-color: var(--primary-600, #0284c7) !important;
}

.btn-buy-now {
    padding: 8px 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    background: #ff6f00 !important;
    color: #fff !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.btn-buy-now:hover {
    background: #e65100 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.3) !important;
}

/* Hide action icons on mobile - show on tap instead */
@media (max-width: 991px) {
    .product-actions {
        display: none !important;
    }
}

/* =====================================
   MOBILE SPECIFIC PRODUCT CARD ENHANCEMENTS
   ===================================== */

@media (max-width: 767px) {
    .product-card {
        border-radius: 10px !important;
    }

    .product-img-wrapper {
        padding-top: 110% !important;
    }

    .product-img-wrapper img {
        padding: 8px !important;
    }

    .product-badge {
        top: 6px !important;
        left: 6px !important;
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
    }

    .product-content {
        padding: 10px !important;
    }

    .product-category {
        font-size: 0.65rem !important;
        margin-bottom: 3px !important;
    }

    .product-title {
        font-size: 0.8rem !important;
        height: 2.2em !important;
        margin-bottom: 5px !important;
        line-height: 1.3 !important;
    }

    .product-rating {
        margin-bottom: 6px !important;
    }

    .product-rating i {
        font-size: 0.6rem !important;
    }

    .product-price {
        margin-bottom: 8px !important;
    }

    .product-price .new-price {
        font-size: 0.95rem !important;
    }

    .product-price .old-price {
        font-size: 0.7rem !important;
    }

    .product-footer {
        gap: 5px !important;
    }

    .btn-add-cart,
    .btn-buy-now {
        padding: 7px 5px !important;
        font-size: 0.7rem !important;
        border-radius: 5px !important;
    }

    .btn-add-cart i,
    .btn-buy-now i {
        display: none !important;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 400px) {
    .product-card {
        border-radius: 8px !important;
    }

    .product-img-wrapper {
        padding-top: 100% !important;
    }

    .product-img-wrapper img {
        padding: 6px !important;
    }

    .product-content {
        padding: 8px !important;
    }

    .product-category {
        font-size: 0.6rem !important;
    }

    .product-title {
        font-size: 0.75rem !important;
        height: 2.1em !important;
        margin-bottom: 4px !important;
    }

    .product-rating {
        margin-bottom: 5px !important;
        font-size: 0.55rem !important;
    }

    .product-rating i {
        font-size: 0.55rem !important;
    }

    .product-price .new-price {
        font-size: 0.9rem !important;
    }

    .product-price .old-price {
        font-size: 0.65rem !important;
    }

    .product-footer {
        gap: 4px !important;
    }

    .btn-add-cart,
    .btn-buy-now {
        padding: 6px 4px !important;
        font-size: 0.65rem !important;
        border-radius: 4px !important;
    }
}

/* =====================================
   MOBILE CATEGORIES - Small Compact Grid
   ===================================== */

/* Hide on desktop, show on mobile */
.mobile-categories-bar {
    display: none;
    padding: 0;
    margin-bottom: 15px;
}

@media (max-width: 991px) {
    .mobile-categories-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
}

.mobile-category-chip {
    display: inline-block;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.mobile-category-chip:hover {
    background: #f3f4f6;
    border-color: var(--primary-400);
    color: var(--primary-600);
}

.mobile-category-chip.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #ffffff;
}

/* Even smaller on very small screens */
@media (max-width: 480px) {
    .mobile-categories-bar {
        gap: 5px;
    }

    .mobile-category-chip {
        padding: 5px 10px;
        font-size: 0.7rem;
        border-radius: 5px;
    }
}

/* =====================================
   TOUCH FRIENDLY IMPROVEMENTS
   ===================================== */

@media (max-width: 991px) {

    /* Better tap targets */
    .product-card {
        -webkit-tap-highlight-color: transparent;
    }

    .product-card:active {
        transform: scale(0.98) !important;
    }

    .btn-add-cart:active,
    .btn-buy-now:active {
        transform: scale(0.95) !important;
    }

    /* Smooth scrolling for product grid */
    .products-grid {
        scroll-behavior: smooth;
    }
}