/* Shop Page Mobile Responsive Enhancements */

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.3);
}

.mobile-filter-toggle:active {
    transform: scale(0.98);
}

/* Filter Sidebar Mobile Overlay */
.filter-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-sidebar-overlay.active {
    opacity: 1;
}

@media (max-width: 1024px) {
    .mobile-filter-toggle {
        display: flex;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        height: 100%;
        background: white;
        z-index: 999;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .shop-sidebar.active {
        left: 0;
    }

    .filter-sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid var(--primary-color);
    }

    .filter-sidebar-header h3 {
        font-size: 20px;
        color: var(--dark-color);
        margin: 0;
    }

    .filter-close-btn {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-color);
        cursor: pointer;
        padding: 5px;
        line-height: 1;
    }

    .shop-wrapper {
        flex-direction: column;
    }

    .shop-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .shop-sidebar {
        width: 280px;
    }

    /* Toolbar Mobile Adjustments */
    .shop-toolbar {
        padding: 12px 15px;
        gap: 12px;
    }

    .toolbar-left {
        width: 100%;
    }

    .results-count {
        font-size: 13px;
    }

    .toolbar-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .view-mode {
        order: 1;
    }

    .sort-dropdown,
    .per-page-dropdown {
        flex: 1;
        order: 2;
    }

    .sort-dropdown select,
    .per-page-dropdown select {
        width: 100%;
        padding: 10px 30px 10px 12px;
        font-size: 13px;
    }

    .view-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* Filter Box Mobile */
    .filter-box {
        padding: 15px;
        margin-bottom: 15px;
    }

    .filter-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* Price Range Mobile */
    .price-inputs {
        gap: 10px;
    }

    .price-input input {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Products Grid Mobile */
    .products-grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .products-grid-view .product-card {
        border-radius: 8px;
    }

    .products-grid-view .product-image {
        height: 180px;
    }

    .product-info {
        padding: 12px;
    }

    .product-category {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .product-info h4 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .vendor-name {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .rating {
        font-size: 12px;
        margin-bottom: 8px;
    }

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

    .old-price {
        font-size: 13px;
    }

    .discount {
        font-size: 11px;
        padding: 2px 6px;
    }

    /* Product Actions Always Visible on Mobile */
    .product-actions {
        opacity: 1;
        gap: 6px;
    }

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

    .quick-add-btn {
        padding: 10px;
        font-size: 13px;
        gap: 6px;
    }

    /* Badge Mobile */
    .badge {
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        font-size: 11px;
    }

    /* Active Filters Mobile */
    .active-filters {
        gap: 8px;
        margin-bottom: 15px;
    }

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

    /* Pagination Mobile */
    .pagination-wrapper {
        margin-top: 30px;
        padding-top: 20px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-info {
        order: 2;
        text-align: center;
        font-size: 13px;
    }

    .pagination-list {
        order: 1;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .pagination-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .pagination-link.prev-next {
        padding: 0 12px;
        font-size: 13px;
    }

    /* List View Mobile */
    .products-grid-view.list-view {
        gap: 15px;
    }

    .products-grid-view.list-view .product-card {
        flex-direction: column;
    }

    .products-grid-view.list-view .product-image {
        width: 100%;
        height: 200px;
    }

    .products-grid-view.list-view .product-info {
        padding: 15px;
    }

    .products-grid-view.list-view .product-actions {
        flex-direction: row;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .shop-sidebar {
        width: 100%;
        left: -100%;
    }

    .mobile-filter-toggle {
        padding: 10px 15px;
        font-size: 14px;
    }

    /* Products Grid - Keep 2 columns but smaller */
    .products-grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .products-grid-view .product-image {
        height: 150px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h4 {
        font-size: 13px;
    }

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

    .old-price {
        font-size: 12px;
    }

    .btn-cart {
        padding: 8px;
        font-size: 12px;
    }

    /* Toolbar Extra Small */
    .shop-toolbar {
        padding: 10px 12px;
    }

    .view-mode {
        display: none;
    }

    /* Filter Box Extra Small */
    .filter-box {
        padding: 12px;
    }

    .filter-title {
        font-size: 15px;
    }

    /* Pagination Extra Small */
    .pagination-link {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .pagination-link.dots {
        min-width: 20px;
    }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .shop-sidebar {
        width: 280px;
    }

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

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .filter-checkbox,
    .show-more-btn,
    .btn-apply-filter,
    .action-btn,
    .quick-add-btn {
        min-height: 44px;
    }

    .product-actions {
        opacity: 1;
    }

    .quick-add-btn {
        transform: translateY(0);
    }
}
