/* TALKCHAT_R19C12R9R10_DESKTOP_GIFT_CENTER_MODAL
   Desktop-only presentation patch.
   Gift trigger position, gift catalog/API, send flow and mobile layout are untouched.
*/
@media (min-width:768px){
  /* When gift dialog is open, feature layer becomes a full-screen modal stage. */
  #featureLayer:has(> .profile-gift-popup){
    position:fixed!important;
    inset:0!important;
    z-index:14040!important;
    display:grid!important;
    place-items:center!important;
    padding:40px!important;
    box-sizing:border-box!important;
    pointer-events:auto!important;
    background:rgba(3,8,14,.62)!important;
    backdrop-filter:blur(1.5px);
    -webkit-backdrop-filter:blur(1.5px);
  }

  /* Override the generic desktop profile drawer ONLY for the gift popup. */
  #featureLayer > .social-popup.profile-popup.profile-gift-popup{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    width:min(700px,calc(100vw - 80px))!important;
    height:min(680px,calc(100dvh - 80px))!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    border-radius:10px!important;
    overflow:hidden!important;
    box-shadow:0 28px 80px rgba(0,0,0,.48)!important;
    display:flex!important;
    flex-direction:column!important;
    animation:tc-gift-modal-in 220ms cubic-bezier(.22,1,.36,1) both;
  }

  #featureLayer > .profile-gift-popup > header{
    flex:0 0 auto!important;
  }

  #featureLayer > .profile-gift-popup > #profileGiftForm{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
    scrollbar-width:thin;
  }

  /* Keep catalog compact and balanced inside the centered card. */
  #featureLayer > .profile-gift-popup .profile-gift-choices.gift-full{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    max-height:none!important;
    overflow:visible!important;
  }

  @keyframes tc-gift-modal-in{
    from{
      opacity:0;
      transform:translate3d(0,10px,0) scale(.985);
    }
    to{
      opacity:1;
      transform:translate3d(0,0,0) scale(1);
    }
  }
}

@media (min-width:768px) and (prefers-reduced-motion:reduce){
  #featureLayer > .social-popup.profile-popup.profile-gift-popup{
    animation:none!important;
  }
}

/* Explicit mobile safety: no r10 gift-modal positioning is applied below 768px. */
@media (max-width:767px){
  #featureLayer > .profile-gift-popup{
    /* Deliberately empty: existing mobile gift rules remain authoritative. */
  }
}
