
/* ============================================================
   v46 PWA select sheet fix
   Исправляет мобильные кастомные списки:
   - bottom sheet больше не перекрывается нижним меню;
   - список не "залипает" под нижней навигацией;
   - модальные окна и списки получают корректный z-index;
   - появляется полноценный backdrop, закрытие по фону.
   ============================================================ */

@media(max-width:860px){
  html.pvz-select-open,
  body.pvz-select-open{
    overflow:hidden!important;
    touch-action:none!important;
  }

  /* Когда открыт список — нижнее меню полностью убираем, чтобы оно не перекрывало sheet */
  body.pvz-select-open .mobile-bottom{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translate3d(0,100%,0)!important;
    transition:opacity .12s ease, transform .16s ease!important;
  }

  .pvz-select-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:2147483300!important;
    background:rgba(15,23,42,.22)!important;
    -webkit-backdrop-filter:blur(7px)!important;
    backdrop-filter:blur(7px)!important;
    pointer-events:auto!important;
    animation:pvzSelectBackdropIn .14s ease both!important;
  }

  /*
    Переопределяем старый псевдо-backdrop из app.css.
    Раньше он был частью .custom-select и конфликтовал с кликами/нижним меню.
  */
  .custom-select.is-open::before{
    content:none!important;
    display:none!important;
    pointer-events:none!important;
  }

  .custom-select.is-open,
  .salary-v5-select.is-open{
    z-index:2147483400!important;
  }

  .custom-select.is-open .custom-select__trigger,
  .salary-v5-select.is-open .salary-v5-select__trigger{
    position:relative!important;
    z-index:3!important;
  }

  .custom-select__menu,
  .salary-v5-select__menu{
    pointer-events:auto!important;
  }

  .custom-select.is-open .custom-select__menu{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    top:auto!important;
    width:100vw!important;
    max-width:100vw!important;
    min-width:0!important;
    box-sizing:border-box!important;
    display:block!important;
    z-index:2147483500!important;
    max-height:min(58svh, 520px)!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    padding:10px 12px calc(18px + env(safe-area-inset-bottom, 0px))!important;
    border-radius:26px 26px 0 0!important;
    border:1px solid rgba(219,229,242,.95)!important;
    border-bottom:0!important;
    background:rgba(255,255,255,.985)!important;
    box-shadow:0 -22px 60px rgba(15,23,42,.18)!important;
    animation:pvzSelectSheetIn .2s cubic-bezier(.2,.8,.2,1) both!important;
  }

  .custom-select.is-open .custom-select__menu::before{
    content:""!important;
    display:block!important;
    width:44px!important;
    height:5px!important;
    border-radius:999px!important;
    background:#e6ecf5!important;
    margin:4px auto 14px!important;
  }

  .custom-select__option{
    min-height:58px!important;
    padding:15px 18px!important;
    border-radius:16px!important;
    font-size:20px!important;
    line-height:1.2!important;
    color:#344054!important;
    background:transparent!important;
    margin:2px 0!important;
  }

  .custom-select__option:hover,
  .custom-select__option:active{
    background:#f3f7ff!important;
    color:#1f4fd8!important;
    transform:translateY(-1px)!important;
  }

  .custom-select__option.is-selected{
    background:#eef4ff!important;
    border:1px solid #d5e3ff!important;
    color:#1f4fd8!important;
    font-weight:900!important;
  }

  .custom-select__check{
    font-size:22px!important;
    color:#2f6bff!important;
    width:28px!important;
  }

  .custom-select__option-text{
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }

  /* Salary custom selects тоже переводим в нормальный bottom sheet */
  .salary-v5-select.is-open .salary-v5-select__menu{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    top:auto!important;
    width:100vw!important;
    max-width:100vw!important;
    box-sizing:border-box!important;
    display:block!important;
    z-index:2147483500!important;
    max-height:min(58svh, 520px)!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    padding:10px 12px calc(18px + env(safe-area-inset-bottom, 0px))!important;
    border-radius:26px 26px 0 0!important;
    border:1px solid rgba(219,229,242,.95)!important;
    border-bottom:0!important;
    background:rgba(255,255,255,.985)!important;
    box-shadow:0 -22px 60px rgba(15,23,42,.18)!important;
    animation:pvzSelectSheetIn .2s cubic-bezier(.2,.8,.2,1) both!important;
  }

  .salary-v5-select.is-open .salary-v5-select__menu::before{
    content:""!important;
    display:block!important;
    width:44px!important;
    height:5px!important;
    border-radius:999px!important;
    background:#e6ecf5!important;
    margin:4px auto 14px!important;
  }

  .salary-v5-option{
    min-height:56px!important;
    border-radius:16px!important;
    padding:14px 18px!important;
    font-size:19px!important;
  }

  /* Если открыт modal — меню приложения не должно светиться под ним */
  body.modal-is-open .mobile-bottom,
  body.lock-scroll .mobile-bottom,
  body.pvz-dialog-open .mobile-bottom{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translate3d(0,100%,0)!important;
  }

  #modalBackdrop,
  .modal-backdrop,
  .salary-v5-modal-backdrop{
    z-index:2147483100!important;
  }

  .modal,
  .salary-v5-modal{
    z-index:2147483150!important;
  }
}

@keyframes pvzSelectBackdropIn{
  from{opacity:0;}
  to{opacity:1;}
}

@keyframes pvzSelectSheetIn{
  from{opacity:.85; transform:translate3d(0,105%,0);}
  to{opacity:1; transform:translate3d(0,0,0);}
}

/* Desktop/Tablet: только мягкая анимация hover */
@media(min-width:861px){
  .custom-select__option,
  .salary-v5-option{
    transition:background-color .14s ease, color .14s ease, transform .14s ease!important;
  }

  .custom-select__option:hover,
  .salary-v5-option:hover{
    transform:translateX(2px)!important;
  }
}
