/* настройка хедеров */
.header-main {
    display: none;
}

.header-cont-1 {
    display: none;
}

.header-cont-2 {
    display: flex;
}
/* конец настройки хэдеров */

.palette {
    padding: calc(20px + 48px) 0 100px;
    width: calc(100vw - 20px * 2);

    display: flex;
    flex-direction: column;
    gap: 48px;
}

.palette-title {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.pal-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pal-title-t {
    font-size: 64px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks {
    display: flex;
    flex-direction: column;
    gap: 96px;
}

.palette-blocks-colors-cont {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.palette-blocks-colors-cont-title {
    display: flex;
    justify-content: space-between;
}

.palette-blocks-colors-cont-title-t {
    font-size: 32px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks-colors-cont-title-steps {
    display: flex;
    gap: 32px;
}

.palette-blocks-colors-cont-title-steps-step {
    display: flex;
    gap: 12px;
    align-items: center;
}

.palette-blocks-colors-cont-title-steps-step-ex {
    width: 26px;
    height: 26px;
}

.palette-blocks-colors-cont-title-steps-step-ex.first {
    background-color: var(--color-foreground-opacity);
}

.palette-blocks-colors-cont-title-steps-step-ex.second {
    background-color: var(--color-foreground-primary);
}

.palette-blocks-colors-cont-title-steps-step-t {
    font-size: 14px;
    line-height: 110%;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 20px;
    max-width: 1880px;
}

.color-items-item {
    width: 217px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.show-more-btn {
    display: none;
}

.color-items-item-code {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: 38px;
    padding: 0 16px;
    border: .8px solid var(--color-foreground-primary);
    border-radius: 24px;

    font-size: 16px;
    line-height: 110%;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);
    font-weight: 500;
}

.color-items-item-img {
    width: 100%;
    height: 129px;
}

.color-items-item-img .img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.color-items-item-title {
    font-size: 24px;
    line-height: 110%;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
    font-weight: 500;
}

.palette-blocks-materials-cont {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.palette-blocks-materials-cont-title {
    font-size: 32px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks-materials {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.material-items-item {
    display: flex;
    width: 375px;
    padding: 24px;
    gap: 24px;
    align-items: center;
}

.material-items-item-img {
    width: 64px;
    height: 64px;

    flex-shrink: 0;
}

.material-items-item-img img {
    width: 100%;
    height: 100%;

    border-radius: 50%;
}

.material-items-item-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.material-items-item-info-title {
    font-size: 24px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.material-items-item-info-t {
    font-size: 14px;
    line-height: 110%;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks-game {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.palette-blocks-game-line {
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.palette-blocks-game-line-title {
    font-size: 64px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.cat-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cat-items-item {
    display: flex;
    align-items: center;
    justify-content: center;
    
    height: 48px;
    padding: 0 48px;

    border: .8px solid var(--color-foreground-primary);
    border-radius: 24px;

    cursor: pointer;
}

.cat-items-item.active {
    background-color: var(--color-foreground-primary);
}

.cat-items-item.active .cat-items-item-t {
    color: var(--color-background-primary);
}

.cat-items-item-t {
    font-size: 16px;
    line-height: 110%;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks-game-cont {
    position: relative;
    border: 1px solid var(--color-foreground-primary);
    width: 100%;
    height: 823px;
}

.palette-blocks-game-cont-colors-block {
    display: flex;
    flex-direction: column;
    gap: 72px;
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--color-background-primary);
}

.palette-blocks-game-cont-filter-t {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    width: fit-content;
    border: .8px solid var(--color-foreground-primary);
    border-radius: 24px;

    font-size: 16px;
    line-height: 110%;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;

    cursor: pointer;
}

.palette-blocks-game-cont-colors {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 246px;
    max-height: 560px;
    overflow-y: auto;

    display: none;
}

.palette-blocks-game-cont-colors::-webkit-scrollbar {
    width: 0;
}

.color-filter-item {
    display: flex;
    gap: 12px;
    align-items: center;

    cursor: pointer;
}

.color-dot-block {
    width: 42px;
    height: 42px;
    border-radius: 140px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.color-filter-item.active  {
    opacity: 100%;
}

.color-filter-item.muted {
    opacity: 50%;
}

.color-filter-item.active .color-dot-block {
    border: 1px solid var(--color-foreground-primary);
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 140px;
}

.color-filter-item-title {
    font-size: 16px;
    line-height: 110%;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: var(--color-foreground-primary);

    text-transform: lowercase;
}

.palette-blocks-game-cont-colors-dop-block {
    position: absolute;
    top: 20px;
    right: 20px;
}

#toggle-custom-color-btn {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.custom-color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

#toggle-custom-color-btn img,
#toggle-custom-color-btn span {
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.palette-blocks-game-cont-model {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Дополнительные стили для 3D модели */
#threejs-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Индикатор загрузки */
#loading-indicator-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    display: none;
    width: 120px;
    height: 120px;
}

.loading-spinner {
    position: relative;
    width: 100%;
    height: 100%;
}

.loading-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.loading-circle-bg {
    fill: none;
    stroke: transparent;
    stroke-width: 4;
}

/* Анимированный круг прогресса */
.loading-circle-progress {
    fill: none;
    stroke: var(--color-foreground-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.3s ease;
}

/* Градиент для круга прогресса */
.loading-circle-progress-gradient {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.loading-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    line-height: 110%;
    letter-spacing: -0.2px;
    font-weight: 500;
    color: var(--color-foreground-primary);
    z-index: 2;
}

#loading-indicator-3d * {
    background: transparent !important;
}

/* Анимация вращения для дополнительного эффекта */
@keyframes loadingRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Адаптация на маленькие экраны (< 1920)*/
@media screen and (max-width: 1919px) {
    .palette-blocks-colors {
        width: 932px;
    }
}

/* 1440 */
@media screen and (max-width: 1575px) {
    .palette-blocks-materials {
        justify-content: start;
    }

    .palette-blocks-game-line {
        flex-direction: column;
        gap: 32px;
        align-items: start;
    }
}

/* 1280 */
@media screen and (max-width: 1280px) {
    .palette-title {
        gap: 32px;
    }

    .palette-blocks {
        gap: 64px;
    }

    .palette-blocks-game {
        gap: 32px;
    }
}

/* 768 */
@media screen and (max-width: 1200px) {
    .palette {
        gap: 24px;
    }

    .pal-title-t {
        font-size: 48px;
        line-height: 110%;
    }

    .palette-blocks {
        gap: 48px;
    }

    .palette-blocks-colors-cont {
        gap: 24px;
    }

    .palette-blocks-colors-cont-title-steps {
        gap: 24px;
    }

    .palette-blocks-colors {
        max-width: 456px;
    }

    .palette-blocks-colors .color-items-item:nth-child(n+9) {
        display: none;
    }

    .show-more-btn {
        display: flex;
        justify-content: center;
        margin-top: 24px;
        align-self: start;

        font-size: 14px;
        line-height: 110%;
        letter-spacing: -0.2px;
        color: var(--color-foreground-primary);

        text-transform: lowercase;
        cursor: pointer;
    }

    .palette-blocks-colors.show-all .color-items-item {
        display: flex;
    }

    .color-items-item-title {
        font-size: 20px;
        line-height: 110%;
    }

    .palette-blocks-colors-container {
        position: relative;
    }
    
    .palette-blocks-colors.overlay-active {
        position: relative;
    }
    
    .palette-blocks-colors.overlay-active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 320px;
        background: linear-gradient(to bottom, transparent, var(--color-background-opacity-75));
        pointer-events: none;
        z-index: 1;
    }
    
    .palette-blocks-colors.show-all.overlay-active::after {
        display: none;
    }

    .palette-blocks-materials-cont {
        gap: 24px;
    }

    .palette-blocks-materials {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .palette-blocks-materials::-webkit-scrollbar {
        height: 0;
    }

    .material-items-item {
        width: 367px;
        padding: 20px;

        flex-shrink: 0;
    }

    .material-items-item-info-title {
        font-size: 20px;
        line-height: 110%;
    }

    .palette-blocks-game {
        gap: 24px;
    }

    .palette-blocks-game-line-title {
        font-size: 48px;
        line-height: 110%;
    }

    .cat-items {
        gap: 8px;
        flex-wrap: wrap;
    }

    .cat-items-item {    
        height: 38px;
        padding: 0 32px;
    }

    .cat-items-item-t {
        font-size: 14px;
        line-height: 110%;
    }

    .palette-blocks-game-cont {
        height: 75vh;
    }

    .palette-blocks-game-cont-colors-block {
        gap: 20px;
    }

    .palette-blocks-game-cont-filter-t {
        font-size: 14px;
        line-height: 110%;
    }

    .palette-blocks-game-cont-colors {
        gap: 0;
        width: 210px;
    }

    .palette-blocks-colors {
        width: 100%;
    }

    .color-filter-item-title {
        font-size: 14px;
        line-height: 110%;
    }

    .palette-blocks-game-cont-colors-dop-block {
        top: 20px;
        right: 20px;
    }
}

/* 375 */
@media screen and (max-width: 725px) {
    .palette {
        width: calc(100vw - 12px * 2);

        gap: 24px;
    }

    .palette-title {
        gap: 24px;
    }

    .pal-title {
        flex-direction: column;
        gap: 16px;
        align-items: start;
    }

    .pal-title-link {
        width: 100%;
    }

    .pal-title-t {
        font-size: 32px;
        line-height: 110%;
    }

    .palette-blocks-colors-cont {
        gap: 16px;
    }

    .palette-blocks-colors-cont-title {
        flex-direction: column;
        gap: 16px;
    }

    .palette-blocks-colors-cont-title-t {
        font-size: 24px;
        line-height: 110%;
    }

    .palette-blocks-colors-cont-title-steps {
        gap: 16px;
    }

    .palette-blocks-colors {
        gap: 16px 8px;
    }

    .color-items-item {
        width: calc((100% - 8px) / 2);
        gap: 8px;
    }

    .color-items-item-code {
        font-size: 14px;
        line-height: 110%;
    }

    .color-items-item-img {
        height: 101.95px;
    }

    .color-items-item-title {
        font-size: 16px;
        line-height: 110%;
    }

    .palette-blocks-materials-cont {
        gap: 32px;
    }

    .palette-blocks-materials-cont-title {
        font-size: 32px;
        line-height: 110%;
    }

    .palette-blocks-game {
        gap: 24px;
    }

    .palette-blocks-game-line-title {
        font-size: 32px;
        line-height: 110%;
    }

    .palette-blocks-game-cont-colors-block {
        top: 12px;
        left: 12px;
    }

    .palette-blocks-game-cont-colors-dop-block {
        top: 12px;
        right: 12px;
    }
}