
/* Стили для информационного блока */
.catalog-info {
    margin: 20px 0;
    text-align: left;
}

.catalog-info p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-dark);
}

/* Контент информационного блока */
.info-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* Блок с призывом к действию */
.info-cta {
    background: var(--white);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    border-left: 3px solid var(--primary-blue);
}

.info-cta p {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray-dark);
}

.info-cta strong {
    color: var(--primary-red);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.cta-button:hover {
    background: #A52A2A;
    transform: translateY(-1px);
}

.cta-button i {
    font-size: 16px;
}

/* Стили для ссылок контактов */
.contact-link {
    color: var(--black);
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-link:hover {
    color: #2a2d6f;
}

/* Стили для ссылок в основном тексте */
.content-link {
    color: var(--black);
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease;
}

.content-link:hover {
    color: var(--primary-blue);
}

/* Стили для фильтров сортировки */
.catalog-filters {
    display: flex;
    gap: 30px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 260px;
}

.filter-label {
    font-size: 16px;
    font-weight: 400;
    color: var(--gray-dark);
    margin-bottom: 4px;
}

/* Кастомный выпадающий список */
.custom-select {
    position: relative;
    cursor: pointer;
    user-select: none;
    max-width: 260px;
}

.select-selected {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    color: var(--black);
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    padding-right: 40px;
    position: relative;
}

.select-selected::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--gray-dark);
    transition: transform 0.2s ease;
}

.custom-select.active .select-selected::after {
    transform: translateY(-50%) rotate(180deg);
}

.select-selected:hover {
    box-shadow: 0 0px 12px rgba(0, 0, 0, 0.15);
}

.select-items {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0px 20px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    padding: 5px 0px;
    min-width: 100%;
}

.select-hide {
    display: none;
}

.select-option {
    padding: 10px 14px;
    font-size: 16px;
    color: var(--black);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-option:not(.select-suboption) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Убираем border-bottom у последнего основного элемента (не подкатегории) */
.select-option:not(.select-suboption):last-child,
.select-option-last-main {
    border-bottom: none !important;
}

/* ===== СИСТЕМА ЗАТЕМНЕНИЯ ДЛЯ СЕЛЕКТОРА КАТЕГОРИЙ ===== */

/* Наведение на любой элемент выбора */
.select-option:hover,
.select-option-has-children:hover,
.select-suboption:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Активный (выбранный) элемент */
.select-option.selected,
.select-suboption.selected {
    background: rgba(0, 0, 0, 0.1);
}

.select-option-has-children {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.select-option-content {
    flex: 1;
}

.select-option-arrow {
    font-size: 16px;
    color: var(--gray-dark);
    flex-shrink: 0;
    margin-left: auto;
    transition: transform 0.2s ease;
}

@media (min-width: 841px) {
    .select-option-has-children:hover .select-option-arrow {
        transform: translateX(3px);
    }

}

.select-submenu {
    position: absolute;
    left: calc(100% - 1px);
    top: 0;
    background: white;
    width: 250px;
    box-shadow: 
    5px 0 10px -5px rgba(0, 0, 0, 0.1),
    15px 0 20px -10px rgba(0, 0, 0, 0.1);
    border-radius: 0 8px 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.select-submenu.select-submenu-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.select-suboption {
    padding: 10px 14px;
    font-size: 16px;
    color: var(--black);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    white-space: normal;
}

@media (min-width: 841px) {
    .select-suboption[data-parent-category] {
        display: none;
    }
}

.select-suboption:last-child {
    border-bottom: none;
}


@media (min-width: 841px) and (pointer: coarse) {
    .select-option-has-children .select-option-content {
        position: relative;
    }
    
    .select-option-has-children .select-option-content::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: 100%;
        z-index: 10;
        cursor: pointer;
    }
}

@media (max-width: 840px) {
    .select-option-arrow {
        transform: rotate(90deg);
        transition: transform 0.3s ease;
    }
    
    .select-option-has-children:hover {
        background: rgba(0, 0, 0, 0.06);
    }
    
    .select-option-has-children > .select-option-arrow {
        margin-left: 8px;
        flex-shrink: 0;
    }

    .select-option-has-children:hover > .select-option-arrow {
        transform: rotate(90deg);
    }
    
    .select-option-has-children.select-option-open > .select-option-arrow {
        transform: rotate(270deg);
    }
    
    .select-option-has-children .select-option-content {
        position: relative;
    }
    
    .select-option-has-children .select-option-content::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: 100%;
        z-index: 10;
        cursor: pointer;
    }
    
    .select-option-has-children > .select-submenu {
        display: none;
    }
    
    .select-suboption {
        padding-left: 30px;
        margin: 0;
        position: relative;
        background: rgba(0, 0, 0, 0.03);
    }
    
    .select-suboption:hover {
        background: rgba(0, 0, 0, 0.06);
    }
    
    .select-suboption[data-parent-category] {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        padding-left: 0;
        margin: 0;
        border-bottom: none;
        transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease, margin 0.25s ease, border 0.25s ease;
    }
    
    .select-suboption[data-parent-category].suboption-visible {
        max-height: 100px;
        opacity: 1;
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: 30px;
        margin: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* Стили для сетки каталогов */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding: 0;
}

.catalog-content {
    width: 100%;
}

/* Стили для сообщения "Ничего не найдено" */
.no-results-message {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 0px 10px rgba(0, 0, 0, 0.05);
}

.no-results-message p {
    margin: 8px 0;
    color: var(--gray-dark);
    font-size: 16px;
}

.no-results-message p:first-child {
    font-size: 18px;
    font-weight: 500;
    color: var(--black);
}

.catalog-item {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 0px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.catalog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0px 30px rgba(0, 0, 0, 0.15);
}

.catalog-cover {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    flex-shrink: 0;
}

.catalog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

.catalog-item:hover .catalog-image {
    transform: scale(1.05);
}

.catalog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

.catalog-item:hover .catalog-overlay,
.catalog-item.show-overlay .catalog-overlay {
    opacity: 1;
    pointer-events: auto;
}

.catalog-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 16px 24px;
    min-width: 160px;
    width: 100%;
    max-width: 180px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    pointer-events: auto;
}

.catalog-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.catalog-link i {
    font-size: 24px;
    color: #ff6b6b;
}

.catalog-link-details i {
    color: var(--primary-blue-light);
}

.catalog-name {
    font-size: 16px;
    font-weight: 400;
    color: var(--black);
    text-align: center;
    line-height: 1.4;
    padding: 18px 16px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-height: 60px;
}

/* Медиа-запросы */
@media (max-width: 535px) {
    .catalog-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}


@media (max-width: 600px) {
    .catalog-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        min-width: auto;
    }

    .custom-select {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .catalog-name {
        min-height: 40px;
    }
    
    .catalog-link {
        font-size: 14px;
        padding: 12px 16px;
        min-width: 140px;
        max-width: 160px;
    }
    
    .catalog-link i {
        font-size: 20px;
    }
}

/* Стили для страницы одиночного каталога */
.catalog-single-content {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.catalog-single-main {
    display: flex;
    gap: 30px;
    padding: 30px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.catalog-cover-section {
    flex-shrink: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.catalog-single-cover {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.catalog-single-cover-placeholder {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.catalog-single-cover-placeholder i {
    font-size: 64px;
    color: var(--gray-dark);
}

.catalog-pdf-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.catalog-pdf-view {
    background-color: var(--primary-blue);
    color: white;
}

.catalog-pdf-view:hover {
    background-color: #2a2d6f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.catalog-pdf-download {
    background-color: var(--primary-red);
    color: white;
}

.catalog-pdf-download:hover {
    background-color: #A52A2A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.catalog-pdf-btn i {
    font-size: 20px;
}

.catalog-single-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.catalog-info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.catalog-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.catalog-info-item.catalog-info-description {
    border-bottom: none;
    padding-bottom: 0;
}

.catalog-info-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--black);
}

.catalog-info-value {
    font-size: 16px;
    color: var(--gray-dark);
    line-height: 1.6;
}

.catalog-info-link {
    color: var(--primary-blue);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.catalog-info-link:hover {
    color: var(--primary-red);
}

.catalog-short-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-dark);
    margin-top: 0;
}

.catalog-short-description p {
    margin: 0 0 10px 0;
}

.catalog-short-description p:last-child {
    margin-bottom: 0;
}

.catalog-info-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-dark);
}

.catalog-info-content p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-dark);
}

.catalog-info-content p:last-child {
    margin-bottom: 0;
}

.catalog-info-content h1,
.catalog-info-content h2,
.catalog-info-content h3,
.catalog-info-content h4,
.catalog-info-content h5,
.catalog-info-content h6 {
    margin: 20px 0 15px 0;
    font-weight: 600;
    color: var(--black);
}

.catalog-info-content h1 {
    font-size: 28px;
}

.catalog-info-content h2 {
    font-size: 24px;
}

.catalog-info-content h3 {
    font-size: 20px;
}

.catalog-info-content ul,
.catalog-info-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.catalog-info-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.catalog-info-content a {
    color: var(--primary-blue);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.catalog-info-content a:hover {
    color: var(--primary-red);
}

.catalog-info-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.catalog-info-content blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    border-left: 4px solid var(--primary-blue);
    background-color: #f8f9fa;
    border-radius: 4px;
    font-style: italic;
}

/* Адаптивность для страницы одиночного каталога */
@media (max-width: 840px) {
    .catalog-single-main {
        flex-direction: column;
        gap: 20px;
    }
    
    .catalog-cover-section {
        width: 100%;
    }
    
    .catalog-pdf-buttons {
        flex-direction: row;
    }
    
    .catalog-pdf-btn {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .catalog-single-main {
        padding: 20px;
    }
    
    .catalog-pdf-buttons {
        flex-direction: column;
    }
}

/* Стили для кнопки возврата к каталогам */
.catalog-back-section {
    text-align: center;
}

.catalog-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.catalog-back-btn:hover {
    background-color: #2a2d6f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.catalog-back-btn i {
    font-size: 20px;
}

/* Стили для блока последних просмотренных каталогов */
.recent-catalogs-section {
    padding: 30px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.recent-catalogs-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--black);
    padding-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    text-align: center;
}

.recent-catalogs-section .catalog-grid {
    margin-top: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    padding-bottom: 10px;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Скрываем стандартный скроллбар для кастомизации */
    scrollbar-width: auto;
    scrollbar-color: var(--primary-blue) rgba(0, 0, 0, 0.1);
}

/* Кастомный скроллбар для WebKit браузеров */
.recent-catalogs-section .catalog-grid::-webkit-scrollbar {
    height: 12px;
}

.recent-catalogs-section .catalog-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.recent-catalogs-section .catalog-grid::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.recent-catalogs-section .catalog-grid::-webkit-scrollbar-thumb:hover {
    background: #2a2d6f;
}

/* Адаптивная ширина карточек в блоке последних каталогов */
.recent-catalogs-section .catalog-item {
    flex: 0 0 auto;
    min-width: 0;
    width: calc((100% - 60px) / 4); /* 4 карточки на больших экранах */
}

@media (max-width: 1200px) {
    .recent-catalogs-section .catalog-item {
        width: calc((100% - 40px) / 3); /* 3 карточки */
    }
}

@media (max-width: 840px) {
    .recent-catalogs-section .catalog-item {
        width: calc((100% - 20px) / 2); /* 2 карточки */
    }
}

@media (max-width: 535px) {
    .recent-catalogs-section .catalog-item {
        width: calc(100% - 0px); /* 1 карточка */
        min-width: 250px;
    }
}

@media (max-width: 840px) {
    .catalog-back-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .recent-catalogs-section {
        padding: 20px;
    }
    
    .recent-catalogs-title {
        font-size: 20px;
        padding-bottom: 20px;
    }
}

