/*
 * Mobile Brands Before Title - Performance Optimized
 * Critical CSS for LCP optimization
 */

/* Container - Optimized for performance */
.mps-mobile-brands-before-title {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    max-width: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    /* Performance optimization */
    contain: layout style paint;
    content-visibility: auto;
}

/* Title - Simple and fast */
.mps-mobile-brands-title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #2c3e50;
    padding: 8px 0;
    border-bottom: 2px solid #3498db;
}

/* Grid - Optimized layout */
.mps-mobile-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

/* Brand Card - Simplified for speed */
.mps-mobile-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.mps-mobile-brand-card:hover {
    border-color: #3498db;
}

/* Logo - Critical for LCP */
.mps-mobile-brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 6px;
    border-radius: 6px;
    /* LCP optimization */
    display: block;
}

/* Brand Name */
.mps-mobile-brand-name {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    line-height: 1.2;
}

.mps-mobile-brand-card:hover .mps-mobile-brand-name {
    color: #3498db;
}

/* Button Container */
.mps-mobile-brands-buttons {
    display: block;
    margin-top: 10px;
}

/* Button - Accessibility Improved */
.mps-mobile-brands-btn {
    display: block;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
    /* تحسين التباين اللوني للوصولية */
    border: 2px solid transparent;
}

.mps-mobile-brands-btn:hover {
    background: #1e40af;
    box-shadow: 0 3px 12px rgba(30, 58, 138, 0.3);
    transform: translateY(-1px);
    color: #ffffff;
}

.mps-mobile-brands-btn:focus {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
    background: #1e40af;
    color: #ffffff;
}

.mps-mobile-brands-btn:active {
    background: #1e3a8a;
    transform: translateY(0);
    color: #ffffff;
}

/* Hide sidebar brands widget on mobile */
@media (max-width: 768px) {
    .mps-brands-widget,
    .widget.mps-brands-widget,
    #mps_brands_widget-2,
    .sidebar .mps-brands-widget,
    .widget-area .mps-brands-widget {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mps-mobile-brands-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .mps-mobile-brand-logo {
        width: 32px;
        height: 32px;
    }
    
    .mps-mobile-brand-name {
        font-size: 12px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .mps-mobile-brand-card,
    .mps-mobile-brands-btn {
        transition: none;
    }
}
