/* Стили для фронтенда */

/* Карточка бренда на странице товара */
.product-brand-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

.product-brand-info .brand-logo img {
    max-width: 80px;
    height: auto;
}

.product-brand-info .brand-details {
    flex: 1;
}

.brand-label {
    color: #6c757d;
    margin-right: 5px;
}

.brand-link {
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
    font-size: 18px;
}

.brand-link:hover {
    text-decoration: underline;
}

.brand-certified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 15px;
    color: #28a745;
    font-size: 14px;
}

.brand-certified .dashicons {
    font-size: 18px;
}

/* Вкладка бренда на странице товара */
.brand-tab-content {
    padding: 20px 0;
}

.brand-tab-content .brand-logo {
    text-align: center;
    margin-bottom: 20px;
}

.brand-tab-content .brand-logo img {
    max-width: 200px;
    height: auto;
}

.brand-tab-content .brand-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.brand-tab-content .brand-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.brand-tab-content .brand-meta p {
    margin: 5px 0;
}

/* Сертификаты */
.brand-certificates {
    margin: 30px 0;
}

.certificates-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.certificates-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.certificates-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.certificates-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.certificates-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.certificate-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

.certificate-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.certificate-preview {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.certificate-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    transition: background 0.3s;
}

.certificate-file:hover {
    background: #e9ecef;
}

.certificate-file .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
}

.certificate-info {
    padding: 15px;
}

.certificate-name {
    font-size: 16px;
    margin: 0 0 10px;
    color: #333;
}

.certificate-download {
    display: inline-block;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.certificate-download:hover {
    background: #0056b3;
}

/* Список брендов */
.uaz-brands-list {
    margin: 40px 0;
}

.brands-grid {
    display: grid;
    gap: 30px;
}

.uaz-brands-list.columns-2 .brands-grid {
    grid-template-columns: repeat(2, 1fr);
}

.uaz-brands-list.columns-3 .brands-grid {
    grid-template-columns: repeat(3, 1fr);
}

.uaz-brands-list.columns-4 .brands-grid {
    grid-template-columns: repeat(4, 1fr);
}

.uaz-brands-list.columns-5 .brands-grid {
    grid-template-columns: repeat(5, 1fr);
}

.uaz-brands-list.columns-6 .brands-grid {
    grid-template-columns: repeat(6, 1fr);
}

.brand-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.brand-card:hover {
    border-color: #007bff;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.brand-card.has-certificates::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.brand-card .brand-link {
    text-decoration: none;
    color: inherit;
}

.brand-card .brand-logo {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.brand-card .brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-card .brand-logo.no-logo {
    background: #f8f9fa;
    border-radius: 8px;
}

.brand-initial {
    font-size: 48px;
    font-weight: bold;
    color: #6c757d;
}

.brand-card .brand-name {
    font-size: 18px;
    margin: 10px 0;
    color: #333;
}

.brand-card .products-count {
    color: #6c757d;
    font-size: 14px;
}

.certificate-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 5px 12px;
    background: #d4edda;
    color: #155724;
    border-radius: 20px;
    font-size: 13px;
}

.certificate-badge .dashicons {
    font-size: 16px;
}

/* Виджеты */
.uaz-brands-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.uaz-brands-widget-list .brand-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.uaz-brands-widget-list .brand-item:last-child {
    border-bottom: none;
}

.uaz-brands-widget-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.uaz-brands-widget-list a:hover {
    color: #007bff;
}

.uaz-brands-widget-list img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.uaz-brands-widget-list .brand-name {
    flex: 1;
}

.uaz-brands-widget-list .products-count {
    color: #6c757d;
    font-size: 12px;
}

.uaz-brands-widget-list .certified-badge {
    background: #28a745;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Виджет сертифицированных брендов */
.certified-brands-widget {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.certified-brand-item {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.certified-brand-item:hover {
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.certified-brand-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #333;
}

.certified-brand-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.certified-brand-item .brand-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
}

.certified-brand-item .certificates-count {
    color: #6c757d;
    font-size: 13px;
}

.certified-brand-item .certified-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Страница одиночного бренда */
.uaz-brand-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.brand-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.brand-header .brand-logo {
    flex-shrink: 0;
}

.brand-header .brand-logo img {
    max-width: 300px;
    height: auto;
}

.brand-header .brand-info {
    flex: 1;
}

.brand-title {
    font-size: 36px;
    margin: 0 0 10px;
    color: #333;
}

.brand-full-name {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 20px;
}

.brand-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.brand-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6c757d;
}

.brand-meta a {
    color: #007bff;
    text-decoration: none;
}

.brand-meta a:hover {
    text-decoration: underline;
}

.brand-products-count {
    font-size: 18px;
    color: #333;
}

.brand-description {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 40px;
}

.brand-products-section {
    margin-top: 40px;
}

/* Пагинация */
.brands-pagination {
    margin-top: 40px;
    text-align: center;
}

.brands-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #007bff;
    transition: all 0.3s;
}

.brands-pagination .page-numbers:hover,
.brands-pagination .page-numbers.current {
    background: #007bff;
    color: white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .certificates-grid.columns-3,
    .certificates-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .uaz-brands-list .brands-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .brand-header {
        flex-direction: column;
        text-align: center;
    }
    
    .brand-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .certificates-grid,
    .uaz-brands-list .brands-grid {
        grid-template-columns: 1fr !important;
    }
    
    .product-brand-info {
        flex-direction: column;
        text-align: center;
    }
}
