﻿@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #0f0f0f;
    --bg-navbar: rgba(15, 15, 15, 0.95);
    --gold: #d4af37;
    --gold-hover: #f1c40f;
    --text-light: #f5f5f5;
    --border-color: #333;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Cairo', sans-serif;
    color: var(--text-light);
}

/* === Navbar Style === */
.navbar-wrapper {
    background-color: var(--bg-navbar);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    transition: all 0.3s ease;
}

.text-gold, .gold-text {
    color: var(--gold);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-link {
    color: #ccc !important;
    transition: color 0.3s;
    font-weight: 500;
    margin: 0 8px;
}

    .nav-link:hover {
        color: var(--gold) !important;
    }

/* === Search Bar Animation === */
.search-form {
    position: relative;
}

.search-group {
    display: flex;
    align-items: center;
    background: #222;
    border-radius: 50px;
    padding: 5px 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

    .search-group:focus-within {
        border-color: var(--gold);
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
        width: 300px;
    }

.search-input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 180px;
    transition: width 0.4s ease;
}

    .search-input:focus {
        width: 240px;
    }

.search-btn {
    background: transparent;
    border: none;
    color: #888;
    transition: color 0.3s;
}

    .search-btn:hover {
        color: var(--gold);
    }

/* === User Icons & Cart === */
.btn-icon {
    background: #222;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

    .btn-icon:hover {
        background: var(--gold);
        color: black;
        border-color: var(--gold);
        transform: translateY(-2px);
    }

/* Badge (الرقم الأحمر) */
.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74a3b;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 5px rgba(231, 74, 59, 0.5);
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.animate-pop {
    animation: pop 0.5s ease;
}

/* ========================================= */
/* === Cart Sidebar Styles (التصميم الجديد) === */
/* ========================================= */

/* حاوية القائمة الجانبية */
.offcanvas {
    background-color: #111 !important;
    border-left: 1px solid var(--border-color);
    width: 380px; /* عرض أوسع قليلاً للراحة */
}

.offcanvas-body {
    background-color: #111;
    padding: 0;
}

/* منطقة قائمة المنتجات (Scrollable) */
.cart-items-list {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) #222;
}

    /* شكل السكرول بار */
    .cart-items-list::-webkit-scrollbar {
        width: 6px;
    }

    .cart-items-list::-webkit-scrollbar-thumb {
        background-color: var(--gold);
        border-radius: 10px;
    }

/* --- كارت المنتج داخل السلة --- */
.cart-item-card {
    display: flex;
    align-items: center;
    gap: 15px; /* مسافة واضحة بين الصورة والنص */
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    transition: background 0.3s;
    position: relative;
}

    .cart-item-card:hover {
        background-color: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

/* 1. الصورة (مربعة وثابتة) */
.cart-item-img {
    width: 70px;
    height: 70px;
    flex-shrink: 0; /* يمنع الصورة من الانكماش */
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000;
}

    .cart-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* يملأ المربع بالكامل */
    }

/* 2. النصوص */
.cart-item-info {
    flex-grow: 1;
    min-width: 0; /* مهم جداً لعمل ellipsis */
}

.cart-item-title {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* يضع ... للنص الطويل */
    font-weight: 600;
}

.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.qty-badge {
    background-color: #333;
    color: #ccc;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.price-text {
    color: var(--gold);
    font-weight: bold;
    font-size: 1rem;
}

/* 3. زر الحذف */
.cart-item-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    text-decoration: none;
}

    .cart-item-remove:hover {
        color: #ff4d4d;
        background: rgba(255, 77, 77, 0.1);
        transform: scale(1.1);
    }

/* الفوتر السفلي للسلة */
.cart-footer {
    background-color: #0a0a0a;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-gold {
    background-color: var(--gold);
    color: black;
    border: none;
    font-weight: bold;
    transition: 0.3s;
}

    .btn-gold:hover {
        background-color: white;
        color: black;
    }

.footer-section {
    background-color: #050505; /* أغمق من الخلفية قليلاً */
    border-top: 1px solid #222;
    padding: 70px 0 20px;
    margin-top: auto; /* يضمن بقاء الفوتر في الأسفل دائماً */
    position: relative;
    z-index: 10;
}

.footer-title {
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

    .footer-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40px;
        height: 2px;
        background-color: var(--gold);
    }

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

    .footer-links a:hover {
        color: var(--gold);
        transform: translateX(-5px); /* حركة خفيفة لليسار عند التحويم */
    }

/* أزرار السوشيال ميديا */
.social-btn {
    width: 40px;
    height: 40px;
    background-color: #222;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 10px;
    transition: all 0.3s ease;
    border: 1px solid #333;
    text-decoration: none;
}

    .social-btn:hover {
        background-color: var(--gold);
        color: #000;
        transform: translateY(-3px);
    }

/* معلومات التواصل */
.contact-info span {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* حقوق النشر */
.footer-bottom {
    border-color: #1a1a1a !important;
}

/* === Responsive === */
@media (max-width: 992px) {
    .search-input {
        width: 100%;
    }

    .search-group:focus-within {
        width: 100%;
    }

    .navbar-collapse {
        background: #111;
        padding: 20px;
        border-radius: 10px;
        margin-top: 10px;
    }

    .offcanvas {
        width: 85%;
    }
    /* على الموبايل تأخذ عرض أكبر */
}
