/**
 * Abouhamar Mall - Shop Page Stylesheet
 */

/* Shop Container */
.shop-container {
    padding: 40px 0;
}

/* Shop Sidebar */
.shop-sidebar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filter-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-color);
}

.rtl .filter-title::after {
    left: auto;
    right: 0;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-item {
    margin-bottom: 10px;
}

.filter-link {
    color: var(--text-color);
    display: block;
    padding: 8px 0;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.filter-link i {
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.rtl .filter-link i {
    margin-right: 0;
    margin-left: 8px;
    transform: rotate(180deg);
}

.filter-link:hover, .filter-link.active {
    color: var(--secondary-color);
    padding-left: 5px;
}

.rtl .filter-link:hover, .rtl .filter-link.active {
    padding-left: 0;
    padding-right: 5px;
}

.filter-link:hover i {
    transform: translateX(3px);
}

.rtl .filter-link:hover i {
    transform: translateX(-3px) rotate(180deg);
}

.form-check {
    margin-bottom: 8px;
}

.form-check-input {
    margin-right: 10px;
    cursor: pointer;
}

.rtl .form-check-input {
    margin-right: 0;
    margin-left: 10px;
}

.form-check-label {
    cursor: pointer;
    font-size: 15px;
    margin-bottom: 0;
}

.price-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-filter input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.reset-filters {
    margin-top: 15px;
    text-align: center;
}

.filter-actions {
    margin-top: 20px;
}

/* Shop Header */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.shop-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.shop-title p {
    margin: 5px 0 0;
    color: #666;
}

.shop-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Featured Categories */
.featured-categories {
    margin-bottom: 30px;
}

.category-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: fit-content;
    margin: 0 5px 20px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.category-image {
    position: relative;
    height: 100%;
    width: 100%;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #fff;
    text-align: center;
    transition: all 0.3s ease;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.category-card .btn-primary {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 200px;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.category-card .btn-primary:hover {
    background-color: #ff5252;
    border-color: #ff5252;
    transform: translate(-50%, -3px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Products Container */
.products-container {
    margin-bottom: 30px;
}

.products-container.grid-view .product-card {
    height: 100%;
}

.products-container.list-view .row {
    margin-left: 0;
    margin-right: 0;
}

.products-container.list-view .col-md-4 {
    max-width: 100%;
    flex: 0 0 100%;
}

.products-container.list-view .product-card {
    display: flex;
    flex-direction: row;
    height: auto;
}

.products-container.list-view .product-image {
    width: 200px;
    flex-shrink: 0;
}

.products-container.list-view .product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.products-container.list-view .product-title {
    height: auto;
    -webkit-line-clamp: 1;
}

.products-container.list-view .product-actions {
    position: static;
    justify-content: flex-start;
    background: none;
    padding: 10px 0 0;
    margin-top: auto;
}

.products-container.list-view .product-actions button {
    background-color: #f8f9fa;
}

/* Product Card */
.product-card {
    position: relative;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background-color: #fff;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-image {
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Product Badge Fixes */
.product-badge {
    position: absolute;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
    color: #fff;
}

/* Dynamic Badge Positions */
/* LTR Layout (English) */
html:not(.rtl) .product-badge.discount,
html:not(.rtl) .product-badge.featured,
html:not(.rtl) .product-badge.new,
body:not(.rtl) .product-badge.discount,
body:not(.rtl) .product-badge.featured,
body:not(.rtl) .product-badge.new {
    left: 10px;
    right: auto;
}

html:not(.rtl) .product-badge.discount,
body:not(.rtl) .product-badge.discount {
    background-color: #ff5252;
    top: 10px;
}

html:not(.rtl) .product-badge.new,
body:not(.rtl) .product-badge.new {
    background-color: #4caf50;
    top: 45px;
}

html:not(.rtl) .product-badge.featured,
body:not(.rtl) .product-badge.featured {
    background-color: #007bff;
    top: 80px;
}

/* RTL Layout (Arabic) */
html.rtl .product-badge.discount,
html.rtl .product-badge.featured,
html.rtl .product-badge.new,
body.rtl .product-badge.discount,
body.rtl .product-badge.featured,
body.rtl .product-badge.new {
    left: auto;
    right: 10px;
}

html.rtl .product-badge.discount,
body.rtl .product-badge.discount {
    background-color: #ff5252;
    top: 10px;
}

html.rtl .product-badge.new,
body.rtl .product-badge.new {
    background-color: #4caf50;
    top: 45px;
}

html.rtl .product-badge.featured,
body.rtl .product-badge.featured {
    background-color: #007bff;
    top: 80px;
}

.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background-color: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-actions {
    bottom: 0;
}

.product-actions button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-actions button:hover {
    background-color: #007bff;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-actions button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-actions button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

.product-actions button i {
    transition: all 0.3s ease;
}

.product-actions button:hover i {
    transform: scale(1.1);
}

.product-actions button .fa-spinner {
    animation: spin 1s infinite linear;
}

.product-actions .add-to-cart:hover {
    background-color: #28a745;
}

.product-actions .add-to-wishlist:hover {
    background-color: #dc3545;
}

.product-actions .quick-view:hover {
    background-color: #17a2b8;
}

/* Loading animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    height: 2.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #007bff;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff6b6b;
}

.old-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-rating {
    display: flex;
    align-items: center;
    color: #ffc107;
}

.rating-count {
    font-size: 0.8rem;
    color: #999;
    margin-left: 5px;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 0 15px;
    flex-wrap: wrap;
}

.page-link {
    color: #333;
    border-color: #ddd;
    transition: all 0.3s ease;
    padding: 8px 12px;
    margin: 2px;
    border-radius: 4px;
    min-width: 44px;
    text-align: center;
}

.page-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
    border-color: #ddd;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Mobile Pagination Styles */
@media (max-width: 768px) {
    .pagination {
        margin-top: 20px;
        margin-bottom: 40px;
        padding: 10px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .page-item {
        display: inline-block;
        margin: 0 2px;
        flex-shrink: 0;
    }
    
    .page-link {
        padding: 10px 14px;
        font-size: 16px;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        border: 1px solid #ddd;
        background-color: #fff;
        color: #333;
        text-decoration: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .page-link:hover,
    .page-link:focus,
    .page-link:active {
        background-color: #f8f9fa;
        border-color: #007bff;
        color: #007bff;
        outline: none;
        box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    }
    
    .page-item.active .page-link {
        background-color: #007bff;
        border-color: #007bff;
        color: white;
        font-weight: bold;
    }
    
    .page-item.disabled .page-link {
        opacity: 0.6;
        background-color: #f8f9fa;
        border-color: #ddd;
        color: #6c757d;
        pointer-events: none;
    }
}

@media (max-width: 480px) {
    .pagination {
        padding: 8px;
        margin-bottom: 50px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Hide some page numbers on very small screens */
    .pagination .page-item:not(.active):not(.disabled):nth-child(n+8) {
        display: none;
    }
    
    .pagination .page-item.active,
    .pagination .page-item.disabled,
    .pagination .page-item:nth-child(-n+3),
    .pagination .page-item:nth-last-child(-n+3) {
        display: inline-block !important;
    }
}

/* No Products */
.no-products {
    padding: 30px;
    text-align: center;
}

.no-products .alert {
    max-width: 500px;
    margin: 0 auto;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .shop-sidebar {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 767px) {
    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .shop-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .list-view .product-card {
        flex-direction: column;
    }
    
    .list-view .product-image {
        width: 100%;
    }
    
    .list-view .product-actions {
        position: absolute;
        bottom: -50px;
        left: 0;
        width: 100%;
        justify-content: center;
        background-color: rgba(255,255,255,0.9);
    }
    
    .list-view .product-card:hover .product-actions {
        bottom: 0;
    }
}

@media (max-width: 576px) {
    .shop-title h1 {
        font-size: 24px;
    }
    
    .form-select {
        min-width: 120px;
    }
    
    .product-actions {
        bottom: 0;
        opacity: 0;
    }
    
    .product-card:hover .product-actions {
        opacity: 1;
    }
    
    /* Mobile product actions repositioning */
    .mobile-product-actions,
    .product-actions {
        position: relative;
        background-color: #f8f9fa;
        padding: 10px;
        margin-top: 0;
        opacity: 1;
        display: flex;
        justify-content: center;
        gap: 10px;
        bottom: auto;
        transform: none;
    }
    
    .product-card:hover .mobile-product-actions,
    .product-card:hover .product-actions {
        transform: none;
        bottom: auto;
    }
}

/* Featured Categories Slider */
.categories-slider {
    position: relative;
    margin-bottom: 30px;
}

.category-carousel .owl-stage-outer {
    padding: 10px 0;
}

.category-carousel .owl-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.category-carousel .owl-nav button.owl-prev,
.category-carousel .owl-nav button.owl-next {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color) !important;
    font-size: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    margin: 0 -20px;
    transition: all 0.3s ease;
}

.category-carousel .owl-nav button.owl-prev:hover,
.category-carousel .owl-nav button.owl-next:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.category-carousel .owl-dots {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.category-carousel .owl-dots .owl-dot {
    width: 10px;
    height: 10px;
    background-color: #ddd;
    border-radius: 50%;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.category-carousel .owl-dots .owl-dot.active {
    background-color: var(--secondary-color);
    transform: scale(1.2);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.rtl .section-title {
    padding-left: 0;
    padding-right: 15px;
}

.rtl .section-title::before {
    left: auto;
    right: 0;
}

/* Notification Container */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 300px;
}

.alert {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Fix for warning messages */
.warning-message {
    display: none;
}

/* Fix for product display in category page */
.category-container .product-card {
    margin-bottom: 25px;
    transition: all 0.3s ease;
    height: 100%;
}

.category-container .product-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
}

.category-container .product-image img {
    width: 100%;
    transition: transform 0.5s ease;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.category-container .product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Fix for product info in category page */
.category-container .product-info {
    padding: 10px 5px;
}

.category-container .product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
}

.category-container .product-price {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.category-container .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 10px;
}

.category-container .old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
} 