/* static/css/categories.css */

/* Стили для меню категорий */
.category-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.category-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: #666;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.category-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-link {
    display: block;
    padding: 0.7rem 0;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-link:hover {
    color: #000;
    border-bottom-color: #333;
    transform: translateX(5px);
}

.category-link.active {
    font-weight: 700;
    color: #000;
    border-bottom-color: #000;
}

/* Стили для главных категорий */
.main-category {
    margin-bottom: 1rem;
}

.main-category-link {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 0;
}

/* Стили для подкатегорий */
.subcategories {
    margin-left: 1rem;
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #f0f0f0;
}

.subcategory-link {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
}

.subcategory-link:hover,
.subcategory-link.active {
    color: #000;
    transform: translateX(3px);
}

/* Контейнер магазина */
.shop-container {
    display: flex;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Боковая панель с скроллом */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #fafafa;
    padding: 2rem;
    border-radius: 8px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
}

/* Стили для скроллбара */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Основная область с товарами */
.products-main {
    flex: 1;
    min-width: 0;
}

/* Заголовок страницы */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.page-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.products-count {
    color: #666;
    font-size: 0.9rem;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Карточка товара */
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.product-image-container {
    height: 100%;       /* Занимает всю ширину карточки */
    width: 100%;     /* Установи фиксированную высоту, которая тебе нужна */
    overflow: hidden;  /* Обрезает всё, что не влезло */
    position: relative;
}

/* Само изображение */
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Фото заполнит контейнер, сохраняя пропорции (лишнее обрежется) */
    display: block;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
}

.badge.new {
    background: #000;
    color: #fff;
}

.badge.sale {
    background: #e74c3c;
    color: #fff;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.product-price {
    font-weight: 600;
    font-size: 1.2rem;
    color: #000;
    margin-bottom: 0.5rem;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Сообщение об отсутствии товаров */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-products a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
}

.no-products a:hover {
    text-decoration: underline;
}

/* Стили для вертикального раскрытия подменю в десктопном меню */
.dropdown-trigger {
    position: relative;
    cursor: pointer;
}

.dropdown-content {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.group\/submenu:hover .dropdown-content {
    max-height: 500px;
    opacity: 1;
}


/* Адаптивность */
@media (max-width: 1024px) {
    .shop-container {
        flex-direction: column;
        gap: 2rem;
        padding: 1rem;


    }

    .sidebar {

        display: none !important; /* Скрываем категории */

    }


}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .product-image {
        height: 100%;
    }

    .category-links {

            display: none !important; /* Скрываем категории */

    }

    .subcategories {

            display: none !important; /* Скрываем категории */

    }
}
