/* styles.css */

/* Общие стили */
* {
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {    
    margin: 0;
    padding: 0;
    background-color: #f9f9f9; /* Светлый фон */
    color: #333;
    display: flex;
}

h1 {
    text-align: center;
    margin: 20px 0;
    font-size: 2rem;
    color: #444;
    letter-spacing: 1px;
}

h2 {
    color: #555;
    margin: 20px 0;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 1px;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background-color: #28a745; /* Зеленый акцент */
    margin: 10px auto 0;
}

h3 {
    font-size: 1.1rem;
    color: #555;
    text-align: center;
}

a { 
   color: #28a745;
   text-decoration: none;
}

a:hover {
    color: #218838;
    text-decoration: underline;    
}

.green {
    color: #28a745;
}

.orange {
 color: #ee7c26;
}

.red {
 color: #FF0000;
}

#main {
    width: 100%;
    /* margin-top: 70px; */
}

.category {
    margin-bottom: 40px;
}

/* Сетка карточек */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 карточек в ряд для больших экранов */
    gap: 20px; /* Расстояние между карточками */
    padding: 20px;
}

.product-all {
    text-align: center;
    padding: 20px;    
}

.product-all a {
    border: 1px solid #28a745;
    padding: 10px 40px;
    border-radius: 25px;
    display: inline-block;
}

.product-all a:hover {
    text-decoration: none;
    background: #ffffff;
}

.product-card {
    width: 100%; /* Карточка занимает всю доступную ширину колонки */
    margin: 0 auto;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff; /* Белый фон карточки */
    position: relative; /* Для иконки галереи */
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Контейнер для изображения */
.product-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 100%; /* Создает квадратную область (пропорция 1:1) */
    overflow: hidden;
    background-color: #e0e0e0; /* Цвет фона для изображений */
}

.product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover; /* Сохраняет пропорции изображения */
    transition: opacity 0.3s ease;
}

/* Второе изображение */
.product-image .secondary-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Скрыто по умолчанию */
    transition: opacity 0.3s ease;
}

.product-card.hover-effect:hover .product-image img.primary-image {
    opacity: 0; /* Скрываем первое изображение */
}

.product-card.hover-effect:hover .product-image img.secondary-image {
    opacity: 1; /* Показываем второе изображение */
}

/* Информация о товаре */
.product-info {
    padding: 15px;
    text-align: center;
}

.product-name {
    font-weight: normal;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #333;
    display: -webkit-box; /* Для обрезки текста */
    -webkit-line-clamp: 2; /* Ограничение в две строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.product-price .new {
    background: rgb(255, 255, 0);
    color: #000000;
    padding: 4px;  
}

.product-price .old {
    font-weight: normal;
    color: #797878;
    text-decoration: line-through;    
}

.related-products {
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Кнопка "Добавить в корзину" */
.add-to-cart {
    display: inline-block;
    color: #fff;
    background-color: #28a745; /* Зеленый акцент */
    border: none;    
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.small-button {
    background: rgb(40, 167, 69) url("/uploads/icons/cart-icon.svg") center/35px no-repeat;
    width: 40px;
    height: 40px;
    border-radius: 25px;    
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.small-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.full-button {
    background: rgb(40, 167, 69) url("/uploads/icons/cart-icon.svg") 15px/35px no-repeat;
    padding: 15px 30px 15px 60px;
    font-size: 1rem;
    border-radius: 25px;
    margin: 20px 0;
}

.add-to-cart:hover {
    background-color: #218838; /* Темнее зеленый цвет */
}

.add-to-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

footer {
    position: relative; 
    width: 100%;    
    background-color: #282828;
    box-shadow: 0 -2px 0 #282828;
    color: #868686;
    padding: 20px;
    text-align: center;
}

footer h3 {
    margin-bottom: 40px;
    color: #868686;
}

/* Контейнер футера */
.footer-container {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

/* Колонки футера */
.footer-column {
    flex: 1;
    min-width: 220px;
    text-align: center;
    padding: 20px;
}

/* Логотип и платёжные системы */
.footer-logo {
    max-width: 130px;
    height: auto;
    margin-bottom: 15px;
}

.payment-title {
    font-size: 1rem;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.payment-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Контактная информация */
.footer-contact p {
    margin: 10px 0;
    font-size: 1rem;
}

.footer-contact a {
    color: #28a745;
    text-decoration: none;
}

.footer-contact a:hover {
    color: #218838;
    text-decoration: underline;
}

/* Социальные сети */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.social-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* Адаптация для старых ноутбуков (1280px и меньше) */
@media (max-width: 1600px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr); /* 6 карточек в ряд */
    }
}

/* Адаптация для старых ноутбуков (1280px и меньше) */
@media (max-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr); /* 5 карточек в ряд */
    }
}

/* Адаптация для старых ноутбуков (1024px и меньше) */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 карточек в ряд */
    }
}

/* Адаптация для планшетов (768px и меньше) */
@media (max-width: 768px) {
    .full-button {
        padding: 15px 30px 15px 30px;
        width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 карточки в ряд */
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
    }

    .footer-column {
        min-width: 100%;
        padding: 15px;
    }
}

/* Адаптация для мобильных устройств (480px и меньше) */
@media (max-width: 480px) {
    .full-button {
        width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 карточки в ряд */
    }

    .product-name {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1rem;
    }
}