/* --- Global Settings & Variables --- */
:root {
    --primary-color: #2c3e50; /* كحلي غامق */
    --secondary-color: #3498db; /* أزرق سماوي */
    --background-color: #f4f6f9; /* رمادي فاتح جداً */
    --text-color: #333;
    --card-bg: #ffffff;
    --footer-bg: #23282d;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* --- Base & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    direction: rtl;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
}

/* --- Header --- */
.main-header {
    background-color: var(--card-bg);
    padding: 1rem 0;
    box-shadow: var(--card-shadow);
    border-bottom: 4px solid var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.main-header .logo a {
    text-decoration: none;
    color: var(--primary-color);
}
.main-header .logo h1 {
    margin: 0;
    font-size: 1.8rem;
}
.main-header .logo p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
}
.main-header .contact-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: bold;
}
.main-header .contact-info span {
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.7)), url('https://images.unsplash.com/photo-1581092921461-e760b1648c28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwzNTc5fDB8MXxzZWFyY2h8N3x8Y29uc3RydWN0aW9ufGVufDB8fHx8MTYyNjQ0NzYwNA&ixlib=rb-1.2.1&q=80&w=1920') no-repeat center center/cover;
    color: white;
    padding: 5rem 0;
    text-align: center;
}
.hero-section h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero-section p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* --- Categories Section --- */
.categories-section {
    padding: 4rem 0;
}
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.category-card {
    display: block;
    position: relative;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-hover-shadow);
}
.category-card:hover .category-card-overlay {
    background-color: rgba(52, 152, 219, 0.5);
}
.category-card:hover .category-card-title {
    bottom: 25px;
}

.category-card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.category-card:hover .category-card-image {
    transform: scale(1.05);
}

.category-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%);
    transition: background-color 0.3s ease;
}

.category-card-title {
    position: absolute;
    bottom: 15px;
    right: 15px;
    left: 15px;
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: right;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    transition: bottom 0.3s ease;
}

.no-items-message {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    padding: 3rem;
    background-color: var(--card-bg);
    border-radius: 8px;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--footer-bg);
    color: #a7aaad;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}
.main-footer p {
    margin: 0.5rem 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
    }
    .hero-section h2 { font-size: 2rem; }
    .hero-section p { font-size: 1rem; }
    .section-title { font-size: 2rem; }
}






/* --- New Professional Styles for Products Page --- */

.products-page-section {
    padding: 4rem 0;
}

/* Redesigned Product Card */
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

.product-card-image {
    width: 100%;
    /* لتوحيد أبعاد الصور */
    aspect-ratio: 4 / 3; 
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-content {
    padding: 1.25rem;
    text-align: right;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-card-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.product-card-details-btn {
    display: inline-block;
    margin-top: auto; /* يدفع الزر لأسفل البطاقة */
    padding: 0.6rem 1.2rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.product-card:hover .product-card-details-btn {
    background-color: var(--primary-color);
}



/* --- New Styles for Single Product Page --- */
.single-product-container {
    display: grid;
    grid-template-columns: 1fr; /* عمود واحد على الشاشات الصغيرة */
    gap: 2rem;
    padding: 4rem 0;
}

/* عمودين على الشاشات الكبيرة */
@media (min-width: 768px) {
    .single-product-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

.product-gallery img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    background-color: #fff;
    padding: 1rem;
    border: 1px solid #eee;
}

.product-details .product-breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #777;
}
.product-details .product-breadcrumb a {
    color: var(--secondary-color);
}

.product-details .product-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-details .product-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.product-details .product-description {
    margin-bottom: 2rem;
}
.product-details .product-description h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}
.product-details .product-description p {
    line-height: 1.8;
    color: #555;
}

.product-contact-cta {
    background-color: #eaf5ff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--secondary-color);
}
.product-contact-cta h3 {
    margin-bottom: 0.5rem;
}
.product-contact-cta p {
    margin-bottom: 1rem;
}
.product-contact-cta .cta-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.product-contact-cta .cta-button:hover {
    background-color: var(--primary-color);
}