@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Roboto:wght@300;400;500;700&display=swap');

body {
    font-family: 'Roboto', 'Cairo', sans-serif; /* Use a more modern font */
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* Light gray background */
    color: #2c8cec;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

header h1 {
    font-family: 'Cairo', 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 2.5rem; /* Larger heading */
}

header p {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

.navbar {
    margin-bottom: 1rem;
}

main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the products */
    padding: 20px;
    flex-grow: 1;
}

section {
    background-color: #fff;
    padding: 20px;
    margin: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 1200px; /* Limit the width of the section */
}

.category-item {
    background-color: #fff;
    padding: 20px;
    margin: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.category-item:hover {
    transform: scale(1.05);
}

.category-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px; /* Rounded corners for images */
}

.product {
    border: 1px solid #e1e8ed;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    background-color: #ffffff; /* Light background for product */
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.1); /* Subtle shadow */
}

.product img {
    max-width: 300px;
    height: auto;
    margin-right: 15px;
    border-radius: 5px; /* Rounded corners for images */
}

.product .no-image {
    max-width: 300px;
    height: 200px;
    margin-right: 15px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed #ccc;
    border-radius: 5px;
}

.product .no-image p {
    text-align: center;
    margin: 0;
}

.product-info {
    flex-grow: 1;
}

.product-info h3 {
    margin-top: 0;
    font-size: 1.3rem;
}

.quantity-input {
    width: 60px;
    text-align: center;
    margin-left: 10px;
}

#cart-items {
    list-style: none;
    padding: 0;
}

#cart-items li {
    margin-bottom: 5px;
}

#send-request {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 1.2rem;
}

#send-request:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

/* Product List Styles */
.product-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    padding: 20px 0;
    direction: rtl;
}

.product-item {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: right;
    direction: rtl;
    width: calc(33.333% - 30px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 10px rgba(41, 128, 185, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(41, 128, 185, 0.2);
}

.product-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    padding: 10px;
}

.product-item h3 {
    font-family: 'Cairo', 'Roboto', sans-serif;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 12px;
    text-align: center;
    width: 100%;
    font-weight: 600;
}

.product-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: right;
    flex-grow: 1;
}

.product-item .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #27ae60;
    margin: 15px 0;
    text-align: center;
}

.product-item .add-to-cart {
    font-family: 'Cairo', 'Roboto', sans-serif;
    font-weight: 500;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-item .add-to-cart:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    transform: scale(1.02);
}

/* New Product Card Styles - Angular Design */
.product-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    clip-path: polygon(0 0, 100% 0, 100% 95%, 95% 100%, 0 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.product-image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    background-color: #f8f9fa;
}

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

.product-image .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #adb5bd;
    font-size: 1rem;
}

.product-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.product-details h3 {
    font-family: 'Cairo', 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    padding-bottom: 0.5rem;
}

.product-details h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #0984e3, #74b9ff);
}

.product-details .description {
    color: #34495e;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    padding: 0 0.5rem;
}

.product-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
    padding: 0 0.5rem;
}

.price {
    font-family: 'Roboto', 'Cairo', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #27ae60;
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.05);
}

.add-to-cart {
    font-family: 'Cairo', 'Roboto', sans-serif;
    font-weight: 500;
    width: 100%;
    padding: 0.8rem;
    border: none;
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0% 100%);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-to-cart:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    transform: translateY(-2px);
}

/* Update placeholder style */
.placeholder {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    margin-bottom: 15px;
    border: 2px dashed #ddd;
    font-size: 1.1rem;
}

/* New Product Card Styles */
.product-card-new {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.product-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.placeholder-new {
    background-color: #f8f9fa;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border-radius: 8px;
}

.product-image-new {
    max-height: 200px;
    width: auto;
    object-fit: contain;
}

.price-tag {
    font-weight: bold;
    color: #28a745;
}

.card-text {
    height: 48px;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Main Navigation Styles */
.main-nav {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.main-nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.main-nav .nav-list a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.main-nav .nav-list a:hover {
    color: #3498db;
}

@media (max-width: 768px) {
    .main-nav .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product {
        flex-direction: column; /* Stack image and info vertically */
        align-items: center;
    }
    .product img {
        margin-bottom: 10px;
        margin-right: 0;
    }
    .category-item {
        margin: 10px 0;
    }
    .product-item {
        width: calc(50% - 20px);
        min-height: 450px;
    }
    
    .product-item img,
    .placeholder {
        height: 250px;
    }

    .product-details {
        padding: 1rem;
    }
    
    .product-details h3 {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .col-sm-6 {
        width: 100%;
    }
    
    .product-item {
        margin: 10px;
    }

    .product-item img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .product-item {
        width: 100%;
        margin: 10px 0;
        min-height: 420px;
    }
    
    .product-item img,
    .placeholder {
        height: 200px;
    }
}

/* أنماط زر عرض المزيد */
#show-more-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#show-more-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

#show-more-btn:active {
    transform: translateY(0);
}

/* تأثيرات للمنتجات */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-card img {
    transition: transform 0.3s ease;
}

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

.no-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: 500;
}

/* Floating Cart Button */
.floating-cart-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-cart-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.6);
}

.floating-cart-btn i {
    font-size: 24px;
}

.floating-cart-btn .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
}

.floating-cart-btn .cart-count:empty {
    display: none;
}
