/* 
 * ملف CSS للتجاوب مع مختلف أحجام الشاشات
 */

/* تنسيقات عامة لجميع الشاشات */
body {
    overflow-x: hidden; /* منع التمرير الأفقي لحل مشكلة تجاوز الحدود */
    position: relative;
    width: 100%;
}

.container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

/* للشاشات المتوسطة */
@media (max-width: 991px) {
    .product-info-wrapper {
        margin-top: 20px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .main-image {
        height: 350px;
    }
    
    /* تحسين عرض الفوتر */
    footer .container {
        padding: 0 15px;
    }
    
    footer .row {
        margin-left: -15px;
        margin-right: -15px;
    }
}

/* للشاشات الصغيرة والهواتف */
@media (max-width: 767px) {
    /* تعديلات عامة للصفحات */
    .container {
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden;
    }
    
    /* إصلاح مشكلة تجاوز الحدود على الهواتف */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* تنسيق صفحة المنتج */
    .product-details-page {
        padding: 15px 0;
    }
    
    .product-title {
        font-size: 1.3rem;
        line-height: 1.4;
    }
    
    .main-image {
        height: 300px;
        padding: 10px;
    }
    
    .product-thumbnails {
        grid-template-columns: repeat(5, 1fr);
        max-width: 100%;
    }
    
    .thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .product-price-block .current-price {
        font-size: 1.4rem;
    }
    
    .product-price-block .old-price {
        font-size: 1rem;
    }
    
    .product-quantity-block {
        flex-wrap: wrap;
    }
    
    /* تنسيق التبويبات */
    .product-description-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    /* تنسيق المنتجات ذات الصلة */
    .related-products {
        margin-top: 20px;
    }
    
    .related-product-card {
        margin-bottom: 15px;
    }
    
    /* تنسيق القسم السفلي (الفوتر) */
    footer .row > div {
        margin-bottom: 20px;
    }
    
    footer {
        text-align: right;
        padding: 20px 0;
        margin-top: 20px;
        width: 100%;
        overflow: hidden;
    }
    
    /* منع التصاق محتوى الفوتر */
    .footer-links, .footer-contact {
        margin-bottom: 20px;
    }
    
    /* تحسين عرض معلومات الاتصال */
    .contact-info {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .contact-info p {
        margin-bottom: 5px;
    }
    
    /* تحسين عرض روابط الفوتر */
    .footer-links h4, .footer-contact h4 {
        margin-bottom: 15px;
        font-size: 16px;
    }
    
    .footer-links ul {
        padding-right: 0;
        list-style: none;
    }
    
    .footer-links ul li a {
        color: #666;
        text-decoration: none;
        transition: color 0.3s;
        display: block;
        padding: 5px 0;
    }
    
    /* تنسيق العنوان الرئيسي للفوتر */
    footer h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    /* تنسيق أيقونات التواصل */
    .contact-info i {
        width: 20px;
        text-align: center;
        margin-left: 8px;
        color: var(--primary-color);
    }
    
    /* تنسيق روابط الاتصال */
    .contact-info a {
        color: #666;
        text-decoration: none;
    }
    
    /* تنسيق كلاس حقوق النشر */
    .copyright {
        text-align: center;
        padding-top: 15px;
        border-top: 1px solid #eee;
        margin-top: 15px;
        color: #666;
        font-size: 14px;
    }
}

/* للهواتف الصغيرة جداً */
@media (max-width: 575px) {
    /* تنسيق صفحة المنتج للهواتف الصغيرة جداً */
    .product-title {
        font-size: 1.1rem;
    }
    
    .main-image {
        height: 250px;
    }
    
    .product-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* تقليص حجم الأزرار */
    .btn-add-cart, .btn-buy-now {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    /* تنسيق بطاقات المنتجات لضمان عرض الأسعار في الجانب الأيمن */
    .product-card .product-price {
        display: flex;
        justify-content: flex-end; /* السعر في الجانب الأيمن */
        flex-wrap: wrap;
        width: 100%;
        margin-top: 5px;
    }
    
    .product-card .price-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* محاذاة لليمين */
    }
    
    .product-card .current-price,
    .related-product-card .current-price {
        color: #000; /* لون السعر أسود حسب المتطلبات */
        font-size: 14px;
        direction: ltr; /* لضمان أن رمز الريال يكون قبل السعر */
        display: inline-flex;
        align-items: center;
    }
    
    /* تنسيق بطاقات المنتجات ذات الصلة */
    .related-product-card .product-price {
        justify-content: flex-end; /* السعر في الجانب الأيمن */
        direction: rtl;
    }
    
    /* ضبط عرض الخصم على الشاشات الصغيرة */
    .discount-tag {
        font-size: 0.8rem;
        padding: 1px 6px;
    }
    
    /* تنسيق الفوتر للهواتف الصغيرة جداً */
    footer {
        text-align: right; /* المحافظة على محاذاة النص لليمين كما هو مناسب للغة العربية */
    }
    
    /* جعل روابط الفوتر أوضح */
    .footer-links ul li {
        margin-bottom: 10px;
    }
    
    /* تحسين عرض الشعار والحقوق في الفوتر */
    .footer-logo {
        text-align: right;
        margin-bottom: 15px;
    }
    
    .copyright {
        text-align: center;
        margin-bottom: 15px;
    }
    
    /* تحسين مظهر معلومات الاتصال */
    .footer-contact h4 {
        margin-bottom: 15px;
    }
    
    /* تحسين عرض الأرقام والإيميل */
    .contact-info a {
        display: block;
        margin-bottom: 8px;
        text-align: right;
    }
}
