* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0e9eff;
    --primary-dark: #0077cc;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(14, 158, 255, 0.15);
    --gradient: linear-gradient(135deg, #0e9eff 0%, #0077cc 100%);
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: var(--white);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 20px;
    opacity: 0.95;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.breadcrumb-list {
    display: flex;
    gap: 10px;
    align-items: center;
    list-style: none;
    font-size: 14px;
}

.breadcrumb-list a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-list a:hover {
    color: var(--primary-color);
}

.breadcrumb-list span {
    color: var(--text-dark);
    font-weight: 600;
}

/* Shop Section */
.shop-section {
    padding: 40px 0;
}

/* Toolbar */
.toolbar {
    background: var(--white);
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    font-size: 15px;
    color: var(--text-gray);
}

.results-count strong {
    color: var(--text-dark);
    font-weight: 800;
}

.toolbar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.sort-select {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    background: var(--white);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

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

.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(14, 158, 255, 0.2);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff4757;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}

.product-badge .badge-icon {
    font-size: 14px;
}

.product-badge.new {
    background: #00d2d3;
}

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

.product-badge.bestseller {
    background: #ffd700;
    color: var(--text-dark);
}

/* Product Image Container */
.product-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-radius: 0;
}

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

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

.product-card:hover .product-image {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Product Info */
.product-info {
    padding: 20px;
    background: white;
}

.product-name-en {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.3;
    text-align: right;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

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

.review-count {
    color: var(--text-gray);
    font-size: 12px;
}

.product-name-ar {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: right;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f8f9fa;
    margin-top: 4px;
}

.price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

.price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    direction: ltr;
    text-align: right;
    line-height: 1;
}

.old-price {
    font-size: 13px;
    color: var(--text-gray);
    text-decoration: line-through;
    direction: ltr;
    text-align: right;
    font-weight: 500;
}

.add-to-cart-btn {
    padding: 10px 18px;
    font-size: 13px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.add-to-cart-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 158, 255, 0.3);
}

.add-to-cart-btn:disabled {
    background: var(--text-gray);
    cursor: not-allowed;
    transform: none;
}

/* List View */
.products-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 300px 1fr;
}

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

.products-grid.list-view .product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination a,
.pagination span {
    padding: 12px 20px;
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    color: var(--text-dark);
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .active span {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.pagination .disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Empty State */
.empty-products {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.empty-products .empty-icon {
    font-size: 100px;
    margin-bottom: 20px;
}

.empty-products h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.empty-products p {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 30px;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 968px) {
    .products-grid.list-view .product-card {
        grid-template-columns: 1fr;
    }

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

    .hero h1 {
        font-size: 38px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-right {
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 60px 0 40px;
    }

    .hero h1 {
        font-size: 32px;
    }

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

    .pagination {
        flex-wrap: wrap;
    }

    .product-card {
        border-radius: 15px;
    }

    .product-info {
        padding: 20px;
    }

    .product-footer {
        flex-direction: row;
        gap: 12px;
        align-items: flex-end;
        justify-content: space-between;
    }

    .add-to-cart-btn {
        flex: 1;
        justify-content: center;
    }

    .price-wrapper {
        align-items: flex-end;
    }
}