/*--------------------------------------------------------------
# Unified Widgets Style (Latest Phones, Most Visited, Brands)
# Colors: #fbc02d (Gold), #2d3436 (Dark Gray)
--------------------------------------------------------------*/

/*==============================================================
   1. Shared Container & Title Styles
==============================================================*/

/* ── الحاوية الموحدة للودجتات ── */
.widget.mps-latest-phones-widget,
.widget.mps-most-visited-widget,
.widget.mps-professional-brands-widget,
.widget.mps-auto-widget {
    background: #fff;
    border-radius: 8px;
    /* تقليل نصف القطر ليكون أكثر حدة */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid #eee;
    /* إزالة transition لعدم وجود تغيير في الحالة */
}

/* إزالة تأثيرات التحويم تماماً عن الحاوية */
.widget.mps-latest-phones-widget:hover,
.widget.mps-most-visited-widget:hover,
.widget.mps-professional-brands-widget:hover,
.widget.mps-auto-widget:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* نفس الظل الثابت */
    transform: none;
    /* إلغاء الحركة */
}

/* ── عنوان الودجت الموحد ── */
.widget .widget-title,
.widget h4.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3436;
    /* اللون الأسود المخصص */
    margin: 0 0 20px;
    padding-bottom: 12px;
    position: relative;
    border-bottom: 2px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* خط تزييني صغير تحت العنوان - باللون الذهبي */
.widget .widget-title::after,
.widget h4.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 50px;
    height: 2px;
    background: #fbc02d;
    /* اللون الذهبي المخصص */
}

/*==============================================================
   2. Phone Lists (Latest & Most Visited)
==============================================================*/

.mps-latest-phones-list,
.mps-most-visited-phones {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── عنصر الهاتف الموحد ── */
.mps-latest-phone-item,
.mps-sidebar-phone-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.mps-latest-phone-item:last-child,
.mps-sidebar-phone-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mps-latest-phone-item:first-child,
.mps-sidebar-phone-item:first-child {
    padding-top: 0;
}

/* إزالة تأثيرات الخلفية أو الحركة عند التحويم */
.mps-latest-phone-item:hover,
.mps-sidebar-phone-item:hover {
    background: transparent;
}

/* ── الصورة المصغرة الموحدة ── */
.mps-latest-phone-thumb,
.mps-sidebar-phone-thumb {
    flex-shrink: 0;
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    /* زوايا أقل حدة */
    overflow: hidden;
    background: #f9f9f9;
    border: 1px solid #eee;
    position: relative;
}

.mps-latest-phone-thumb img,
.mps-sidebar-phone-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── معلومات الهاتف ── */
.mps-latest-phone-info,
.mps-sidebar-phone-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mps-latest-phone-title,
.mps-sidebar-phone-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3436;
    /* اللون الأسود */
    text-decoration: none;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.mps-latest-phone-title:hover,
.mps-sidebar-phone-title:hover {
    color: #fbc02d;
    /* اللون الذهبي عند التحويم على النص فقط */
}

.mps-latest-phone-date,
.mps-sidebar-phone-spec {
    font-size: 0.75rem;
    color: #888;
}

/* ── أرقام الترتيب (للأكثر زيارة) ── */

/* النمط الافتراضي للرقم في عرض القائمة (داخل mps-sidebar-phone-info) */
.mps-sidebar-phone-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fbc02d;
    color: #2d3436;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* النمط عند عرض الشبكة (داخل mps-sidebar-phone-thumb) - يظهر فوق الصورة */
.mps-sidebar-phone-thumb .mps-sidebar-phone-number {
    position: absolute;
    top: 0;
    right: 0;
    border-radius: 0;
    border-bottom-left-radius: 4px;
    padding: 0;
    width: 20px;
    z-index: 2;
}


/*==============================================================
   3. Professional Brands Styles (Integrated)
==============================================================*/

/* الحاوية الداخلية للماركات */
.mps-pro-brands-container {
    padding: 0;
}

/* شبكة الماركات */
.mps-pro-brands-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
}

/* دعم الأعمدة الديناميكية */
.mps-pro-brands-container[data-columns="1"] .mps-pro-brands-grid {
    grid-template-columns: 1fr;
}

.mps-pro-brands-container[data-columns="2"] .mps-pro-brands-grid {
    grid-template-columns: repeat(2, 1fr);
}

.mps-pro-brands-container[data-columns="3"] .mps-pro-brands-grid {
    grid-template-columns: repeat(3, 1fr);
}

.mps-pro-brands-container[data-columns="4"] .mps-pro-brands-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* بطاقة الماركة */
.mps-pro-brand-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease;
}

/* تغيير لون الحدود فقط عند التحويم */
.mps-pro-brand-item:hover {
    background: #fff;
    border-color: #fbc02d;
    /* الحدود باللون الذهبي */
    box-shadow: none;
}

/* شعار الماركة */
.mps-pro-brand-logo {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid #f0f0f0;
}

.mps-pro-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* اسم الماركة */
.mps-pro-brand-info {
    flex: 1;
    min-width: 0;
}

.mps-pro-brand-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mps-pro-brand-count {
    font-size: 0.75rem;
    color: #999;
    display: block;
}

/* إخفاء الشعارات */
.mps-pro-brands-container.hide-logos .mps-pro-brand-logo {
    display: none !important;
}

.mps-pro-brands-container.hide-logos .mps-pro-brand-item {
    justify-content: center;
    text-align: center;
}

.mps-pro-brands-container.hide-logos .mps-pro-brand-info {
    text-align: center;
}

/*==============================================================
   4. Buttons & Actions (Unified)
==============================================================*/

.mps-latest-phones-more,
.mps-pro-brands-actions {
    margin-top: 15px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.mps-latest-phones-more-link,
.mps-more-phones,
.mps-pro-show-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    background: transparent;
    color: #2d3436;
    /* النص باللون الأسود */
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #eee;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mps-latest-phones-more-link:hover,
.mps-more-phones:hover,
.mps-pro-show-more-btn:hover {
    background: #fbc02d;
    /* الخلفية ذهبية */
    color: #2d3436;
    /* النص يبقى أسود */
    border-color: #fbc02d;
}


/*==============================================================
   5. Responsive Styles
==============================================================*/

@media (max-width: 768px) {

    .widget.mps-latest-phones-widget,
    .widget.mps-most-visited-widget,
    .widget.mps-professional-brands-widget {
        padding: 15px;
        margin-bottom: 20px;
    }

    .mps-pro-brands-grid,
    .mps-pro-brands-container[data-columns="3"] .mps-pro-brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}