/* Общий контейнер */
.catalog-container {

    max-width: 1400px;
    margin: 20px auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
    min-height: calc(100vh - 100px);
}

/* Заголовок */
.title_catalog {
    padding-top: 80px;
    color: #0b3d44;
    font-weight: 700;
    font-size: 2.25rem;
    text-align: center;

    letter-spacing: -0.02em;
}

div.category-content > div.subcategories {


}

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.breadcrumbs a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #259da8;
}

/* Сайдбар */
.sidebar {
    width: 30%;
    max-width: 300px;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    /*padding: 1rem;*/
    /*background: #fff;*/
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /*scrollbar-width: thin;*/
    /*scrollbar-color: #259da8 #f1f5f9;*/
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #259da8;
    border-radius: 4px;
    transition: background 0.3s ease;
}

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

/* Карточка категории */
.category-card {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.category-image {
    width: 100%;
    height: 120px;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-content {
    padding: 1rem;
}

.category-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b3d44;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.category-content h3 a {
    color: #0b3d44;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-content h3 a:hover,
.category-content h3 a.active {
    color: #259da8;
}

/* Подкатегории */
.subcategories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subcategories li {
    padding: 0.5rem 0 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.subcategories a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.3s ease;
}

.subcategories a:hover,
.subcategories a.active {
    color: #259da8;
    text-shadow: 0 0 6px #259da8;
}


.subcategories .nested {
    padding-left: 1rem;
    border-left: 1px solid #e5e7eb;
}

/* Основной контент */
.main-content {
    flex: 1;
}

/* Фильтры */
.filter-controls {
    /*margin-bottom: 1.5rem;*/
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-controls button {
    background: #f1f5f9;
    color: #0b3d44;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-controls button:hover {
    background: #259da8;
    color: #fff;
}

.filter-controls button.active-filter {
    background: #259da8;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Карточка товара */
.product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 380px;
}

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

.product-card img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.product-card .product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0b3d44;
    margin: 0 0 0.5rem;
}

.product-card h3 a {
    color: #0b3d44;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card h3 a:hover {
    color: #259da8;
}

.product-card .price {
    font-size: 1rem;
    font-weight: 700;
    color: #259da8;
    margin: 0.5rem 0;
}

.product-card .features {
    font-size: 13px;
    color: #4b5563;
    margin: 0.5rem 0;
    flex: 1;
}

.product-card .video-preview {
    position: relative;
    margin-bottom: 1rem;
    cursor: pointer;
}

.product-card .video-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.product-card .video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.product-card .add-to-cart-btn {
    background-color: #259da8;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: auto;
}

.product-card .add-to-cart-btn:hover:not(.in-cart) {
    background-color: #1d7a85;
}

.product-card .add-to-cart-btn.in-cart {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Сообщения */
.loading,
.error-message,
.no-content {
    text-align: center;
    color: #4b5563;
    font-size: 1.125rem;
    margin-top: 2rem;
}

.error-message {
    color: #dc2626;
}

/* Кнопка корзины */
.cart-button {
    background: #259da8;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cart-button:hover {
    background: #1d7a85;
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .products-grid {
        margin-top: 10px;
    }

    .title_catalog {
        font-weight: 1000;
        font-size: 20px;
    }


    .catalog-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        transform: translateX(-100%);
        opacity: 0;
        padding: 2rem 1rem;
        z-index: 999;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
        opacity: 1;
    }

    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1000;
    }

    .sidebar-toggle span {
        display: block;
        width: 24px;
        height: 3px;
        background: #259da8;
        margin: 5px 0;
        border-radius: 2px;
    }

    .filter-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}