/* Ярлык поддержки — вертикальная вкладка у правого края, как вкладка чата с продавцом.
   --scw-top: по умолчанию по центру экрана; на страницах с чатом продавца (.kl-chatw) сдвигается ниже его вкладки. */
.scw-widget{
    --scw-top: 50%;
    position: static;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
body:has(.kl-chatw) .scw-widget{
    --scw-top: calc(50% + 78px);
}

.scw-menu{
    position: fixed;
    right: 46px;
    top: var(--scw-top);
    transform: translateY(-50%);
    z-index: 9990;
    width: 260px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(0,0,0,.16);
    overflow: hidden;
    display: none;
    border: 1px solid #e9e9e9;
    box-sizing: border-box;
}

.scw-menu.is-open{
    display: block;
}

.scw-item,
.scw-item-btn{
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    border: none;
    background: #fff;
    text-align: left;
    text-decoration: none;
    color: #2f2f2f;
    cursor: pointer;
    border-bottom: 1px solid #ececec;
    font-size: 16px;
    font-weight: 400;
    box-sizing: border-box;
}

.scw-item:last-child,
.scw-item-btn:last-child{
    border-bottom: none;
}

.scw-item:hover,
.scw-item-btn:hover{
    background: #f8f8f8;
}

.scw-item-icon,
.scw-item-btn-icon{
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
}

.scw-item-icon svg,
.scw-item-btn-icon svg{
    width: 28px;
    height: 28px;
    display: block;
    flex: 0 0 28px;
}

.scw-item-icon img,
.scw-item-btn-icon img{
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    flex: 0 0 24px;
}

.scw-trigger{
    position: fixed;
    right: 0;
    top: var(--scw-top);
    transform: translateY(-50%);
    z-index: 9990;
    width: 34px;
    height: 64px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(160deg, #ff4b2b, #ff8a1f);
    color: #fff;
    cursor: pointer;
    box-shadow: -6px 8px 20px rgba(255,90,40,.30);
    box-sizing: border-box;
    transition: width .15s ease;
}
.scw-trigger:hover,
.scw-trigger[aria-expanded="true"]{
    width: 38px;
}

.scw-trigger-icon{
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.scw-trigger-icon img,
.scw-trigger-icon svg{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.scw-modal{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.scw-modal.is-open{
    display: flex;
}

.scw-overlay{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.36);
}

.scw-dialog{
    position: relative;
    z-index: 2;
    width: 590px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 24px;
    background: #fff;
    padding: 24px 24px 20px;
    box-shadow: 0 20px 70px rgba(0,0,0,.18);
    box-sizing: border-box;
    overflow-y: auto;
}

.scw-close{
    position: absolute;
    top: 14px;
    right: 16px;
    border: none;
    background: none;
    font-size: 36px;
    line-height: 1;
    color: #a6a6a6;
    cursor: pointer;
}

.scw-title{
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 18px;
    padding-right: 26px;
}

.scw-label{
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #4b4b4b;
    font-weight: 500;
}

.scw-label span{
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 400;
    margin-left: 6px;
}

.scw-input,
.scw-textarea{
    width: 100%;
    border: 1px solid #dfdfdf;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #222;
    box-sizing: border-box;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.scw-input:focus,
.scw-textarea:focus{
    border-color: #f1bf1b;
    box-shadow: 0 0 0 3px rgba(241,191,27,.12);
}

.scw-textarea{
    min-height: 108px;
    resize: none;
}

.scw-agree{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 14px;
    font-size: 12px;
    color: #8a8a8a;
    line-height: 1.35;
    position: relative;
    cursor: pointer;
}

.scw-agree input{
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.scw-agree-box{
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 1.5px solid #28a745de;
    border-radius: 6px;
    background: #28a74536;
    margin-top: 1px;
    position: relative;
    box-sizing: border-box;
}

.scw-agree input:checked + .scw-agree-box::after{
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid #28a745;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.scw-agree-text{
    display: block;
    flex: 1 1 auto;
}

.scw-agree a{
    color: black;
    text-decoration: underline;
}

.scw-submit{
    width: 100%;
    height: 42px;
    border: 1.5px solid #28a745de;
    border-radius: 999px;
    background: #28a74536;
    color: #28a745;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.scw-submit:disabled{
    opacity: .6;
    cursor: default;
}

.scw-note{
    font-size: 13px;
    margin: -4px 0 12px;
}

.scw-note--error{ color: #d64545; }
.scw-note--ok{ color: #28a745; }

@media (max-width: 767px){
    .scw-trigger{
        display: none;
    }

    .scw-dialog{
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 20px;
        padding: 20px 18px 18px;
    }

    .scw-title{
        font-size: 18px;
    }
}
