@import "blocks/serriesGallery.css";

.series {
    padding: 24px;
    margin-bottom: 24px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.series__pagetitle {
    margin: 0 0 24px 0;
    font-family: "ITCOfficinaSansW10-Bd";
    font-size: 24px;
    color: #43474C;
    font-weight: normal;
}

.series__title {
    padding: 0;
    font-size: 18px;
    font-weight: normal;
    color: #FA0A19;
    font-family: "ITCOfficinaSerifW10-Bd";
    /*border-bottom: 1px solid #2C3135;*/
    /*border-bottom: 1px solid #DDE3E9;*/
}

.series__data {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
}

.series__gallery {
    width: 489px;

}

.series__content {
    width: calc(100% - 489px - 24px);
    font-family: "ITCOfficinaSansW10-Book_862508";
    font-size: 16px;
    color: #5A5F64;

    p {
        margin: 0 0 6px 0;
        padding: 0;
    }

    ul {
        list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='7'%3E%3Ccircle cx='2.5' cy='2.5' r='2.5' stroke='none' fill='%23ff292c' /%3E%3C/svg%3E");
        margin: 0 0 6px 14px;
        padding: 0;

        li {
            margin-bottom: 6px;
        }
    }
}

@media screen and (max-width: 991.98px) {
    .series__content {
        width: 100%;
    }
}

.series__icons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.series__products {
    width: 100%;
}

.series__additional {
    margin: 12px 0;
    color: #A6ACB1;
    font-family: ITCOfficinaSansW10-Book_862508;
    font-size: 14px;

    a {
        color: #414958;
        text-decoration: underline;
    }
}

.series__subtitle {
    font-family: "ITCOfficinaSansW10-Bd";
    font-size: 22px;
    color: #5A5F64;
    font-weight: normal;
}

.gallery__container {
    display: flex;
    width: 100%;
    max-width: 487px;
    min-width: 0;
    max-height: 362px;
    border: 1px solid #DDE3E9;
    border-radius: 6px;
    overflow: hidden;
}

.series__products {
    font-weight: normal;
    font-size: 16px;
    line-height: 16px;
    text-align: left;
    hyphens: auto;
}

.series-products__archive-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #5A5F64;
    font-family: 'ITCOfficinaSansW10-Book_862508', sans-serif;
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
}

.series-products__archive-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #73787D;
    cursor: pointer;
}

.series-products:not(.series-products_show-archive) .series-table__tr_archive {
    display: none;
}

.series-table {
    width: 100%;
    border-spacing: 1px;
    border-collapse: unset;
}

.series-table__novelty {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #3E7A45;
    color: #fff;
    font-family: "ITCOfficinaSansW10-Md", sans-serif;
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    vertical-align: middle;
    white-space: nowrap;
}

.series-table__th {
    color: #fff;
    font-family: "ITCOfficinaSansW10-Md";
    font-weight: normal;
    background-color: #8C9197;
    padding: 6px;

    &:first-child {
        border-radius: 6px 0 0 6px;
    }

    &:last-child {
        border-radius: 0 6px 6px 0;
    }

    &.sortable {
        position: relative;
        padding-right: 24px;
        cursor: pointer;
        user-select: none;
        /* стрелка вверх */
        &:before {
            content: "";
            position: absolute;
            right: 8px;
            top: calc(50% - 7px);

            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-bottom: 5px solid currentColor;

            opacity: .25;
        }
        /* стрелка вниз */
        &:after {
            content: "";
            position: absolute;
            right: 8px;
            top: calc(50% + 2px);

            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-top: 5px solid currentColor;

            opacity: .25;
        }
        /* сортировка по возрастанию */
        &[aria-sort="ascending"] {
            &::before {
                opacity: 1;
            }
            &::after {
                opacity: .15;
            }
        }
        /* сортировка по убыванию */
        &[aria-sort="descending"] {
            &::before {
                opacity: .15;
            }
            &::after {
                opacity: 1;
            }
        }
    }
}

.series-table__td {
    font-family: 'ITCOfficinaSansW10-Book_862508';
    color: #5A5F64;
    padding: 8px 6px;
    hyphens: manual;

    &:first-child, &:last-child {
        white-space: nowrap;
    }

    &:first-child {
        border-radius: 6px 0 0 6px;
    }

    &:last-child {
        border-radius: 0 6px 6px 0;
    }
}
.series-table__tr {
    cursor: pointer;
    &:nth-child(even) {
        .series-table__td {
            background-color: #FFFF7A;
        }
    }
    &:hover {
        .series-table__td {
            background-color: #73787D;
            color: #fff;
        }
    }
    &.series-table__tr_active {
        .series-table__td {
            background-color: #73787D;
            color: #fff;
        }
    }
    &.series-table__tr_archive {
        .series-table__td {
            background-color: #D9DEE6;
            color: #6A727C;
        }
        &:hover .series-table__td,
        &.series-table__tr_active .series-table__td {
            background-color: #9AA3AD;
            color: #fff;
        }
    }
    &.series-table__tr_order:not(.series-table__tr_archive) {
        .series-table__td {
            box-shadow: inset 3px 0 0 #C47B2C;
        }
    }
}

.serries-table__popover {
    --bs-popover-max-width: 560px;
    --bs-popover-border-color: #dde3e9;
    --bs-popover-border-radius: 6px;
    --bs-popover-body-padding-x: 12px;
    --bs-popover-body-padding-y: 12px;
    z-index: 1080;
}

.serries-table__popover .popover-body {
    padding: 12px;
}

.product-preview {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 280px;
    max-width: 520px;
    padding-right: 28px;
}

.product-preview__close {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8c9197;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;

    &:hover {
        color: #2c3135;
    }
}

.product-preview__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 320px;
}

.product-preview__photo {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    background: #fff;
    border: 0;
}

.product-preview__photos-empty {
    color: #8c9197;
    font-size: 14px;
}

.product-preview__data {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
    max-width: 220px;
    font-family: 'ITCOfficinaSansW10-Book_862508', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.35;
    color: #5a5f64;
}

.product-preview__amount,
.product-preview__transit {
    margin: 0;
}

.product-preview__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 8px 18px;
    border-radius: 4px;
    background: var(--bg-primary-yellow, #feff1f);
    color: #222;
    font-family: "ITCOfficinaSansW10-Md", Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;

    &:hover {
        background: var(--bg-secondary-yellow, #ffff80);
        color: #111;
        text-decoration: none;
    }
}

@media screen and (max-width: 767.98px) {
    .product-preview {
        flex-direction: column;
        min-width: 0;
        max-width: 280px;
    }

    .product-preview__photos {
        max-width: 100%;
    }

    .product-preview__photo {
        width: 72px;
        height: 72px;
    }

    .product-preview__data {
        max-width: none;
    }
}

/* Certificates modal (shared with product page behavior) */
.tingle-modal * {
    box-sizing: border-box;
}
.tingle-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    visibility: hidden;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
}
@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
    .tingle-modal {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}
.tingle-modal-box {
    position: relative;
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: auto;
    width: auto;
    max-width: min(96vw, 980px);
    border-radius: 4px;
    background: #fff;
    opacity: 1;
    cursor: auto;
    will-change: transform, opacity;
}
.tingle-modal-box__content {
    padding: 24px;
}
.tingle-enabled {
    position: fixed;
    right: 0;
    left: 0;
    overflow: hidden;
}
.tingle-modal--visible {
    visibility: visible;
    opacity: 1;
}
.tingle-modal--visible .tingle-modal-box {
    animation: series-modal-scale .2s cubic-bezier(.68, -.55, .265, 1.55) forwards;
}
.tingle-modal--overflow {
    overflow-y: scroll;
    padding-top: 8vh;
}
@keyframes series-modal-scale {
    0% {
        opacity: 0;
        transform: scale(.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
.certificates__heading {
    font-family: "ITCOfficinaSansW10-Bd";
    color: #43474C;
    font-weight: normal;
    font-size: 20px;
    margin: 0 0 12px;
}
.certificates__groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: min(70vh, 720px);
    overflow: auto;
    padding-right: 4px;
}
.certificates__group {
    min-width: 0;
}
.certificates__product {
    margin: 0 0 8px;
    font-family: 'ITCOfficinaSansW10-Book_862508', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.35;
    font-weight: normal;
    color: #5a5f64;
}
.certificates__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 0 0 2px;
    font-family: "ITCOfficinaSansW10-Md", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #2c3135;
}
.certificates__sep {
    color: #c4c7cd;
}
.certificates__name {
    font-size: 13px;
    line-height: 1.35;
    color: #5a5f64;
}
.tingle-modal.certificates-modal .tingle-modal-box {
    max-width: min(96vw, 1100px);
}
.certificates__table {
    font-family: 'ITCOfficinaSansW10-Book_862508';
    font-size: 16px;
    color: #5a5f64;
    font-weight: normal;
    border-collapse: collapse;
    line-height: 24px;
    border: 1px solid #dfdfdf;
}
.certificates__table td {
    padding: 6px 12px;
    border-bottom: 1px solid #dfdfdf;
}
.certificates__table th {
    font-family: "ITCOfficinaSansW10-Md";
    font-weight: normal;
    text-align: left;
    color: #333;
    border-bottom: 1px solid #dfdfdf;
    padding: 6px 12px;
    background-color: #ECF1F7;
}
.certificates__body tr:nth-of-type(2n) {
    background-color: #f5f5f5;
}
.certificates__link {
    text-decoration: none!important;
    color: #08c;
}
.certificates__link:hover {
    color: #333;
}
.certificates__close {
    border: none;
    outline: none;
    background: none;
    font-size: 12px;
    color: #5a5f64;
    position: absolute;
    right: 24px;
    top: 24px;
    cursor: pointer;
    transition: 0.6s;
}
.certificates__close:hover {
    transform: rotate(90deg);
}
@media screen and (max-width: 767.98px) {
    .tingle-modal {
        padding: 12px;
    }
    .tingle-modal-box {
        width: 100%;
    }
    .tingle-modal-box__content {
        padding: 16px;
        overflow-x: auto;
    }
}