:root {
    --gold: #d4af37;
    --dark: #1a1a1a;
    --light: #f8f9fa;
    --shadow-soft: 0 5px 20px rgba(0,0,0,0.05);
    --shadow-gold: 0 10px 25px rgba(212, 175, 55, 0.15);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #fcfcfc;
    direction: rtl;
    text-align: right;
    color: #333;
    overflow-x: hidden; /* يمنع التمرير الجانبي المزعج */
}

/* Navbar */
.navbar {
    background-color: var(--dark) !important;
    padding: 10px 0;
}
.navbar-brand {
    color: var(--gold) !important;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
}
.nav-link {
    font-size: 0.95rem;
    color: #fff !important;
}

/* --- السلايدر المتجاوب (الذكي) --- */
.slider-container {
    margin-top: 20px;
    margin-bottom: 40px;
    border-radius: 15px; /* زوايا دائرية أنعم */
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 2px solid #fff;
    /* هذا هو السر: ارتفاع متغير حسب الجهاز */
}

.carousel-item {
    /* للحاسوب والشاشات الكبيرة */
    height: 400px; /* تم تقصيره من 500px */
}

.carousel-item img, .carousel-item video {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* --- بطاقات السلع (أكثر دقة) --- */
.product-card {
    background: #fff;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    height: 100%;
    position: relative;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
}

.img-wrapper {
    /* للحاسوب */
    height: 220px; /* تم تقصيره من 280px */
    overflow: hidden;
    position: relative;
    background-color: #f9f9f9;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* يملأ الإطار بذكاء */
    transition: transform 0.5s ease;
}

.product-card:hover .img-wrapper img {
    transform: scale(1.05); /* تكبير ناعم جداً */
}

.card-details {
    padding: 15px;
    text-align: center;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--dark);
    white-space: nowrap; /* يمنع نزول الاسم لسطرين */
    overflow: hidden;
    text-overflow: ellipsis; /* يضع نقاط (...) إذا كان الاسم طويلاً */
}

.price-tag {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 800;
    display: block;
    margin-bottom: 8px;
}

.btn-view {
    background-color: var(--dark);
    color: var(--gold);
    border-radius: 50px;
    padding: 5px 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: 0.3s;
    display: inline-block;
}
.btn-view:hover {
    background-color: var(--gold);
    color: var(--dark);
}

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 30px;
    font-weight: 800;
    color: var(--dark);
    font-size: 1.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--gold);
}

/* --- 📱 إعدادات الهاتف والشاشات الصغيرة (Media Queries) --- */
@media (max-width: 768px) {
    /* 1. تقصير السلايدر للهاتف */
    .carousel-item {
        height: 220px !important; /* ارتفاع مثالي للهاتف (ليس طويلاً) */
    }
    
    .slider-container {
        margin-top: 10px;
        margin-bottom: 25px;
        border-radius: 10px;
    }

    /* 2. تصغير البطاقات للهاتف */
    .img-wrapper {
        height: 160px; /* صورة أقصر للهاتف */
    }
    
    .card-details {
        padding: 10px; /* حواف أقل */
    }
    
    .card-title {
        font-size: 0.9rem; /* خط أصغر قليلاً */
    }
    
    .price-tag {
        font-size: 1rem;
    }
    
    .btn-view {
        padding: 4px 15px;
        font-size: 0.75rem;
        width: 100%; /* الزر يملأ العرض في الهاتف لسهولة الضغط */
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
}

/* Sidebar in Admin */
.sidebar {
    height: 100vh;
    background-color: var(--dark);
    color: white;
    padding-top: 20px;
}
.sidebar a {
    color: #ccc;
    text-decoration: none;
    display: block;
    padding: 15px;
    border-bottom: 1px solid #333;
}
.sidebar a:hover {
    background-color: var(--gold);
    color: var(--dark);
}

.admin-header {
    background: #fff;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* --- Responsive Sidebar (Mobile) --- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    margin-inline-end: 15px;
}

.sidebar-overlay {
    display: none;
}

.admin-lang-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    padding: 5px;
    display: flex;
    gap: 5px;
}

.lang-chip {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 900;
    border-radius: 50px;
    text-decoration: none;
    color: #999;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
    border: 2px solid transparent;
    letter-spacing: 1px;
}

.lang-chip:hover {
    background: #eee;
    color: #333;
}

.lang-chip.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .admin-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
    }
    .admin-lang-box {
        justify-content: center;
        width: fit-content;
        margin-inline-start: auto;
    }

    .mobile-menu-btn {
        display: inline-block;
    }

    .sidebar {
        display: block !important;
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 9999;
        background-color: #212529;
        transition: all 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        overflow-y: auto;
    }

    html[dir="rtl"] .sidebar {
        left: auto;
        right: -280px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }

    .sidebar.active {
        left: 0;
    }

    html[dir="rtl"] .sidebar.active {
        left: auto;
        right: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

.admin-lang-switcher {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
}

.admin-lang-btn {
    display: inline-block;
    min-width: 44px;
    text-align: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
    color: #fff;
    opacity: 0.75;
    transition: 0.2s;
}

.admin-lang-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-lang-btn.active {
    background-color: var(--gold);
    color: var(--dark);
    opacity: 1;
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.25);
}

@media (max-width: 768px) {
    .admin-lang-switcher {
        top: 10px;
        left: 10px;
        padding: 5px;
    }
    .admin-lang-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* Buttons */
.btn-taaral {
    background-color: var(--gold);
    color: var(--dark);
    font-weight: bold;
    border: none;
}
.btn-taaral:hover {
    background-color: #b39020;
    color: white;
}

.hover-bg:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* --- زر تشغيل الفيديو في الوسط --- */
.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.6); /* خلفية سوداء شفافة */
    border: 2px solid var(--gold); /* إطار ذهبي */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.play-overlay:hover {
    background-color: var(--gold); /* يتحول للذهبي عند اللمس */
    transform: translate(-50%, -50%) scale(1.1); /* يكبر قليلاً */
}

/* رسم المثلث (رمز التشغيل) بالكود فقط */
.play-icon-shape {
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #fff; /* لون المثلث أبيض */
    margin-right: -5px; /* تصحيح التمركز */
}

/* إخفاء الزر عندما يعمل الفيديو */
.video-active .play-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- صفحة تفاصيل المنتج الاحترافية --- */
.product-detail-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.05);
}

.detail-img-container {
    background-color: #f8f9fa;
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.detail-img-container img {
    max-height: 500px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.detail-content {
    padding: 30px;
    text-align: center;
}

.detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}

.detail-price {
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 20px;
    display: block;
}

.detail-desc {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.detail-phone {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 25px;
    display: inline-block;
    background: #f0f0f0;
    padding: 10px 25px;
    border-radius: 50px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 200px;
}

/* --- القائمة الجانبية (Suggested) --- */
.sidebar-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s;
    border: 1px solid #f0f0f0;
    text-decoration: none;
}
.sidebar-item:hover {
    transform: translateX(-5px);
    background-color: #fffbf0;
}
.sidebar-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    margin-left: 15px;
}
.sidebar-info h6 {
    font-weight: bold;
    color: var(--dark);
    margin: 0;
    font-size: 0.95rem;
}
.sidebar-info span {
    color: var(--gold);
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- استجابة الهاتف (Mobile) --- */
@media (max-width: 768px) {
    .detail-img-container img {
        max-height: 350px;
    }
    .detail-title { font-size: 1.5rem; }
    .detail-price { font-size: 1.4rem; }
    .btn-action { width: 100%; }
}

/* --- تصميم الفوتر الاحترافي (Taaral Footer) --- */
.taaral-footer {
    background-color: var(--dark);
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
    border-top: 4px solid var(--gold);
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.footer-desc {
    font-size: 0.95rem;
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 300px;
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}
.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: var(--gold);
}

.footer-links {
    list-style: none;
    padding: 0;
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.95rem;
}
.footer-links a:hover {
    color: var(--gold);
    padding-right: 5px;
}

/* --- أيقونات التواصل الاجتماعي --- */
.social-icons {
    display: flex;
    gap: 15px;
}
.social-icon-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}
.social-icon-btn:hover {
    background-color: var(--gold);
    color: var(--dark);
    transform: translateY(-3px);
}

/* --- القسم السفلي (الحقوق) --- */
.footer-bottom {
    background-color: #111;
    padding: 15px 0;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: #888;
}

/* --- التجاوب للهاتف --- */
@media (max-width: 768px) {
    .taaral-footer {
        text-align: center;
    }
    .footer-heading::after {
        right: 50%;
        transform: translateX(50%);
    }
    .footer-desc {
        margin: 0 auto 20px;
    }
    .social-icons {
        justify-content: center;
    }
}

 /* --- تصميم الشريط الجانبي للسلع المقترحة --- */
 .sidebar-related-card {
     background: #fff;
     padding: 15px;
     border-radius: 15px;
     box-shadow: 0 5px 15px rgba(0,0,0,0.05);
     border: 1px solid #f0f0f0;
 }
 
 .related-item {
     display: flex;
     align-items: center;
     text-decoration: none;
     background: #fdfdfd;
     border: 1px solid #eee;
     padding: 10px;
     border-radius: 12px;
     transition: all 0.3s ease;
 }
 
 .related-item:hover {
     transform: translateX(-5px); /* حركة بسيطة عند اللمس */
     background: #fffbf0; /* خلفية ذهبية فاتحة جداً */
     border-color: var(--gold);
 }
 
 .related-thumb {
     width: 80px;
     height: 80px;
     border-radius: 10px;
     object-fit: cover;
     flex-shrink: 0; /* منع الصورة من الانكماش */
     border: 2px solid #fff;
     box-shadow: 0 2px 5px rgba(0,0,0,0.1);
 }
 
 .related-info {
     flex-grow: 1; /* يأخذ باقي المساحة */
     padding-right: 15px; /* مسافة بين الصورة والنص في RTL */
 }
 
 .related-title {
     font-weight: 700;
     color: var(--dark);
     font-size: 1rem;
     margin-bottom: 5px;
     display: block;
     /* قص النص الطويل */
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     max-width: 180px;
 }
 
 .related-price {
     font-weight: 800;
     color: var(--gold);
     font-size: 1.1rem;
 }
