/* الأساسيات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* الهيدر */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: #111;
    position: sticky;
    top: 0;
    z-index: 5000; /* تحت السلة مباشرة */
    border-bottom: 1px solid #333;
}

.logo img {
    height: 45px;
}

.nav-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.3s;
}

.nav-link i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    color: #00bcd4;
}

.nav-link:hover {
    color: #00bcd4;
}

/* شبكة المنتجات والكروت */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 30px 5%;
}

.card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    border: 1px solid #333;
    transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #00bcd4;
}

.card-img-container {
    background: #fff;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.card-img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease-in-out;
}

.card h3 {
    padding: 15px;
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

/* الأزرار */
.btn-main {
    display: inline-block;
    background: #00bcd4;
    color: #000;
    text-decoration: none;
    padding: 12px 25px;
    margin: 15px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-main:hover {
    background: #fff;
    transform: scale(1.05);
}

/* --- السلة الجانبية (الإصلاح الحرج) --- */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -350px; /* مخفية لليمين */
    width: 320px;
    height: 100vh;
    background: #111;
    z-index: 10000 !important; /* أعلى من كل شيء في الصفحة */
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 20px rgba(0,0,0,0.8);
}

.cart-drawer.active {
    right: 0; /* تظهر عند إضافة كلاس active بالجافا سكريبت */
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999; /* تحت السلة مباشرة وفوق المحتوى */
    display: none;
}

.cart-overlay.active {
    display: block;
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 18px;
}

/* المدخلات (Inputs) */
.input-field {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    border-radius: 8px;
    outline: none;
}

.input-field:focus {
    border-color: #00bcd4;
}

/* الفوتر القديم (تم إلغاؤه واستبداله بكروت التواصل) */
.fixed-footer {
    display: none !important;
}

/* الاستجابة للهواتف */
@media (max-width: 600px) {
    .cart-drawer {
        width: 100%; /* السلة تأخذ الشاشة كاملة في الموبايل */
        right: -100%;
    }
    .grid {
        padding: 15px;
        gap: 15px;
    }
}
