.shop-container {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 1.5rem 0;
}

.products-grid,
.products-grid.row {
    --bs-gutter-x: 0.6rem !important;
}

.shop-container .row {
    --bs-gutter-x: 0.6rem !important;
}

.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 1.5rem;
    height: fit-content;
}

.filter-title {
    font-size: 1.5rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    color: #333;
    margin-bottom: 1.5rem;
}

.mobile-filter-header {
    display: none;
}

.filter-body {
    display: block;
}

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

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-title {
    font-size: 1rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-section-title svg {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.filter-section.collapsed .filter-section-title svg {
    transform: rotate(-90deg);
}

/* Modern Checkbox */
.modern-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-checkbox:hover {
    padding-left: 0.5rem;
}

.modern-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #ea7a7a;
}

.modern-checkbox label {
    margin: 0;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
}

.modern-checkbox input[type="checkbox"]:checked + label {
    color: #333;
    font-weight: 300;
}

/* Price Range */
.price-range-container {
    padding: 1rem 0;
}

.price-info {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
}

/* Modern Select */
.modern-select {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 15px;
}

.modern-select:focus {
    outline: none;
    border-color: #ea7a7a;
}

.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Products Section */
.products-section {
    background: transparent;
    padding: 0;
}

/* Products Grid */
.products-grid {
    margin: 0 -0.3rem;
}

.product-col {
    padding: 0 0.3rem;
    margin-bottom: 0.6rem;
}

/* Product Item */
.product-item {
    background: transparent;
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-item:active {
    transform: scale(0.98);
}

/* Product Image Container */
.product-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 125%;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #ea7a7a;
    color: white;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(234, 122, 122, 0.2);
}

/* Wishlist Button */
.wishlist-btn-container {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

.wishlist-btn {
    width: 34px;
    height: 34px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    color: #999;
    touch-action: manipulation;
}

.wishlist-btn:active {
    transform: scale(0.9);
}

.wishlist-btn.active {
    background: white;
    color: #ea7a7a;
}

.wishlist-btn i {
    font-size: 0.95rem;
}

/* Cart Button */
.cart-btn-container {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    opacity: 1;
    transform: translateY(0);
}

.cart-btn {
    width: 40px;
    height: 40px;
    background: white;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    touch-action: manipulation;
}

.cart-btn:active {
    transform: scale(0.9);
}

.cart-btn.in-cart {
    background: #ea7a7a;
    color: white;
    border-color: #ea7a7a;
}

.cart-btn.sold-out {
    background: #e8e8e8;
    color: #999;
    cursor: not-allowed;
}

.cart-btn i {
    font-size: 1rem;
}

/* Product Details */
.product-details {
    padding: 0.6rem 0.2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.product-title {
    font-size: 0.85rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    color: #000000;
    text-decoration: none;
    margin: 0;
    line-height: 1.4;
    height: 1.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.product-title:hover {
    color: #ea7a7a;
}

.product-pricing,
.product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.current-price,
.product-current-price {
    font-size: 1.1rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    color: #000000;
}

.old-price,
.product-old-price {
    font-size: 0.85rem;
    color: #bbb;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.product-stock-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: #fff0f1;
    color: #d97a7a;
    border-radius: 4px;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    margin-top: 0.3rem;
    display: inline-block;
}

.product-stock-badge.out-of-stock {
    background: #ffe0e0;
    color: #c85a5a;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: #ea7a7a;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(234, 122, 122, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.mobile-filter-btn:hover {
    background: #d97a7a;
    transform: scale(1.1);
}

.close-filter {
    display: none;
}

.filter-overlay {
    display: none;
}

/* Pagination Styles */
.pagination {
    margin-top: 2rem;
}

.pagination .page-link {
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 0.5rem 0.75rem;
    margin: 0 0.2rem;
    border-radius: 6px;
    transition: all 0.3s;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
}

.pagination .page-link:hover {
    background: #ea7a7a;
    border-color: #ea7a7a;
    color: white;
}

.pagination .page-item.active .page-link {
    background: #ea7a7a;
    border-color: #ea7a7a;
}

.pagination .page-item.disabled .page-link {
    background: #f8f9fa;
    border-color: #e0e0e0;
    color: #999;
}
/* Loading States */
.cart-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Custom Scrollbar for Filter Sidebar */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 5px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #ea7a7a;
}

/* Filter Content Animation */
.filter-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-section.collapsed .filter-content {
    display: none;
}

/* Hover Effects for Product Cards */
@media (hover: hover) {
    .product-item:hover {
        z-index: 1;
    }
    
    .product-item:hover .product-image-container {
        box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    }
}

/* Focus States for Accessibility */
.wishlist-btn:focus,
.cart-btn:focus,
.modern-checkbox input:focus,
.modern-select:focus {
    outline: 2px solid #ea7a7a;
    outline-offset: 2px;
}

/* Tablet & Below - Keep Filter Visible (Static) */
@media (max-width: 991px) {
    .filter-sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        top: auto;
        left: auto;
        z-index: auto;
        border-radius: 10px;
        transition: none;
        overflow: visible;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        margin-bottom: 0.75rem;
        padding: 0.85rem 1rem;
    }

    .mobile-filter-header {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        background: transparent;
        border: 0;
        color: #666;
        font-size: 1.2rem;
        font-family: "Poppins", sans-serif;
        font-weight: 300;
        text-align: left;
        padding: 0.1rem 0;
        margin: 0;
    }

    .mobile-filter-header span {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-filter-header i {
        font-size: 0.95rem;
    }

    .mobile-filter-chevron {
        transition: transform 0.3s ease;
    }

    .filter-title {
        display: none;
    }

    .filter-body {
        display: none;
        padding-top: 0.5rem;
    }

    .filter-sidebar.mobile-open .filter-body {
        display: block;
    }

    .filter-sidebar.mobile-open .mobile-filter-chevron {
        transform: rotate(180deg);
    }
    
    .close-filter {
        display: none !important;
    }
    
    .filter-overlay {
        display: none !important;
    }
    
    .mobile-filter-btn {
        display: none !important;
    }
}

/* Tablet Landscape - 4 products per row */
@media (min-width: 768px) and (max-width: 991px) {
    .product-col {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .product-image-container {
        padding-bottom: 125%;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .shop-container {
        padding: 1rem 0;
    }
    
    /* تعديل المسافة في Bootstrap للموبايل */
    .products-grid,
    .products-grid.row {
        --bs-gutter-x: 0.6rem !important;
    }

    .products-grid {
        margin: 0 -0.3rem;
    }
    
    .product-col {
        padding: 0 0.3rem;
        margin-bottom: 0.6rem;
    }
    
    .product-image-container {
        border-radius: 10px;
        padding-bottom: 125%;
    }
    
    .discount-badge {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.3rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .wishlist-btn-container {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .wishlist-btn {
        width: 34px;
        height: 34px;
    }
    
    .wishlist-btn i {
        font-size: 0.95rem;
    }
    
    .cart-btn-container {
        bottom: 0.5rem;
        right: 0.5rem;
        opacity: 1;
        transform: translateY(0);
    }
    
    .cart-btn {
        width: 40px;
        height: 40px;
    }
    
    .cart-btn i {
        font-size: 1rem;
    }
    
    .product-details {
        padding: 0.6rem 0.2rem 0;
        gap: 0.1rem;
    }
    
    .product-title {
        font-size: 0.85rem;
        line-height: 1.4;
        height: 1.6em;
    }
    
    .current-price,
    .product-current-price {
        font-size: 1.1rem;
    }
    
    .old-price,
    .product-old-price {
        font-size: 0.85rem;
    }
}

/* Extra Small Devices */
@media (max-width: 576px) {
    .product-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    /* تعديل المسافة في Bootstrap */
    .products-grid,
    .products-grid.row {
        --bs-gutter-x: 0.6rem !important;
    }
    
    .products-grid {
        margin: 0 -0.3rem;
    }
    
    .product-col {
        padding: 0 0.3rem;
        margin-bottom: 0.6rem;
    }
    
    .product-image-container {
        padding-bottom: 125%;
        border-radius: 10px;
    }
    
    .product-details {
        padding: 0.6rem 0.2rem 0;
    }
    
    .product-title {
        font-size: 0.85rem;
        height: 1.6em;
    }
    
    .current-price,
    .product-current-price {
        font-size: 1.1rem;
    }
    
    .old-price,
    .product-old-price {
        font-size: 0.85rem;
    }
    
    .discount-badge {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.3rem 0.65rem;
        font-size: 0.75rem;
    }
}

/* Large Screens - 3 products per row */
@media (min-width: 992px) {
    .product-col {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .product-image-container {
        padding-bottom: 125%;
    }
}

/* Extra Large Screens - 4 products per row */
@media (min-width: 1400px) {
    .product-col {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .product-image-container {
        padding-bottom: 125%;
    }
}

/* Performance Optimization */
.product-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Safe Area for Notched Devices */
@supports (padding: max(0px)) {
    .shop-container {
        padding-left: max(0.1rem, env(safe-area-inset-left));
        padding-right: max(0.1rem, env(safe-area-inset-right));
    }
    
    .mobile-filter-btn {
        bottom: max(6rem, calc(6rem + env(safe-area-inset-bottom)));
        right: max(1.5rem, calc(1.5rem + env(safe-area-inset-right)));
    }
}

/* Print Styles */
@media print {
    .filter-sidebar,
    .wishlist-btn,
    .cart-btn,
    .pagination {
        display: none !important;
    }
    
    .product-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Utility Classes */
.text-muted {
    color: #999 !important;
}

.text-danger {
    color: #ea7a7a !important;
}

.text-success {
    color: #ea7a7a !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.d-none {
    display: none !important;
}

.d-inline-block {
    display: inline-block !important;
}

/* Toast Notifications */
.success-toast,
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: "Poppins", sans-serif;
    font-weight: 300;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.success-toast {
    background: #ea7a7a;
}

.error-toast {
    background: #ea7a7a;
}

.success-toast.show,
.error-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.success-toast i,
.error-toast i {
    font-size: 1.2rem;
}

/* Mobile Toast */
@media (max-width: 767px) {
    .success-toast,
    .error-toast {
        top: auto;
        bottom: 80px;
        right: 1rem;
        left: 1rem;
        min-width: auto;
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
    text-decoration: none !important;
}

.product-item,
.product-img,
.wishlist-btn,
.cart-btn,
.discount-badge {
    will-change: transform;
}

/* Animation for fade out */
.fade-out-hide {
    animation: fadeOutHide 0.4s ease forwards;
}

@keyframes fadeOutHide {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
        display: none;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}
