/* ===== Shop Page Styles ===== */

/* Breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-top: 80px;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
}

.breadcrumb-nav a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
    color: #764ba2;
}

.breadcrumb-nav i {
    color: #999;
    font-size: 12px;
}

.breadcrumb-nav span {
    color: #666;
    font-weight: 500;
}

/* Shop Section */
.shop-section {
    padding: 2rem 0 4rem;
}

.shop-header {
    text-align: center;
    margin-bottom: 3rem;
}

.shop-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.shop-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.shop-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar Filters */
.shop-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.filter-section h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.3s ease;
}

.filter-item:hover {
    color: #667eea;
}

.filter-item input[type="checkbox"],
.filter-item input[type="radio"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.filter-item input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.filter-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.filter-item input[type="radio"] + .checkmark {
    border-radius: 50%;
}

.filter-item input[type="radio"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.filter-item input[type="radio"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Price Range */
.price-range {
    margin-bottom: 1rem;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.price-inputs span {
    color: #999;
    font-weight: 500;
}

.apply-price-btn {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.apply-price-btn:hover {
    background: #764ba2;
}

.price-presets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.price-preset {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.price-preset:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Rating Filter */
.rating-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rating-filter .filter-item {
    align-items: center;
}

.stars {
    color: #ffd700;
    font-size: 14px;
    margin-left: 0.5rem;
}

.rating-text {
    font-size: 13px;
    color: #666;
}

/* Clear Filters Button */
.clear-filters-btn {
    width: 100%;
    background: #ff4757;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.clear-filters-btn:hover {
    background: #ff3742;
    transform: translateY(-1px);
}

/* Shop Main */
.shop-main {
    min-height: 600px;
}

/* Shop Controls */
.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-info {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.shop-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: #667eea;
    color: white;
}

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

/* Products Container */
.products-container {
    position: relative;
    min-height: 400px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.products-grid.list-view .product-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    margin-left: 1.5rem;
}

.products-grid.list-view .product-info {
    flex: 1;
    padding: 0;
}

/* Product Card Enhancements */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.product-badge.sale {
    background: #ff4757;
}

.product-badge.new {
    background: #2ed573;
}

.product-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-actions button {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.product-actions button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.product-category {
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: #ffd700;
    font-size: 14px;
}

.rating-count {
    color: #666;
    font-size: 14px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

.old-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.discount-percent {
    background: #ff4757;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.add-to-cart {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.add-to-cart:active {
    transform: translateY(0);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.no-results h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.page-number.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-number:hover:not(.active) {
    background: #f8f9fa;
}

.page-dots {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: #999;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px; /* تغيير من right إلى left لتجنب التداخل */
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-filter-toggle:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shop-content {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

    
    .shop-sidebar.active {
        right: 0;
    }
    
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        bottom: 90px; /* رفع الزر لتجنب التداخل مع زر العودة لأعلى */
        left: 20px; /* وضع الزر على اليسار */
    }
    
    .shop-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .shop-actions {
        justify-content: space-between;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .shop-header h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* تجنب التداخل بين زر الفلاتر وزر العودة لأعلى */
    .mobile-filter-toggle {
        bottom: 90px; /* رفع زر الفلاتر لأعلى */
        left: 20px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* التأكد من أن زر العودة لأعلى في مكانه الصحيح */
    .scroll-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
    }
    
    .products-grid.list-view .product-card {
        flex-direction: column;
        text-align: center;
    }
    
    .products-grid.list-view .product-image {
        width: 100%;
        height: 200px;
        margin-left: 0;
        margin-bottom: 1rem;
    }
    
    .shop-sidebar {
        width: 100%;
    }
}

/* Filter Overlay for Mobile */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.filter-overlay.active {
    display: block;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Hover Effects */
.filter-item:hover .checkmark {
    border-color: #667eea;
    transform: scale(1.05);
}

.price-preset:active {
    transform: scale(0.98);
}

/* Focus States */
.price-inputs input:focus,
.sort-dropdown select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
