/* Mobile Container */
.container-custom.mobile-container {
    padding-bottom: 0;
    min-height: calc(100vh - 70px);
    background: #f8f9fb;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    color: white;
    margin: -20px -20px 20px -20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px;
}

.page-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Search Container */
.search-container {
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #f7fafc;
    border-radius: 12px;
    padding: 0 15px;
}

.search-input-wrapper i {
    color: #718096;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 0;
    font-size: 14px;
    outline: none;
}

.search-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.search-btn:hover {
    transform: scale(1.05);
}

/* Categories Section - Redesigned */
.categories-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.categories-header {
    margin-bottom: 12px;
}

.categories-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.categories-title i {
    color: #667eea;
    font-size: 16px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    background: #f7fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.category-item:hover {
    background: #edf2f7;
    transform: translateY(-1px);
}

.category-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.category-icon-wrapper {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 16px;
    color: #667eea;
    transition: all 0.3s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.category-item.active .category-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3px;
    line-height: 1.2;
}

.category-count {
    font-size: 10px;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.1);
    padding: 1px 6px;
    border-radius: 8px;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Filter Section */
.filter-section {
    padding: 0 20px 20px;
    background: white;
    border-radius: 0 0 12px 12px;
    margin-top: -20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.filter-chips {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #f7fafc;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
}

.filter-chip:hover {
    background: #e2e8f0;
}

.filter-chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.filter-chip i {
    font-size: 12px;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.products-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.products-count {
    font-size: 14px;
    color: #718096;
    font-weight: normal;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.product-image-wrapper {
    position: relative;
    padding-top: 100%;
    background: #f7fafc;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fc5c65;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.product-info {
    padding: 12px;
}

.product-category {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.stars {
    display: flex;
    gap: 2px;
    color: #fbbf24;
    font-size: 12px;
}

.rating-count {
    font-size: 12px;
    color: #718096;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.original-price {
    font-size: 12px;
    color: #a0aec0;
    text-decoration: line-through;
}

.add-cart-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #667eea;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.add-cart-btn:hover {
    background: #5a67d8;
    transform: scale(1.1);
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.load-more-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.loaded-info {
    margin-top: 10px;
    font-size: 13px;
    color: #718096;
}

.loaded-count {
    font-weight: 600;
    color: #667eea;
}

.total-count {
    font-weight: 600;
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 64px;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 10px;
}

.empty-state p {
    color: #718096;
    margin: 0;
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 576px) {
    .page-header {
        padding: 20px 15px;
        margin: -15px -15px 15px -15px;
    }

    .header-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .search-container {
        padding: 15px;
        margin-bottom: 15px;
    }

    .search-input-wrapper {
        padding: 0 12px;
    }

    .search-input {
        padding: 12px 0;
        font-size: 13px;
    }

    .search-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    .categories-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .categories-title {
        font-size: 14px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .category-item {
        padding: 6px 4px;
    }

    .category-name {
        font-size: 10px;
    }

    .filter-section {
        padding: 0 15px 15px;
        margin-top: -15px;
        margin-bottom: 15px;
    }

    .filter-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .products-title {
        font-size: 16px;
        width: 100%;
    }

    .sort-select {
        width: 100%;
        min-width: unset;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 13px;
        min-height: 36px;
    }

    .current-price {
        font-size: 14px;
    }

    .add-cart-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .load-more-btn {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-icon {
        font-size: 48px;
    }

    .empty-state h3 {
        font-size: 18px;
    }
}

/* Tablet Responsive */
@media (min-width: 577px) and (max-width: 768px) {

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .products-header {
        gap: 12px;
    }

    .sort-select {
        min-width: 140px;
    }
}

/* Small Desktop */
@media (min-width: 769px) and (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Large Desktop */
@media (min-width: 993px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra Large Screens */
@media (min-width: 1200px) {
    .container-custom.mobile-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
    }

    .category-item:hover {
        transform: none;
    }

    .filter-chip:hover {
        background: #f7fafc;
    }

    .add-cart-btn:hover {
        transform: none;
    }

    .search-btn:hover {
        transform: none;
    }

    .load-more-btn:hover {
        transform: none;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .page-header {
        padding: 20px 15px;
    }
}

