/* CSS Variables */
.catalog-page {
    --primary: #ff7f50;
    --primary-light: rgba(255, 127, 80, 0.1);
    --border-radius: 8px;
    --transition: 0.3s ease;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

/* RTL Support */
[dir="rtl"] .catalog-page {
    font-family: 'Cairo', 'Tajawal', 'Almarai', sans-serif;
}

[dir="rtl"] .filter-title,
[dir="rtl"] .filter-option,
[dir="rtl"] .active-filter,
[dir="rtl"] .card-overlay,
[dir="rtl"] .stat-item,
[dir="rtl"] .card-meta,
[dir="rtl"] .results-header .d-flex,
[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

[dir="rtl"] .tag-filters,
[dir="rtl"] .active-filters,
[dir="rtl"] .card-tags {
    justify-content: flex-end;
}

[dir="rtl"] .results-header,
[dir="rtl"] .card-content,
[dir="rtl"] .card-title,
[dir="rtl"] .card-description,
[dir="rtl"] .empty-state,
[dir="rtl"] .loading {
    text-align: right;
}

[dir="rtl"] .featured-badge {
    right: auto;
    left: 0.75rem;
}

[dir="rtl"] .filter-title i,
[dir="rtl"] .featured-badge i,
[dir="rtl"] .stat-item i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Badge Styles - Circular Count Indicators */
.badge.bg-light.text-primary {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--primary) !important;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0;
    border-radius: 50%;
    min-width: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

/* Common Interactive Elements */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary-custom:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

/* Modern Hero Section */
.hero-modern {
    position: relative;
    padding: 6rem 0 4rem;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        var(--bs-primary) 0%, 
        var(--bs-secondary) 50%, 
        var(--bs-warning, #6f42c1) 100%);
    opacity: 0.95;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    background-size: 100% 100%;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    background: linear-gradient(to right, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-description {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 650px;
    margin: 0 auto 3rem;
    line-height: 1.6;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Hero Search */
.hero-search {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.search-wrapper {
    position: relative;
    background: white;
    border-radius: 60px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--primary);
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 0.5rem;
    font-size: 1.05rem;
    background: transparent;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-clear:hover {
    background: #e0e0e0;
    color: #333;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-stats .stat-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.hero-stats .stat-item:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hero-stats .stat-item i {
    font-size: 1.1rem;
}

/* Mobile Filter Button */
.filters-toggle-modern {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.filters-toggle-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.filter-count {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

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

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

/* Layout & Filters */
.catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.filters {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

.filters::-webkit-scrollbar {
    width: 6px;
}

.filters::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filters::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filters::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.filter-option:hover {
    background-color: #f8f9fa;
    border-color: #eee;
    transform: translateX(4px);
}

.filter-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1.1em;
    height: 1.1em;
    cursor: pointer;
}

/* Filter Tags & Pills */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter,
.active-filter {
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-filter {
    background: #f8f9fa;
    border: 2px solid transparent;
    padding: 0.4rem 0.8rem;
}

.tag-filter:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.tag-filter.active {
    background: var(--primary);
    color: white;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.active-filter {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

.active-filter button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
}

/* Results Header & Grid */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Modern Results Header */
.results-header-modern {
    background: white;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.results-info {
    flex: 1;
}

.results-count {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: #1a1a1a;
}

.results-count strong {
    font-weight: 800;
    color: var(--primary);
    font-size: 2rem;
}

.results-label {
    color: #666;
    font-weight: 500;
    font-size: 1.1rem;
}

.search-query {
    margin: 0.5rem 0 0;
    color: #666;
    font-size: 0.95rem;
}

.search-query span {
    color: var(--primary);
    font-weight: 600;
}

.sort-select {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    background: white;
    cursor: pointer;
}

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

/* Modern Catalog Grid */
.catalog-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards */
.catalog-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInUp 0.3s ease-out;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Modern Cards */
.catalog-card-modern {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.catalog-card-modern:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
    background-image: linear-gradient(
        90deg, 
        #f0f0f0 25%, 
        #f8f8f8 50%, 
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.5s ease;
    opacity: 0;
}

.card-image img.loaded {
    opacity: 1;
    /* Stop animation when loaded if possible, but CSS can't target parent based on child class. 
       However, the image will cover the background. */
}

.responsive-image {
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

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

.image-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: var(--transition);
}

.catalog-card:hover .card-overlay {
    opacity: 1;
}

/* Circular Action Buttons */
.overlay-btn,
.filters-close {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.overlay-btn {
    color: var(--dark-color);
}

.overlay-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    text-decoration: none;
}

.featured-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-content {
    padding: 1rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.3;
}

.card-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.card-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
}

/* Modern Card Components */
.featured-badge-modern {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    background: linear-gradient(135deg, var(--bs-warning), var(--bs-yellow, #ffc107));
    color: #333;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Likes Badge */
.likes-badge-modern {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.likes-badge-modern i {
    color: #ff4757;
    font-size: 0.9rem;
}

.likes-badge-modern:hover {
    transform: scale(1.05);
    background: rgba(255, 71, 87, 0.9);
}

[dir="rtl"] .likes-badge-modern {
    left: auto;
    right: 1rem;
}

.card-image-modern {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        #f0f0f0 0%,
        #f8f8f8 25%,
        #f0f0f0 50%,
        #f8f8f8 75%,
        #f0f0f0 100%
    );
    background-size: 400% 400%;
    animation: shimmer 2s ease-in-out infinite;
}

.image-wrapper {
    width: 100%;
    height: 100%;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.card-img.loaded {
    opacity: 1;
}

.catalog-card-modern:hover .card-img {
    transform: scale(1.1);
}

.card-overlay-modern {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.catalog-card-modern:hover .card-overlay-modern {
    opacity: 1;
}

.overlay-actions {
    display: flex;
    gap: 1rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-card-modern:hover .overlay-actions {
    transform: translateY(0);
}

.overlay-btn-modern {
    background: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.overlay-btn-modern:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.15) translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 127, 80, 0.4);
}

.overlay-btn-modern i.liked {
    color: #ff4757;
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.2); }
}

.card-content-modern {
    padding: 1.5rem;
}

.card-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card-title-modern {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.like-btn-modern {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 700;
    color: #666;
    flex-shrink: 0;
    min-width: 55px;
    justify-content: center;
}

.like-btn-modern:hover {
    background: #ffe6e6;
    color: #ff4757;
    transform: scale(1.05);
}

.like-btn-modern i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.like-btn-modern i.liked {
    color: #ff4757;
    animation: heartBeat 0.3s ease;
}

.like-btn-modern span {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.card-description-modern {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.card-tag-modern {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-info-rgb), 0.1));
    color: var(--bs-primary);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
    transition: all 0.2s ease;
}

.card-tag-modern:hover {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    color: white;
    transform: translateY(-2px);
}

.card-meta-modern {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #999;
}

.meta-date,
.meta-category {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.meta-date i,
.meta-category i {
    font-size: 0.8rem;
    color: #ccc;
}

/* Utility States & Animations */
.loading, 
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

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

.page-btn {
    border: 1px solid #ddd;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover, 
.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Lightbox2 Enhancements */
.lightbox {
    z-index: 9999 !important;
}

.lightbox .lb-image {
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    max-width: 90vw !important;
    max-height: 80vh !important;
    object-fit: contain;
}

.lightbox .lb-container {
    padding: 20px !important;
}

.lightbox .lb-outerContainer {
    background: rgba(0,0,0,0.95) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8) !important;
}

.lightbox .lb-nav {
    opacity: 1 !important;
    height: 100% !important;
}

.lightbox .lb-nav a {
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(20px);
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    outline: none !important;
    opacity: 0.8 !important;
    text-decoration: none !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    margin-top: 0 !important;
}

.lightbox .lb-nav a:hover {
    background: var(--primary) !important;
    transform: translateY(-50%) scale(1.1) !important;
    text-decoration: none !important;
    opacity: 1 !important;
    border-color: var(--primary) !important;
    box-shadow: 0 8px 25px rgba(255, 127, 80, 0.4) !important;
}

.lightbox .lb-nav a.lb-prev {
    left: 30px !important;
    right: auto !important;
}

.lightbox .lb-nav a.lb-next {
    right: 30px !important;
    left: auto !important;
}

/* Add arrow icons for navigation */
.lightbox .lb-nav a.lb-prev::before {
    content: "‹" !important;
    font-size: 28px !important;
    color: white !important;
    font-weight: 300 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.lightbox .lb-nav a.lb-next::before {
    content: "›" !important;
    font-size: 28px !important;
    color: white !important;
    font-weight: 300 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.lightbox .lb-close {
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(20px);
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    right: 30px !important;
    top: 30px !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    outline: none !important;
    opacity: 0.8 !important;
    text-decoration: none !important;
}

/* Add close icon */
.lightbox .lb-close::before {
    content: "×" !important;
    font-size: 32px !important;
    color: white !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lightbox .lb-close:hover {
    background: #dc3545 !important;
    transform: scale(1.1) !important;
    text-decoration: none !important;
    opacity: 1 !important;
    border-color: #dc3545 !important;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4) !important;
}

.lightbox .lb-dataContainer {
    background: rgba(0,0,0,0.85) !important;
    backdrop-filter: blur(30px);
    border-radius: 0 0 12px 12px !important;
    margin: 0 auto !important;
    padding: 2rem 2.5rem !important;
    width: auto !important;
    max-width: 95% !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
}

.lightbox .lb-data .lb-caption {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: white !important;
    margin-bottom: 0.8rem !important;
    line-height: 1.5 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
}

.lightbox .lb-data .lb-number {
    background: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 20px !important;
    margin: 0 !important;
    display: inline-block !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

/* RTL Lightbox Adjustments */
[dir="rtl"] .lightbox .lb-nav a.lb-prev {
    left: auto !important;
    right: 30px !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

[dir="rtl"] .lightbox .lb-nav a.lb-next {
    right: auto !important;
    left: 30px !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

[dir="rtl"] .lightbox .lb-nav a.lb-prev:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

[dir="rtl"] .lightbox .lb-nav a.lb-next:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

/* Swap arrow directions for RTL */
[dir="rtl"] .lightbox .lb-nav a.lb-prev::before {
    content: "›" !important;
}

[dir="rtl"] .lightbox .lb-nav a.lb-next::before {
    content: "‹" !important;
}

[dir="rtl"] .lightbox .lb-close {
    right: auto !important;
    left: 30px !important;
}

[dir="rtl"] .lightbox .lb-data .lb-details {
    text-align: right !important;
}

[dir="rtl"] .lightbox .lb-data .lb-caption {
    font-family: 'Cairo', 'Tajawal', 'Almarai', sans-serif !important;
    text-align: right !important;
    line-height: 1.6 !important;
}

[dir="rtl"] .lightbox .lb-data .lb-number {
    text-align: right !important;
    font-family: 'Cairo', 'Tajawal', 'Almarai', sans-serif !important;
}

/* Lightbox Mobile Improvements */
@media (max-width: 768px) {
    .lightbox .lb-image {
        max-width: 95vw !important;
        max-height: 75vh !important;
    }
    
    .lightbox .lb-nav a {
        width: 50px !important;
        height: 50px !important;
    }
    
    .lightbox .lb-nav a.lb-prev {
        left: 15px !important;
    }
    
    .lightbox .lb-nav a.lb-next {
        right: 15px !important;
    }
    
    .lightbox .lb-close {
        width: 50px !important;
        height: 50px !important;
        right: 15px !important;
        top: 15px !important;
    }
    
    .lightbox .lb-dataContainer {
        padding: 1.5rem 1rem !important;
    }
    
    .lightbox .lb-data .lb-caption {
        font-size: 1rem !important;
    }
    
    [dir="rtl"] .lightbox .lb-nav a.lb-prev {
        right: 15px !important;
    }
    
    [dir="rtl"] .lightbox .lb-nav a.lb-next {
        left: 15px !important;
    }
    
    [dir="rtl"] .lightbox .lb-close {
        left: 15px !important;
    }
}

@media (max-width: 480px) {
    .lightbox .lb-image {
        max-width: 98vw !important;
        max-height: 70vh !important;
    }
    
    .lightbox .lb-nav a {
        width: 45px !important;
        height: 45px !important;
    }
    
    .lightbox .lb-nav a::before {
        font-size: 24px !important;
    }
    
    .lightbox .lb-close {
        width: 45px !important;
        height: 45px !important;
    }
    
    .lightbox .lb-close::before {
        font-size: 28px !important;
    }
    
    .lightbox .lb-dataContainer {
        padding: 1rem 0.75rem !important;
    }
    
    .lightbox .lb-data .lb-caption {
        font-size: 0.9rem !important;
    }
    
    .lightbox .lb-data .lb-number {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }
}

/* Mobile Responsive Design (992px and below) */
@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .filters {
        position: fixed !important;
        top: 0 !important;
        left: -320px;
        width: 320px;
        height: 100vh;
        background: white;
        z-index: 10050;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 1rem;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        max-height: none !important;
    }
    
    .filters.show {
        left: 0 !important;
    }
    
    .filters-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0,0,0,0.5) !important;
        z-index: 10040 !important;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .filters-backdrop.show {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Modern Hero Adjustments */
    .hero-modern {
        padding: 4rem 0 3rem;
        min-height: 400px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-search {
        margin-bottom: 2rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stats .stat-item {
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }

    /* Modern Grid Adjustments */
    .catalog-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .results-header-modern {
        padding: 1.5rem 1.5rem;
    }

    /* Filter Buttons */
    .hero-filter-btn {
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        color: white !important;
        font-weight: 600;
        font-size: 1rem;
        padding: 1rem 1.5rem;
        border-radius: 50px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        margin-bottom: 0 !important;
        min-width: 160px;
    }
    
    .hero-filter-btn:hover {
        background: rgba(255, 255, 255, 0.25) !important;
        transform: translateY(-2px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.5) !important;
    }
    
    .hero-filter-btn .badge {
        background: rgba(255, 255, 255, 0.9) !important;
        color: var(--primary) !important;
        font-size: 0.75rem;
        font-weight: 700;
        padding: 0;
        border-radius: 50%;
        min-width: 1.5rem;
        width: 1.5rem;
        height: 1.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        line-height: 1;
        animation: pulse 2s infinite;
    }

    /* Mobile Filter Header */
    .filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }

    /* Mobile Layout Adjustments */
    .hero {
        padding: 2rem 0 1rem;
    }
    
    .stats {
        gap: 1rem;
    }
    
    body.filters-open {
        overflow: hidden;
    }
}

/* Desktop Hide Mobile Elements */
@media (min-width: 993px) {
    .filters-toggle,
    .hero-filter-btn,
    .filters-backdrop,
    .filters-header {
        display: none;
    }
}

/* Tablet Adjustments (768px and below) */
@media (max-width: 768px) {
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .catalog-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.25rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .results-header-modern {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
    }

    .results-count {
        font-size: 1.25rem;
    }

    .results-count strong {
        font-size: 1.75rem;
    }
    
    .search-section {
        margin: -1rem auto 2rem;
    }

    .hero-modern {
        padding: 3rem 0 2.5rem;
        min-height: 350px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }

    .hero-badge {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    .search-wrapper {
        padding: 0.4rem 0.8rem;
    }

    .search-input {
        font-size: 0.95rem;
        padding: 0.85rem 0.5rem;
    }

    .overlay-btn-modern {
        width: 44px;
        height: 44px;
    }

    .card-content-modern {
        padding: 1.25rem;
    }
}

/* Mobile Adjustments (576px and below) */
@media (max-width: 576px) {
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .catalog-grid-modern {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input, 
    .search-btn {
        width: 100%;
    }

    .search-wrapper {
        border-radius: 50px;
        padding: 0.4rem 1rem;
    }

    .search-input {
        padding: 0.75rem 0.25rem;
        font-size: 0.9rem;
    }
    
    .catalog-container {
        padding: 0 0.5rem;
    }

    .hero-modern {
        padding: 2.5rem 0 2rem;
        min-height: 320px;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.85rem;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 1.75rem;
    }

    .hero-search {
        margin-bottom: 1.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-stats .stat-item {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .results-header-modern {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }

    .results-count {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .results-count strong {
        font-size: 1.5rem;
    }

    .catalog-card-modern {
        border-radius: 16px;
    }

    .catalog-card-modern:hover {
        transform: translateY(-4px) scale(1);
    }

    .card-title-modern {
        font-size: 1rem;
    }

    .card-description-modern {
        font-size: 0.85rem;
    }

    .card-content-modern {
        padding: 1rem;
    }

    .overlay-btn-modern {
        width: 40px;
        height: 40px;
    }

    .overlay-actions {
        gap: 0.75rem;
    }

    .featured-badge-modern {
        font-size: 0.7rem;
        padding: 0.3rem 0.7rem;
    }
    
    /* Ensure sidebar is completely hidden on very small screens */
    .filters {
        left: -100vw !important;
        width: 90vw;
        max-width: 300px;
    }
    
    /* Badge refinements for very small screens */
    .hero-filter-btn .badge,
    .badge.bg-light.text-primary,
    .filter-count {
        min-width: 1.25rem;
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.7rem;
        padding: 0;
        flex-shrink: 0;
    }
    
    .hero-filter-btn,
    .filters-toggle-modern {
        padding: 0.85rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* RTL Specific Adjustments */
[dir="rtl"] .filters {
    left: auto;
    right: -320px;
    transition: right 0.3s ease;
}

[dir="rtl"] .filters.show {
    right: 0 !important;
}

@media (max-width: 576px) {
    [dir="rtl"] .filters {
        right: -100vw !important;
        left: auto;
    }
    
    [dir="rtl"] .search-input {
        text-align: center;
    }
}

/* Like Button Styles */
.like-btn-meta {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
    color: #666;
    transition: transform 0.2s;
    margin-left: auto;
}

[dir="rtl"] .like-btn-meta {
    margin-left: 0;
    margin-right: auto;
}

.like-btn-meta:hover {
    transform: scale(1.1);
}

.like-btn-meta i.text-danger {
    color: #dc3545 !important;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}