/* ===== إصلاح مشاكل صفحة المنتج المفرد ===== */

/* إصلاح z-index للأزرار والصور في hero section */
.product-hero .flex.flex-wrap.gap-4.pt-6 {
    position: relative;
    z-index: 20 !important;
}

.product-hero .flex.flex-wrap.gap-4.pt-6 button {
    position: relative;
    z-index: 21 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* إصلاح تفاعل الصور المصغرة */
.gallery-thumbnails {
    position: relative;
    z-index: 15 !important;
}

.thumbnail-image {
    position: relative;
    z-index: 16 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.thumbnail-image:hover {
    transform: scale(1.1) !important;
    border-color: #DC2626 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

/* إصلاح الصورة الرئيسية */
#main-product-image {
    position: relative;
    z-index: 10 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    transition: transform 0.3s ease !important;
}

#main-product-image:hover {
    transform: scale(1.02) !important;
}

/* إصلاح تفاعل العناصر المتداخلة */
.bg-white.rounded-2xl.p-8.shadow-2xl {
    position: relative;
    z-index: 5 !important;
}

.absolute.top-4.right-4 {
    z-index: 25 !important;
}

.floating-shapes {
    z-index: 1 !important;
}

.floating-shapes .shape {
    z-index: 2 !important;
    pointer-events: none !important;
}

/* ===== تحسين أزرار العمل ===== */
.btn-primary, 
.btn-secondary, 
.btn-tertiary {
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: all 0.3s ease !important;
    border: none !important;
    outline: none !important;
}

.btn-primary {
    background-color: #DC2626 !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #B91C1C !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3) !important;
}

.btn-secondary {
    background-color: #374151 !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #1F2937 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(55, 65, 81, 0.3) !important;
}

.btn-tertiary {
    background-color: #F3F4F6 !important;
    color: #374151 !important;
    border: 1px solid #D1D5DB !important;
}

.btn-tertiary:hover {
    background-color: #E5E7EB !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* ===== تحسين التخطيط العام ===== */
.product-hero {
    position: relative;
    overflow: visible !important;
}

.container.mx-auto.px-4 {
    position: relative;
    z-index: 10;
}

/* إصلاح مشاكل الخلفية المتحركة */
.product-hero .absolute.inset-0.opacity-10 {
    z-index: 1 !important;
    pointer-events: none !important;
}

/* ===== تحسين التفاعل للجوال ===== */
@media (max-width: 768px) {
    .product-hero .flex.flex-wrap.gap-4.pt-6 {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .product-hero .flex.flex-wrap.gap-4.pt-6 button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .gallery-thumbnails .flex.flex-wrap.gap-2 {
        justify-content: center !important;
    }
    
    .thumbnail-image {
        width: 3rem !important;
        height: 3rem !important;
    }
}

/* ===== إصلاح مشاكل التداخل ===== */
.main-image-container {
    position: relative;
    z-index: 10 !important;
}

.main-image-container .absolute {
    z-index: 15 !important;
}

/* منع التداخل بين العناصر */
.grid.grid-cols-1.lg\\:grid-cols-2.gap-12.items-center > div {
    position: relative;
    z-index: 5;
}

/* ===== تحسين الإضاءة والتأثيرات ===== */
.product-hero .bg-white.rounded-2xl.p-8.shadow-2xl:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-5px) !important;
    transition: all 0.3s ease !important;
}

/* إضافة تأثير للبيانات المهمة */
.breadcrumb a:hover {
    color: #DC2626 !important;
    transition: color 0.3s ease !important;
}

/* ===== تحسين التبويبات ===== */
.tabs-container {
    position: relative;
    z-index: 5;
}

.tab-btn {
    position: relative;
    z-index: 6;
    pointer-events: auto !important;
    cursor: pointer !important;
    padding: 0.75rem 1.5rem !important;
    margin-right: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    background-color: #F9FAFB !important;
    color: #374151 !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}

.tab-btn:hover {
    background-color: #F3F4F6 !important;
    border-color: #D1D5DB !important;
}

.tab-btn.active {
    background-color: #DC2626 !important;
    color: white !important;
    border-color: #DC2626 !important;
}

/* ===== إصلاح مشاكل التمرير ===== */
.product-single-page {
    position: relative;
    z-index: 1;
}

/* منع تداخل العناصر الثابتة */
.sticky, .fixed {
    z-index: 100 !important;
}

/* ===== تحسين عرض البيانات ===== */
.product-quick-overview {
    background-color: #F9FAFB;
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #E5E7EB;
}

.product-quick-overview h2 {
    color: #1F2937;
    border-bottom: 2px solid #DC2626;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ===== إصلاح مشاكل أخرى ===== */

/* ضمان أن العناصر التفاعلية واضحة */
button, a, input, [onclick], [data-tab] {
    position: relative !important;
    z-index: auto !important;
}

/* إصلاح مشاكل التمرير الأفقي */
.overflow-x-auto {
    scrollbar-width: thin;
    scrollbar-color: #DC2626 #F3F4F6;
}

.overflow-x-auto::-webkit-scrollbar {
    height: 6px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #DC2626;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

/* تحسين مظهر شارات المنتج */
.absolute.top-4.right-4.flex.flex-col.gap-2 span {
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== إضافات خاصة للتوافق ===== */

/* ضمان عمل السكريبت */
[data-product] {
    cursor: pointer !important;
}

/* ضمان وضوح النصوص */
.product-hero h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-hero p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
