/* ===== Catalog Dropdown Menu ===== */

.catalog-dropdown {
    position: relative;
}

.catalog-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 1200px;
    max-width: calc(100vw - 30px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.catalog-dropdown:hover .catalog-dropdown-menu,
.catalog-dropdown.open .catalog-dropdown-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Sidebar */
.catalog-dropdown-sidebar {
    width: 280px;
    min-width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    max-height: 500px;
    overflow-y: auto;
}

.catalog-main-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.catalog-main-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: #333;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 14px;
}

.catalog-main-item:hover {
    background: #fff;
    border-left-color: #006FF9;
    color: #006FF9;
}

.catalog-main-item.active {
    background: #fff;
    border-left-color: #006FF9;
    color: #006FF9;
    font-weight: 600;
}

.catalog-main-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.catalog-main-item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.catalog-main-item-icon i {
    font-size: 1.2rem;
    color: #006FF9;
}

.catalog-main-item-text {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-main-item-arrow {
    font-size: 12px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.catalog-main-item:hover .catalog-main-item-arrow,
.catalog-main-item.active .catalog-main-item-arrow {
    opacity: 1;
    color: #006FF9;
}

/* Content area */
.catalog-dropdown-content {
    flex: 1;
    padding: 20px 25px;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

.subcategory-panel {
    display: none;
}

.subcategory-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.subcategory-content {
    max-width: 100%;
}

.subcategory-columns {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.subcategory-column {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.subcategory-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

.subcategory-group:hover {
    background: #f8f9fa;
}

.subcategory-group-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.subcategory-group h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.subcategory-group h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.subcategory-group:hover h4 a {
    color: #006FF9;
}

.catalog-empty {
    padding: 40px 0;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Scrollbar styling */
.catalog-dropdown-sidebar::-webkit-scrollbar,
.catalog-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.catalog-dropdown-sidebar::-webkit-scrollbar-track,
.catalog-dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.catalog-dropdown-sidebar::-webkit-scrollbar-thumb,
.catalog-dropdown-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.catalog-dropdown-sidebar::-webkit-scrollbar-thumb:hover,
.catalog-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
/* Контейнер для картинок */
.product-image-wrapper {
    position: relative;
    padding-top: 100%; /* Соотношение сторон 1:1, подстройте под свои нужды */

}

.product-image-wrapper img.product-gallery-img {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* или cover, в зависимости от ваших фото */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1;
}

.product-image-wrapper img.product-gallery-img.active {
    opacity: 1;
    z-index: 2;
}

/* Кнопки навигации (скрыты по умолчанию) */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.gallery-nav-btn.prev-btn { left: 10px; }
.gallery-nav-btn.next-btn { right: 10px; }

/* Показываем кнопки при наведении на карточку */
.product-card:hover .gallery-nav-btn {
    opacity: 1;
}

.gallery-nav-btn:hover {
    background: #fff;
}

/* Точки */
.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-dot.active {
    background: #0d6efd; /* Ваш основной цвет (primary) */
}
@media (max-width: 991.98px) {
    .gallery-nav-btn,
    .gallery-dots {
        display: none !important;
    }
}
.product-card .product-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

}

.product-card .product-image-wrapper .gallery-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    max-height: 170px;
    max-width: 90%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card .product-image-wrapper .gallery-img.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.product-card:hover .product-image-wrapper .gallery-img.active {
    transform: translate(-50%, -50%) scale(1.08);
}

.product-card .gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    color: #333;
    font-size: 0.8rem;
}

.product-card:hover .gallery-nav-btn { opacity: 1; }
.product-card .gallery-nav-btn.prev-btn { left: 5px; }
.product-card .gallery-nav-btn.next-btn { right: 5px; }
.product-card .gallery-nav-btn:hover { background: #fff; color: #006FF9; }

.product-card .gallery-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.product-card .gallery-dot.active {
    background: #006FF9;
    transform: scale(1.2);
}

@media (max-width: 991.98px) {
    .product-card .gallery-nav-btn,
    .product-card .gallery-dots { display: none !important; }
    .product-card .product-image-wrapper .gallery-img { display: none; }
    .product-card .product-image-wrapper .gallery-img.active { display: block; }
}
/* Стили для галереи в карточках истории */
.product-card .product-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.product-card .product-image-wrapper .history-gallery-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    max-height: 170px;
    max-width: 90%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card .product-image-wrapper .history-gallery-img.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.product-card:hover .product-image-wrapper .history-gallery-img.active {
    transform: translate(-50%, -50%) scale(1.08);
}

.product-card .gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    color: #333;
    font-size: 0.8rem;
}

.product-card:hover .gallery-nav-btn { opacity: 1; }
.product-card .gallery-nav-btn.prev-btn { left: 5px; }
.product-card .gallery-nav-btn.next-btn { right: 5px; }
.product-card .gallery-nav-btn:hover { background: #fff; color: #006FF9; }

.product-card .gallery-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.product-card .gallery-dot.active {
    background: #006FF9;
    transform: scale(1.2);
}

@media (max-width: 991.98px) {
    .product-card .gallery-nav-btn,
    .product-card .gallery-dots { display: none !important; }
    .product-card .product-image-wrapper .history-gallery-img { display: none; }
    .product-card .product-image-wrapper .history-gallery-img.active { display: block; }
}
.product-card .product-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

}

.product-card .product-image-wrapper .search-gallery-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    max-height: 170px;
    max-width: 90%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card .product-image-wrapper .search-gallery-img.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.product-card:hover .product-image-wrapper .search-gallery-img.active {
    transform: translate(-50%, -50%) scale(1.08);
}

.product-card .gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
    color: #333;
    font-size: 0.8rem;
}

.product-card:hover .gallery-nav-btn { opacity: 1; }
.product-card .gallery-nav-btn.prev-btn { left: 5px; }
.product-card .gallery-nav-btn.next-btn { right: 5px; }
.product-card .gallery-nav-btn:hover { background: #fff; color: #006FF9; }

.product-card .gallery-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.product-card .gallery-dot.active {
    background: #006FF9;
    transform: scale(1.2);
}

@media (max-width: 991.98px) {
    .product-card .gallery-nav-btn,
    .product-card .gallery-dots { display: none !important; }
    .product-card .product-image-wrapper .search-gallery-img { display: none; }
    .product-card .product-image-wrapper .search-gallery-img.active { display: block; }
}