/* FIX FIRST RANGE ACTIVE + CLOSE BUTTON */

.stroykt-sheet-length-modal__ranges button{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
}

.stroykt-sheet-length-modal__ranges button.active{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    background:#c51f3a !important;
    color:#fff !important;
    border:1px solid #c51f3a !important;
}

.stroykt-sheet-length-modal__close{
    position:absolute;
    top:8px;
    right:10px;
    width:40px;
    height:40px;
    z-index:10;
    background:none;
    border:0;
    font-size:30px;
    cursor:pointer;
}
/* FIX MOBILE MODAL POSITION BELOW FIXED HEADER */

.stroykt-sheet-length-modal{
    padding-top:70px !important;
    box-sizing:border-box;
}

.stroykt-sheet-length-modal__dialog{
    margin:0 auto !important;
    max-height:calc(100vh - 90px) !important;
    overflow-y:auto !important;
    position:relative;
}


/* крестик всегда внутри видимой области */

.stroykt-sheet-length-modal__close{
    position:absolute !important;
    top:8px !important;
    right:10px !important;
    z-index:20 !important;
    width:40px !important;
    height:40px !important;
    display:block !important;
}


/* поиск не должен уходить под шапку */

.stroykt-sheet-length-modal__search{
    position:relative;
    z-index:2;
    margin-top:0 !important;
}

/* STROYKT MOBILE LENGTH DESIGN 2026-08-24 */
@media (max-width:767px){

    /* Поднимаем выбор длины в существующем месте.
       Фото и верх карточки НЕ трогаем. */
    .stroykt-sheet-length{
        margin-top:-18px !important;
        margin-bottom:8px !important;
    }

    /* Поиск на всю ширину */
    .stroykt-sheet-length-modal__search{
        display:block !important;
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
        height:44px !important;
        margin:0 0 12px !important;
        box-sizing:border-box !important;
    }

    /* Интервальные кнопки */
    .stroykt-sheet-length-modal__ranges{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:8px !important;
        width:100% !important;
        margin:0 0 14px !important;
        padding:0 !important;
        box-sizing:border-box !important;
    }

    .stroykt-sheet-length-modal__ranges button{
        width:100% !important;
        min-width:0 !important;
        min-height:36px !important;
        margin:0 !important;
        box-sizing:border-box !important;
    }

    /* Матрица размеров начинается строго НИЖЕ диапазонов */
    .stroykt-sheet-length-modal__grid{
        display:grid !important;
        grid-template-columns:repeat(4,minmax(0,1fr)) !important;
        gap:7px !important;
        width:100% !important;
        margin:4px 0 0 !important;
        padding:0 !important;
        clear:both !important;
        box-sizing:border-box !important;
    }

    .stroykt-sheet-length-modal__grid button{
        width:100% !important;
        min-width:0 !important;
        min-height:40px !important;
        margin:0 !important;
        padding:4px 2px !important;
        box-sizing:border-box !important;
    }
}

/* STROYKT MODAL ONLY FIX 2026-08-24 */
@media (max-width:767px){

    /* Сам слой модалки строго в пределах экрана */
    .stroykt-sheet-length-modal{
        left:0 !important;
        right:0 !important;
        width:100% !important;
        max-width:100% !important;
        box-sizing:border-box !important;
        padding-left:0 !important;
        padding-right:0 !important;
    }

    /* Само белое окно — без смещения вправо */
    .stroykt-sheet-length-modal__dialog{
        position:relative !important;
        left:0 !important;
        right:auto !important;
        transform:none !important;

        width:100% !important;
        max-width:100% !important;

        margin-left:0 !important;
        margin-right:0 !important;

        padding-left:14px !important;
        padding-right:14px !important;

        box-sizing:border-box !important;
    }

    /* Поиск */
    .stroykt-sheet-length-modal__search{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
        margin:0 0 10px !important;
        box-sizing:border-box !important;
    }

    /* Диапазоны — матрица 2 колонки */
    .stroykt-sheet-length-modal__ranges{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:7px !important;

        width:100% !important;
        max-width:100% !important;

        margin:0 0 10px !important;
        padding:0 !important;

        overflow:visible !important;
        box-sizing:border-box !important;
    }

    .stroykt-sheet-length-modal__ranges button{
        width:100% !important;
        min-width:0 !important;
        margin:0 !important;
        box-sizing:border-box !important;
    }

    /* Матрица длин — 4 колонки */
    .stroykt-sheet-length-modal__grid{
        display:grid !important;
        grid-template-columns:repeat(4,minmax(0,1fr)) !important;
        gap:0 !important;

        width:100% !important;
        max-width:100% !important;

        margin:0 !important;
        padding:0 !important;

        box-sizing:border-box !important;
    }

    .stroykt-sheet-length-modal__grid button{
        width:100% !important;
        min-width:0 !important;
        margin:0 !important;
        box-sizing:border-box !important;
    }
}
