/* styles.css - ОБНОВЛЕННЫЙ */

/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #2c3e50;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Хедер */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo span {
    color: #e74c3c;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    font-weight: bold;
    transition: color 0.3s;
    padding: 5px 10px;
    border-radius: 4px;
}

nav ul li a:hover {
    color: #e74c3c;
    background-color: rgba(255,255,255,0.1);
}

/* Главный контент */
main {
    min-height: calc(100vh - 160px);
    padding: 40px 0;
}

/* Футер */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
    color: #e74c3c;
}

.footer-bottom {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Стили для главной страницы */
.hero {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://via.placeholder.com/1200x400') no-repeat center center/cover;
    color: white;
    margin-bottom: 40px;
    border-radius: 8px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.btn {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #c0392b;
}

.bike-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.bike-type-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    text-align: center;
}

.bike-type-card:hover {
    transform: translateY(-5px);
}

.bike-type-icon {
    height: 120px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
}

.bike-type-content {
    padding: 20px;
}

.bike-type-content h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

/* Стили для страниц категорий велосипедов */
.page-title {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #666;
}

.breadcrumbs span {
    color: #e74c3c;
}

/* Блок категорий товаров */
.categories-section {
    margin-bottom: 50px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.category-column {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.category-column h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.product-list {
    list-style: none;
}

.product-list li {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
}

.product-list a {
    color: #2c3e50;
    transition: color 0.3s;
}

.product-list a:hover {
    color: #e74c3c;
}

/* Блок описания типа велосипеда */
.bike-description {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 50px;
    line-height: 1.8;
}

/* Блок карточек товаров */
.products-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-img {
    height: 200px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Это обрезает изображение */
    display: block;
}

/* Если хотим, чтобы изображение полностью помещалось без обрезки */
.product-img.contain img {
    object-fit: contain; /* Вместо cover - изображение полностью помещается */
    background-color: white; /* Белый фон вокруг изображения */
}

/* Или если хотим растянуть без сохранения пропорций (не рекомендуется) */
.product-img.stretch img {
    object-fit: fill; /* Растягивает изображение */
}

/* Запасной вариант если изображение не загрузится */
.product-img:before {
    content: "🚲";
    font-size: 60px;
    color: #2c3e50;
    display: none;
    position: absolute;
    z-index: 1;
}

.product-img:has(img[src=""])::before,
.product-img:not(:has(img))::before {
    display: flex;
}

.product-content {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
}

.product-price {
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 15px;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
}

.pagination a.active {
    background-color: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.pagination a:hover:not(.active) {
    background-color: #f5f5f5;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 15px;
        justify-content: center;
    }
    
    nav ul li {
        margin: 5px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .bike-types {
        grid-template-columns: 1fr;
    }
}

/* Исправленные стили для категорий */
.product-list li {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    line-height: 1.4;
}

.product-list a {
    color: #2c3e50;
    transition: color 0.3s;
    display: block;
    font-weight: normal;
}

.product-list a:hover {
    color: #e74c3c;
}

.size-variants {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    padding-left: 10px;
}

/* Стили для пагинации товаров */
.products-pagination {
    display: none; /* Скрываем по умолчанию */
}

.products-pagination.active {
    display: flex;
}

.products-grid {
    display: none; /* Скрываем все гриды по умолчанию */
}

.products-grid.active {
    display: grid; /* Показываем активный грид */
}

/* Счетчик товаров */
.products-count {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
}

.cart-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #e74c3c;
    transition: background-color 0.3s;
}

.cart-link:hover {
    background-color: #c0392b;
}

.cart-count {
    background-color: #2c3e50;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 5px;
}

/* Стили для корзины */

/* Стили для корзины */
.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    gap: 20px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}

.cart-item-price {
    color: #666;
    font-size: 14px;
}

.cart-item-total {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
    margin-top: 5px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e0e0e0;
}

.quantity-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-item-remove {
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background: #c0392b;
}

.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-summary h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Стили для корзины в хедере */
.header-actions {
    display: flex;
    align-items: center;
}

.cart-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #e74c3c;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-link:hover {
    background-color: #c0392b;
}

.cart-count {
    background-color: #2c3e50;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 18px;
    text-align: center;
}

#header-placeholder,
#footer-placeholder {
    min-height: 20px; /* Чтобы не было скачков при загрузке */
}


/* стиль для картинок в категория */

.description-image {
    text-align: center;
    margin: 20px 0;
}

.description-image img {
    max-width: 80%; /* или 70%, 60% - в зависимости от предпочтений */
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}