/* ========================================
   MOBILE STYLES FOR HOME.CSS
   Max-width: 800px
   ======================================== */

@media (max-width: 800px) {
    /* ========================================
       MAIN CONTENT
       ======================================== */
    .main-content {
        padding: 15px 0;
    }

    /* ========================================
       BESTSELLER SECTION
       ======================================== */
    .bestseller-section {
        padding: 18px 0;
        margin-bottom: 15px;
    }

    .section-header {
        margin-bottom: 15px;
        padding: 0 12px;
    }

    .section-title {
        font-size: 16px;
    }

    .see-all-link {
        font-size: 13px;
    }

    .see-all-link i {
        font-size: 11px;
    }

    /* Bestseller Cards */
    .bestseller-scroll-container {
        padding: 0 12px;
    }

    .bestseller-grid {
        gap: 10px;
    }

    .bestseller-card {
        width: 145px;
    }

    .top-badge {
        width: 36px;
        height: 36px;
    }

    .badge-label {
        font-size: 7px;
    }

    .badge-number {
        font-size: 14px;
    }

    .rank-number {
        min-width: 26px;
        height: 26px;
        font-size: 13px;
        top: 6px;
        left: 6px;
    }

    .bestseller-info {
        padding: 10px;
    }

    .bestseller-name {
        font-size: 12px;
        min-height: 34px;
    }

    .bestseller-price .price-label {
        font-size: 10px;
    }

    .bestseller-price .price-value {
        font-size: 14px;
    }

    .bestseller-sold {
        font-size: 10px;
    }

    /* ========================================
       CONTENT WRAPPER - STACK VERTICALLY
       ======================================== */
    .content-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    /* ========================================
       SIDEBAR CATEGORY - COLLAPSIBLE
       ======================================== */
    
    /* Sidebar - Normal display */
    .sidebar-category {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Category Header - Clickable */
    .category-header {
        padding: 12px 16px;
        font-size: 14px;
        cursor: pointer;
        position: relative;
        transition: background 0.2s;
        user-select: none;
    }

    .category-header:active {
        background: rgba(0, 0, 0, 0.02);
    }

    .category-header i {
        transition: transform 0.3s ease;
        font-size: 14px;
    }

    /* Category List - Default COLLAPSED (hidden) di mobile */
    .category-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
    }

    /* Category List - Expanded state (ketika user click) */
    .category-list.expanded {
        max-height: 2000px;
        opacity: 1;
    }

    .category-item {
        border-bottom: 1px solid #f0f0f0;
    }

    .category-item:last-child {
        border-bottom: none;
    }

    .category-item a {
        padding: 11px 16px;
        font-size: 13px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .category-item a i {
        font-size: 10px;
    }

    /* ========================================
       PRODUCTS SECTION
       ======================================== */
    .products-section {
        width: 100%;
    }

    /* Sort Bar - Scrollable horizontal */
    .sort-bar {
        padding: 12px 15px;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .sort-bar::-webkit-scrollbar {
        display: none;
    }

    .sort-label {
        font-size: 13px;
        margin-right: 5px;
        flex-shrink: 0;
    }

    .sort-options {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .sort-btn {
        padding: 7px 12px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Price Dropdown */
    .dropdown-menu {
        min-width: 160px;
        left: 0;
        right: auto;
    }

    .dropdown-menu-item {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Pagination di sort bar */
    .pagination-info {
        display: none; /* Hide on mobile to save space */
    }

    .pagination-controls {
        gap: 6px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }

    /* ========================================
       PRODUCTS GRID - 2 COLUMNS
       ======================================== */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .product-card {
        border-radius: 3px;
    }

    .product-info {
        padding: 8px;
    }

    .product-name {
        font-size: 12px;
        min-height: 34px;
        margin-bottom: 6px;
    }

    .price-label {
        font-size: 10px;
    }

    .price-value {
        font-size: 14px;
    }

    /* No Products */
    .no-products {
        padding: 60px 15px;
    }

    .no-products i {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .no-products p {
        font-size: 14px;
    }

    /* ========================================
       BOTTOM PAGINATION
       ======================================== */
    .bottom-pagination {
        gap: 6px;
        padding: 15px;
        flex-wrap: wrap;
    }

    .page-number-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
    }

    .page-ellipsis {
        padding: 0 2px;
    }

    /* ========================================
       FOOTER
       ======================================== */
    .main-footer {
        margin-top: 30px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px 0;
    }

    .footer-section h4 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .footer-section li {
        margin-bottom: 7px;
    }

    .footer-section a {
        font-size: 12px;
    }

    .social-links {
        gap: 10px;
    }

    .social-links a {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .footer-bottom {
        padding: 20px 0;
    }

    .footer-bottom p {
        font-size: 11px;
    }

    /* ========================================
       LOADING STATES
       ======================================== */
    .products-loading-overlay {
        border-radius: 3px;
    }

    .loading-spinner .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .loading-spinner p {
        font-size: 12px;
    }

    .error-message {
        padding: 50px 15px;
    }

    .error-message i {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .error-message p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .retry-btn {
        padding: 10px 24px;
        font-size: 13px;
    }
}

/* ========================================
   EXTRA SMALL DEVICES (< 480px)
   ======================================== */
@media (max-width: 480px) {
    .main-content {
        padding: 12px 0;
    }

    /* Bestseller Section */
    .bestseller-section {
        padding: 15px 0;
        margin-bottom: 12px;
    }

    .section-header {
        padding: 0 10px;
        margin-bottom: 12px;
    }

    .section-title {
        font-size: 15px;
    }

    .bestseller-scroll-container {
        padding: 0 10px;
    }

    .bestseller-card {
        width: 130px;
    }

    .bestseller-info {
        padding: 8px;
    }

    .bestseller-name {
        font-size: 11px;
        min-height: 31px;
    }

    .bestseller-price .price-value {
        font-size: 13px;
    }

    /* Category Toggle */
    .category-toggle-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .sidebar-category {
        width: 90%;
    }

    /* Sort Bar */
    .sort-bar {
        padding: 10px 12px;
    }

    .sort-label {
        font-size: 12px;
    }

    .sort-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 11px;
    }

    /* Products Grid */
    .products-grid {
        padding: 10px;
        gap: 6px;
    }

    .product-info {
        padding: 6px;
    }

    .product-name {
        font-size: 11px;
        min-height: 31px;
    }

    .price-value {
        font-size: 13px;
    }

    /* Bottom Pagination */
    .bottom-pagination {
        padding: 12px;
    }

    .page-number-btn {
        min-width: 30px;
        height: 30px;
        padding: 0 8px;
        font-size: 12px;
    }

    /* Footer */
    .footer-content {
        gap: 20px;
        padding: 25px 0;
    }

    .social-links a {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .footer-bottom {
        padding: 18px 0;
    }
}