/* ============================================
   ОБЩИЕ СТИЛИ ПРОЕКТА
   Файл подключается ко всем страницам сайта
   ============================================ */

/* --- Базовые настройки --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f5f5f5;
}

.main-content {
    padding: 20px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2rem;
}

/* --- Шапка сайта --- */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-links a {
    color: #fff;
    margin-left: 15px;
    text-decoration: none;
}

/* --- Строка поиска --- */
.search-container {
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-container input {
    border: 1px solid #ccc;
    padding: 8px;
    width: 300px;
}

.search-container button {
    background-color: #27ae60;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
}

/* --- Сетка товаров (главная страница и категории) --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-card a {
	font-size: 0.8rem;
}

.link_to_shop {
	color: black;
    margin: 5px;
    text-decoration: none;
}
.product-image {
    width: 200px;
    height: 200px;
    background-color: #eee;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;      /* заполняет блок целиком, обрезая лишнее */
    border-radius: 4px;
}

.image-cat {
	max-width: 100%;
    height: auto;
}

.product-title {
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #333;
}

.product-price {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

/* --- Кнопка "Подробнее" (карточки на странице категории) --- */
.btn-details {
    display: inline-block;
    background-color: #27ae60;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.btn-details:hover {
    background-color: #219150;
}

/* --- Описание категории (текстовый блок над товарами) --- */
.category-description {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    line-height: 1.6;
    color: #555;
}

.category-description p {
    margin-bottom: 15px;
}

.category-description p:last-child {
    margin-bottom: 0;
}

/* --- Подвал --- */
footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    margin-top: 20px;
}

/* ============================================
   СТИЛИ СТРАНИЦЫ КАРТОЧКИ ТОВАРА (tovar.html)
   ============================================ */

/* Название товара над верхним блоком */
.product-name {
    font-size: 1.4rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Верхний блок: картинка слева, информация справа */
.product-view {
    display: flex;
    gap: 30px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.product-view-image {
    flex: 0 0 40%;
    max-width: 40%;
}

.product-image-big {
    width: 100%;
    height: 320px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border-radius: 4px;
}

.product-view-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name-small {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Цены: старая зачёркнутая, новая акцентная */
.price-block {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 15px;
}

.price-old {
    color: #999;
    text-decoration: line-through;
    font-size: 1rem;
}

.price-new {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.4rem;
}

/* Список параметров (количество, материал, производитель) */
.product-params {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    line-height: 1.8;
}

.product-params span {
    font-weight: bold;
}

/* Большая кнопка "КУПИТЬ" */
.btn-buy {
    align-self: flex-start;
    background-color: #27ae60;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-buy:hover {
    background-color: #219150;
}

/* Иконки «Поделиться» */
.share-icons {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

.share {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    color: #fff;
    border-radius: 4px;
    font-size: 0.7rem;
    text-decoration: none;
}

.share-vk { background-color: #4c75a3; }
.share-fb { background-color: #3b5998; }
.share-ok { background-color: #ee8208; }
.share-tw { background-color: #1da1f2; }
.share-tg { background-color: #2ca5e0; }

/* --- Табы (Описание / Отзывы / Доставка / Характеристики) --- */
.product-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #2c3e50;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #2c3e50;
    background-color: #e8e8e8;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 0.95rem;
}

.tab:hover {
    background-color: #dcdcdc;
}

.tab.active {
    background-color: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.tab-content {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 40px;
    line-height: 1.6;
    color: #555;
}

/* --- Таблица характеристик --- */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.specs-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    vertical-align: top;
}

.specs-table td:nth-child(odd) {
    background-color: #f2f6f8;
    font-weight: bold;
    color: #2c3e50;
    width: 18%;
}

/* --- Заголовок "Похожие товары" --- */
.related-title {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* --- Кнопка "КУПИТЬ" в карточках похожих товаров --- */
.btn-buy-small {
    display: inline-block;
    background-color: #27ae60;
    color: #fff;
    padding: 6px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    transition: background-color 0.3s ease;
}

.btn-buy-small:hover {
    background-color: #219150;
}

/* --- Адаптивность карточки товара --- */
@media (max-width: 768px) {
    .product-view {
        flex-direction: column;
    }

    .product-view-image {
        flex: none;
        max-width: 100%;
    }
}
