/* Catalog Page Styles */
.catalog-materials-page {
    background: #f3f4ff;
}

.catalog-content {
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 10px;
    border-radius: 34px;
    background: #ffffff;
    padding: 8px 8px 8px 24px;
}

.catalog-header .logo {
    flex-shrink: 0;
    width: 152px;
    height: 46px;
}

.catalog-header-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding: 0 32px;
    position: relative;
}

.catalog-title {
    line-height: 44px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Halvar Breitschrift", sans-serif;
    font-size: 36px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.catalog-filter {
    display: inline-flex;
    align-items: center;
    border-radius: 28px;
    background: #ffffff;
    padding: 4px;
    /* height: 44px; */
    box-shadow: 0 2px 8px rgba(26, 27, 48, 0.08);
    border: 1px solid rgba(26, 27, 48, 0.06);
    gap: 10px;
}

.catalog-filter .filter-tab {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    column-gap: 8px;
    border-radius: 34px;
    padding: 8px 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    border: 1px solid transparent;
}

.catalog-filter .filter-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 27, 48, 0.12);
}

.catalog-filter .filter-tab.active {
    background: #1a1b30;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(26, 27, 48, 0.2);
    border-color: #1a1b30;
}

.catalog-filter .filter-tab.active:hover {
    background: #2a2b40;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 27, 48, 0.25);
}

.catalog-filter .filter-tab:not(.active) {
    background: #ffffff;
    color: #1a1b30;
    border-color: rgba(26, 27, 48, 0.1);
}

.catalog-filter .filter-tab:not(.active):hover {
    background: #f8f9ff;
    border-color: rgba(26, 27, 48, 0.15);
}

.catalog-filter .filter-tab a {
    text-decoration: none;
    line-height: 20px;
    letter-spacing: 0;
    font-family: "Gilroy", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* Анимации и эффекты для фильтров */
.catalog-filter .filter-tab.pulse-effect {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Индикатор загрузки */
.catalog-filter .loading-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.catalog-filter .loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 27, 48, 0.1);
    border-top: 2px solid #1a1b30;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

.catalog-filter .loading-spinner.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Уведомления об ошибках */
.filter-error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff4757;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 300px;
    font-family: "Gilroy", sans-serif;
    font-size: 14px;
}

.filter-error-notification .error-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.filter-error-notification .error-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(326px, 1fr));
    gap: 24px;
    padding: 16px 32px;
    overflow-y: auto;
    justify-content: center;
    align-items: start;
}

@media (max-width: 1400px) {
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
        padding: 16px 24px;
    }
}

@media (max-width: 1200px) {
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
        padding: 16px 20px;
    }
}

@media (max-width: 992px) {
    .materials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 16px;
    }
}

.material-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: flex-start;
    border-radius: 34px;
    background: #ffffff;
    padding: 8px;
    overflow: hidden;
    row-gap: 8px;
    width: 100%;
    max-width: 326px;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0 auto;
}

@media (max-width: 992px) {
    .material-card {
        max-width: 100%;
    }
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.material-card .image-container {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    border: 1px solid #f3f4ff;
    border-radius: 26px;
    height: 310px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

.material-card .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-card .no-image {
    display: inline-flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    border-radius: 26px;
    background: #f3f4ff;
    height: 310px;
    width: 100%;
    row-gap: 10px;
}

.material-card .no-image .icon-no-image {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    overflow: hidden;
}

.material-card .no-image .no-image-text {
    flex-shrink: 0;
    line-height: 18px;
    letter-spacing: 0;
    color: #ccd0ff;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.material-card .card-content {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: flex-start;
    align-self: stretch;
    padding: 8px;
    row-gap: 16px;
    flex: 1;
}

.material-card .card-text {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: flex-start;
    align-self: stretch;
    row-gap: 8px;
}

.material-card .card-title {
    flex-shrink: 0;
    align-self: stretch;
    line-height: 24px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Halvar Breitschrift", sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.material-card .card-description {
    display: -webkit-box;
    flex-shrink: 0;
    align-self: stretch;
    overflow: hidden;
    line-height: 20px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Gilroy", sans-serif;
    font-size: 16px;
    font-weight: 400;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    min-height: 80px;
    /* 4 lines * 20px line-height */
    max-height: 100px;
}

.material-card .card-buttons {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    align-self: stretch;
    column-gap: 8px;
}

.material-card .btn {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
    border-radius: 41px;
    padding: 8px 12px;
    overflow: hidden;
    text-decoration: none;
    line-height: 24px;
    font-family: "Gilroy", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.material-card .btn:hover {
    transform: translateY(-1px);
}

.material-card .btn-primary {
    background: #b45a06;
    color: #ffffff;
}

.material-card .btn-primary:hover {
    background: #9a4d05;
    box-shadow: 0 2px 8px rgba(180, 90, 6, 0.3);
}

.material-card .btn-secondary {
    background: #f3f4ff;
    color: #1a1b30;
}

.material-card .btn-secondary:hover {
    background: #e5e8ff;
    box-shadow: 0 2px 8px rgba(26, 27, 48, 0.1);
}

/* Modal Styles */
.material-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 10px;
    visibility: hidden;
    /* Скрываем по умолчанию */
    opacity: 0;
    /* Делаем прозрачным */
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
    /* Добавляем анимацию */
}

.material-modal-overlay.active {
    visibility: visible;
    /* Показываем при активации */
    opacity: 1;
    /* Убираем прозрачность */
}

.material-modal {
    width: 520px;
    display: flex;
    flex-direction: column;
    background: #f3f4ff;
    border-radius: 34px;
    max-height: 100%;
    margin: 15px;
}

.material-modal .modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    border-radius: 34px;
    background: #ffffff;
    padding: 8px 8px 8px 24px;
    margin: 10px;
    overflow: hidden;
}

.material-modal .modal-title {
    flex-shrink: 0;
    line-height: 36px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Halvar Breitschrift", sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.material-modal .close-button {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
    border-radius: 41px;
    background: #f3f4ff;
    padding: 12px;
    overflow: hidden;
    cursor: pointer;
    border: none;
}

.material-modal .modal-content {
    padding: 0 10px 10px;
    overflow-y: auto;
    height: 100%;
}

.modal-content .image-slider {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    align-self: stretch;
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    height: 330px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.modal-content .slider-nav {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 12px;
    position: absolute;
    bottom: 0;
    left: 0;
    align-items: flex-end;
}

.modal-content .slider-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 41px;
    background: #ffffff;
    padding: 12px;
    cursor: pointer;
    border: none;
}

.modal-content .slider-pagination {
    display: inline-flex;
    align-items: center;
    column-gap: 3px;
    border-radius: 34px;
    background: #ffffff;
    padding: 4px;
}

.modal-content .pagination-dot {
    flex-shrink: 0;
    border-radius: 50%;
    width: 6px;
    height: 6px;
}

.modal-content .pagination-dot.active {
    background: #1a1b30;
}

.modal-content .pagination-dot:not(.active) {
    background: #e5e8ff;
}

.modal-content .details-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: flex-start;
    align-self: stretch;
    border-radius: 26px;
    background: #ffffff;
    padding: 16px;
    overflow: hidden;
    row-gap: 12px;
    margin-top: 8px;
}

.details-section .section-title {
    flex-shrink: 0;
    align-self: stretch;
    line-height: 24px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Halvar Breitschrift", sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.details-section .section-text {
    flex-shrink: 0;
    align-self: stretch;
    line-height: 24px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Gilroy", sans-serif;
    font-size: 16px;
    font-weight: 400;
}

.details-section .btn-create-order {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    column-gap: 8px;
    border-radius: 41px;
    background: #b45a06;
    padding: 12px 16px;
    overflow: hidden;
    color: #ffffff;
    text-decoration: none;
    font-family: "Gilroy", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.characteristics-table {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: flex-start;
    align-self: stretch;
    border: 1px solid #f3f4ff;
    border-radius: 8px;
    overflow: hidden;
}

.characteristics-table .table-row {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    align-self: stretch;
    justify-content: space-between;
    padding: 12px;
    overflow: hidden;
}

.characteristics-table .table-row:nth-child(odd) {
    background: #ffffff;
}

.characteristics-table .table-row:nth-child(even) {
    background: #f3f4ff;
}

.characteristics-table .param-title {
    display: flex;
    flex-grow: 1;
    align-items: center;
    column-gap: 12px;
}

.characteristics-table .param-icon {
    width: 24px;
    height: 24px;
}

.characteristics-table .param-name {
    flex-shrink: 0;
    line-height: 24px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Gilroy", sans-serif;
    font-size: 16px;
    font-weight: 400;
}

.characteristics-table .param-value {
    flex-grow: 1;
    text-align: right;
    line-height: 24px;
    letter-spacing: 0;
    color: #1a1b30;
    font-family: "Gilroy", sans-serif;
    font-size: 16px;
    font-weight: 600;
}

/* Адаптивные стили */
@media (max-width: 992px) {
    .catalog-header {
        padding: 8px;
        margin: 0 5px;
    }

    .catalog-header .logo {
        width: 120px;
        height: 36px;
    }
}

@media (max-width: 768px) {
    .catalog-content {
        padding: 0;
    }

    .catalog-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        border-radius: 24px;
    }

    .catalog-header .logo {
        width: 100px;
        height: 30px;
    }

    .catalog-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 0 16px;
        margin-top: 16px;
    }

    .catalog-title {
        font-size: 28px;
        line-height: 36px;
    }

    .catalog-filter {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 4px;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
    }

    .catalog-filter::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .catalog-filter .filter-tab {
        flex-shrink: 0;
        min-width: max-content;
    }

    .materials-grid {
        padding: 0px;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 16px;
    }

    .material-card {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .material-card .image-container {
        height: 250px;
        border-radius: 20px;
    }

    .material-card .no-image {
        height: 250px;
        border-radius: 20px;
    }

    .material-card .card-content {
        padding: 12px;
    }

    .material-card .card-title {
        font-size: 16px;
        line-height: 22px;
    }

    .material-card .card-description {
        font-size: 14px;
        line-height: 18px;
        min-height: 72px;
        -webkit-line-clamp: 4;
    }

    .material-modal {
        width: calc(100% - 20px);
        max-width: 520px;
        margin: 10px;
        border-radius: 24px;
    }

    .material-modal .modal-header {
        padding: 8px;
        margin: 8px;
        border-radius: 24px;
    }

    .material-modal .modal-title {
        font-size: 20px;
        line-height: 28px;
        word-wrap: break-word;
        width: 80%;
    }

    .material-modal .modal-content {
        padding: 0 8px 8px;
    }

    .modal-content .image-slider {
        height: 250px;
        border-radius: 20px;
    }

    .details-section {
        padding: 12px;
        border-radius: 20px;
    }

    .details-section .section-title {
        font-size: 16px;
        line-height: 22px;
    }

    .details-section .section-text {
        font-size: 14px;
        line-height: 20px;
    }

    .characteristics-table .table-row {
        padding: 10px;
    }

    .characteristics-table .param-name,
    .characteristics-table .param-value {
        font-size: 14px;
        line-height: 20px;
    }

    .characteristics-table .param-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .catalog-title {
        font-size: 24px;
        line-height: 32px;
    }

    .catalog-filter {
        height: auto;
        min-height: 40px;
        padding: 3px;
        gap: 6px;
    }

    .catalog-filter .filter-tab {
        padding: 6px 12px;
        border-radius: 24px;
    }

    .catalog-filter .filter-tab a {
        font-size: 13px;
        line-height: 18px;
    }

    .materials-grid {
        padding: 12px;
        gap: 12px;
    }

    .material-card {
        width: 100%;
        max-width: 100%;
        border-radius: 24px;
        padding: 6px;
    }

    .material-card .image-container {
        height: 200px;
        border-radius: 18px;
    }

    .material-card .no-image {
        height: 200px;
        border-radius: 18px;
    }

    .material-card .card-content {
        padding: 8px;
        row-gap: 12px;
    }

    .material-card .card-title {
        font-size: 15px;
        line-height: 20px;
    }

    .material-card .card-description {
        font-size: 13px;
        line-height: 17px;
        min-height: 68px;
        -webkit-line-clamp: 4;
    }

    .material-card .card-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .material-card .btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
        line-height: 20px;
    }

    .material-modal {
        width: calc(100% - 16px);
        margin: 8px;
        border-radius: 20px;
    }

    .material-modal .modal-header {
        padding: 6px;
        margin: 6px;
        border-radius: 20px;
    }

    .material-modal .modal-title {
        font-size: 18px;
        line-height: 24px;
        padding-left: 8px;
        word-wrap: break-word;
        width: 80%;
    }

    .material-modal .close-button {
        padding: 10px;
        border-radius: 34px;
    }

    .material-modal .modal-content {
        padding: 0 6px 6px;
    }

    .modal-content .image-slider {
        height: 200px;
        border-radius: 18px;
    }

    .modal-content .slider-nav {
        padding: 8px;
    }

    .modal-content .slider-button {
        padding: 8px;
        width: 36px;
        height: 36px;
    }

    .modal-content .slider-button svg {
        width: 16px;
        height: 16px;
    }

    .details-section {
        padding: 10px;
        border-radius: 18px;
        row-gap: 10px;
    }

    .details-section .section-title {
        font-size: 15px;
        line-height: 20px;
    }

    .details-section .section-text {
        font-size: 13px;
        line-height: 18px;
    }

    .details-section .btn-create-order {
        padding: 10px 14px;
        font-size: 14px;
        line-height: 20px;
        border-radius: 34px;
    }

    .characteristics-table .table-row {
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .characteristics-table .param-title {
        width: 100%;
        column-gap: 8px;
    }

    .characteristics-table .param-name {
        font-size: 13px;
        line-height: 18px;
    }

    .characteristics-table .param-value {
        width: 100%;
        text-align: left;
        font-size: 14px;
        line-height: 20px;
        padding-left: 32px;
    }

    .characteristics-table .param-icon {
        width: 18px;
        height: 18px;
    }

    .filter-error-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
        padding: 10px 12px;
    }
}