/* style.css - Стили для плагина Random Products Recommender */

/* Основной контейнер новости с товарами */
.product-news-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Заголовок статьи */
.product-news-article .entry-header {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 20px;
}

.product-news-article .entry-title {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.2;
}

/* Мета информация */
.product-news-article .entry-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.product-news-article .entry-meta span {
    margin-right: 15px;
}

.product-news-article .entry-meta a {
    color: #0073aa;
    text-decoration: none;
}

.product-news-article .entry-meta a:hover {
    text-decoration: underline;
}

/* Миниатюра поста */
.product-news-article .post-thumbnail {
    margin-bottom: 30px;
    text-align: center;
}

.product-news-article .post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Контент статьи */
.product-news-article .entry-content {
    line-height: 1.6;
    font-size: 16px;
    color: #333;
    margin-bottom: 40px;
}

.product-news-article .entry-content p {
    margin-bottom: 20px;
}

/* Секция рекомендуемых товаров */
.recommended-products-section {
    margin: 40px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #e1e1e1;
}

/* Контейнер случайных товаров */
.random-products-container {
    width: 100%;
}

.random-products-container h3 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.random-products-container h3:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #0073aa;
    margin: 10px auto 0;
}

/* Сетка товаров */
.random-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Отдельный товар */
.random-product-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    border: 1px solid #e1e1e1;
}

.random-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Изображение товара */
.random-product-item .product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.random-product-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.random-product-item:hover .product-image img {
    transform: scale(1.05);
}

.random-product-item .product-image a {
    display: block;
    height: 100%;
}

/* Информация о товаре */
.random-product-item .product-info {
    padding: 20px;
}

.random-product-item .product-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    line-height: 1.3;
}

.random-product-item .product-info h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.random-product-item .product-info h4 a:hover {
    color: #0073aa;
}

/* Цена товара */
.random-product-item .product-price {
    font-size: 1.3em;
    font-weight: bold;
    color: #2ea44f;
    margin-bottom: 10px;
}

.random-product-item .product-price del {
    color: #999;
    font-weight: normal;
    margin-right: 8px;
}

/* Описание товара */
.random-product-item .product-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* Действия с товаром */
.random-product-item .product-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.random-product-item .product-actions .button {
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    min-width: 80px;
}

.random-product-item .product-actions .button:first-child {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.random-product-item .product-actions .button:first-child:hover {
    background: #e9ecef;
    color: #212529;
}

.random-product-item .product-actions .add-to-cart {
    background: #0073aa;
    color: white;
    border: 1px solid #0073aa;
}

.random-product-item .product-actions .add-to-cart:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Подвал статьи */
.product-news-article .entry-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.product-news-article .tags-links {
    color: #666;
    font-size: 14px;
}

.product-news-article .tags-links a {
    color: #0073aa;
    text-decoration: none;
    margin-left: 5px;
}

.product-news-article .tags-links a:hover {
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    .product-news-article {
        padding: 15px;
    }
    
    .product-news-article .entry-title {
        font-size: 2em;
    }
    
    .random-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .recommended-products-section {
        padding: 20px;
        margin: 30px 0;
    }
    
    .random-product-item .product-actions {
        flex-direction: column;
    }
    
    .random-product-item .product-actions .button {
        width: 100%;
    }
    
    .product-news-article .entry-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .product-news-article .entry-title {
        font-size: 1.6em;
    }
    
    .random-products-container h3 {
        font-size: 1.4em;
    }
    
    .random-product-item .product-image {
        height: 180px;
    }
    
    .random-product-item .product-info {
        padding: 15px;
    }
}

/* Анимация загрузки */
.random-products-container.loading {
    position: relative;
}

.random-products-container.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Дополнительные стили для archive-product-news.php */
/* Добавьте этот код в файл style.css плагина */

/* Заголовок архива */
.archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.archive-header .page-title {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.archive-header .archive-description {
    color: #666;
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto;
}

/* Контейнер архива */
.product-news-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Сетка новостей */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Карточка новости */
.product-news-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e1e1e1;
    display: flex;
    flex-direction: column;
}

.product-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Миниатюра новости */
.product-news-card .news-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-news-card .news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-news-card:hover .news-thumbnail img {
    transform: scale(1.05);
}

.product-news-card .news-thumbnail a {
    display: block;
    height: 100%;
}

/* Контент новости */
.product-news-card .news-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Заголовок новости */
.product-news-card .news-header {
    margin-bottom: 15px;
}

.product-news-card .news-title {
    font-size: 1.3em;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.product-news-card .news-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-news-card .news-title a:hover {
    color: #0073aa;
}

/* Мета информация */
.product-news-card .news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.product-news-card .news-date {
    color: #888;
}

.product-news-card .news-author a {
    color: #0073aa;
    text-decoration: none;
}

.product-news-card .news-author a:hover {
    text-decoration: underline;
}

.product-news-card .products-count {
    background: #e8f4fd;
    color: #0073aa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Отрывок новости */
.product-news-card .news-excerpt {
    flex: 1;
    margin-bottom: 20px;
    color: #555;
    line-height: 1.6;
}

.product-news-card .news-excerpt p {
    margin: 0;
}

/* Подвал новости */
.product-news-card .news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: auto;
}

/* Кнопка "Читать далее" */
.product-news-card .read-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.product-news-card .read-more-btn:hover {
    background: #005a87;
    transform: translateX(2px);
}

/* Категории */
.product-news-card .news-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-news-card .category-tag {
    padding: 4px 10px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.product-news-card .category-tag:hover {
    background: #e9ecef;
    color: #212529;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    color: #333;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    color: #0073aa;
}

.pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    padding: 0 16px;
    font-weight: 600;
}

/* Страница "Ничего не найдено" */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.no-results .page-title {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
}

.no-results .page-content p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.no-results .button {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.no-results .button:hover {
    background: #005a87;
}

/* Адаптивность */
@media (max-width: 768px) {
    .archive-header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }
    
    .archive-header .page-title {
        font-size: 2em;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-news-card .news-content {
        padding: 20px;
    }
    
    .product-news-card .news-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-news-card .read-more-btn {
        text-align: center;
        justify-content: center;
    }
    
    .product-news-card .news-categories {
        justify-content: center;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination .page-numbers {
        min-width: 35px;
        height: 35px;
        padding: 0 8px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .archive-header .page-title {
        font-size: 1.6em;
    }
    
    .product-news-card .news-thumbnail {
        height: 180px;
    }
    
    .product-news-card .news-title {
        font-size: 1.2em;
    }
    
    .product-news-card .news-meta {
        gap: 10px;
    }
    
    .product-news-archive {
        padding: 0 15px;
    }
}

/* Анимация загрузки для архива */
.product-news-archive.loading {
    position: relative;
    min-height: 400px;
}

.product-news-archive.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Особые стили для карточек без изображений */
.product-news-card:not(.has-post-thumbnail) .news-content {
    padding-top: 30px;
}

/* Выделение активной категории */
.current-category .category-tag {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}