/* --- Global Variables & Reset --- */
:root {
    --primary-color: #00aaff;
    --secondary-color: #0077cc;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #f0f0f0;
    --text-color-light: #b0b0b0;
    --font-family: 'Cairo', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- Header & Navigation --- */
.header {
    background-color: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}

.nav-logo {
    text-decoration: none;
}

.nav-logo img {
    height: 50px;
    vertical-align: middle;
}

/* --- Search Bar Styles --- */
.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-light);
}

.search-container input {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border-radius: 50px;
    border: 1px solid #444;
    background-color: var(--surface-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    direction: ltr;
    text-align: right;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-cart {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
}

#cart-count {
    position: absolute;
    top: -10px;
    left: -12px;
    background-color: var(--primary-color);
    color: var(--background-color);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

/* أيقونات الهاتف (البحث والقائمة) مخفية افتراضياً على الحاسوب */
.hamburger, .mobile-search-icon {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('background.jpg') no-repeat center center/cover;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color-light);
}

/* --- Buttons --- */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

/* --- Sections --- */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* --- Products Grid --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 170, 255, 0.2);
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 20px;
}

/* --- About Section --- */
.about-section {
    background-color: var(--surface-color);
    text-align: center;
}

.about-section p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* --- Contact Form --- */
.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: var(--surface-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* --- Shopping Cart Modal --- */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.cart-modal-content {
    background-color: var(--surface-color);
    margin: 20px;
    padding: 30px;
    border: 1px solid #444;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close-cart {
    color: #aaa;
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-cart:hover,
.close-cart:focus {
    color: var(--text-color);
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    margin: 20px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #333;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-details h4 {
    margin: 0;
    font-size: 1.1rem;
}

.cart-item-details p {
    margin: 5px 0 0;
    color: var(--text-color-light);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.cart-item-remove:hover {
    color: #ff1a1a;
}

.cart-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid var(--primary-color);
    text-align: center;
}

.cart-total {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.cart-total span {
    color: var(--primary-color);
}

#checkout-btn {
    width: 100%;
}

.empty-cart-message {
    text-align: center;
    color: var(--text-color-light);
    padding: 40px 0;
}

/* --- Footer --- */
.footer {
    background-color: var(--surface-color);
    padding: 30px 20px;
    border-top: 1px solid #333;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-branding {
    display: flex;
    align-items: center;
    gap: 25px;
}

.footer-logo {
    height: 40px;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-left: 15px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.copyright-text {
    color: var(--text-color-light);
    font-size: 0.9rem;
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

/* شريط بحث الهاتف مخفي افتراضياً */
.mobile-search-container {
    display: none; /* Hidden by default */
    width: 100%;
    padding: 10px 20px;
    background-color: var(--surface-color);
    border-top: 1px solid #333;
}

.mobile-search-container input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 50px;
    border: 1px solid #444;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    direction: ltr;
    text-align: right;
}


/* --- Responsive Design (التعديلات الخاصة بالهاتف) --- */
@media (max-width: 768px) {
    .navbar {
        height: auto;
        padding: 10px 20px;
    }

    .nav-logo img {
        height: 40px;
    }

    /* إخفاء شريط بحث الحاسوب على الهاتف */
    .desktop-search {
        display: none;
    }

    .nav-actions {
        gap: 15px;
    }

    /* إظهار أيقونات الهاتف */
    .mobile-search-icon, .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        background-color: var(--surface-color);
        text-align: center;
        transition: 0.5s;
        padding-top: 80px;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin: 20px 0;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }

    .product-card {
        padding: 15px;
    }

    .product-card h3 {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}