/* ALIVO iPhone web app: richer brand surfaces, native safe areas, and touch sizing.
   This stylesheet is included only in the iPhone PWA review package. */
:root{
  --alivo-pwa-ink:#202035;
  --alivo-pwa-violet:#7254f4;
  --alivo-pwa-blue:#4d83ef;
  --alivo-pwa-lilac:#eeeaff;
  --alivo-pwa-shadow:0 15px 38px rgba(44,39,92,.09);
}

@media(max-width:760px){
  body:not(.market-home-view) #app{padding-bottom:calc(160px + env(safe-area-inset-bottom))!important}
  body:not(.market-home-view) #app>.wrap{padding-right:15px!important;padding-left:15px!important}
  .favorites-page,.account-wow,.public-profile-page,.listing-page,.chats-modern-page{padding-top:14px!important}
  .favorites-hero,.public-profile-hero{overflow:hidden!important;border:1px solid rgba(125,105,225,.17)!important;border-radius:25px!important;background:radial-gradient(circle at 92% 6%,rgba(128,102,255,.18),transparent 37%),linear-gradient(135deg,#fff 0%,#f7f4ff 60%,#eef4ff 100%)!important;box-shadow:var(--alivo-pwa-shadow)!important}
  .favorites-title{color:#292542!important;font-size:29px!important;font-weight:950!important;letter-spacing:-1px!important}
  .favorites-eyebrow,.public-profile-page .public-profile-name{color:#6d55df!important}
  .public-profile-page .public-profile-stat{border:1px solid rgba(123,105,214,.12)!important;border-radius:20px!important;background:linear-gradient(145deg,#fff,#f8f7ff)!important;box-shadow:0 7px 20px rgba(44,39,92,.06)!important}
  .public-profile-page .alivo-reviews-section{margin-top:17px!important;padding:16px!important;border:1px solid rgba(123,105,214,.16)!important;border-radius:23px!important;background:linear-gradient(145deg,#fff,#fbfaff)!important;box-shadow:var(--alivo-pwa-shadow)!important}
  .public-profile-page .alivo-review-card{border-color:#ece9f8!important;border-radius:17px!important;background:#fff!important}
  .account-wow .account-listing-card,.favorites-grid .market-listing-card{border-radius:20px!important;box-shadow:0 8px 22px rgba(37,39,70,.08)!important}
  .listing-page .listing-details{border:1px solid #eceaf5!important;border-radius:22px!important;background:linear-gradient(145deg,#fff,#fbfaff)!important;box-shadow:var(--alivo-pwa-shadow)!important}
  .auth-modern-card{border:1px solid rgba(130,111,219,.15)!important;border-radius:26px!important;background:linear-gradient(145deg,#fff,#faf8ff)!important;box-shadow:0 16px 40px rgba(41,37,91,.11)!important}
  .auth-modern-mobile-brand{color:var(--alivo-pwa-violet)!important;letter-spacing:-1px!important}
  .chats-modern-page .chat-avito-panel,.chats-modern-page .chats-modern-panel{border:1px solid #ebe8f5!important;border-radius:22px!important;box-shadow:var(--alivo-pwa-shadow)!important}
  .chats-modern-page .chat-avito-listing-card{border-color:#e8e3fb!important;background:linear-gradient(135deg,#fff,#f8f6ff)!important}
}
@media (max-width:760px){
  html{background:#f3f4fb;scroll-padding-top:78px}
  body{padding-top:env(safe-area-inset-top)!important;background:radial-gradient(ellipse at 92% 4%,rgba(135,108,255,.14),transparent 33%),linear-gradient(180deg,#f6f5ff 0,#f5f7fc 45%,#f0f4fa 100%)!important;color:var(--alivo-pwa-ink)}
  body.market-home-view .market-header{background:linear-gradient(125deg,#fff 0%,#f7f5ff 62%,#eef3ff 100%)!important;border-bottom:1px solid rgba(132,111,222,.16)!important;box-shadow:0 7px 24px rgba(64,57,128,.08)!important}
  body.market-home-view .market-header-inner{padding:12px 17px 13px!important;gap:9px!important;min-height:64px!important}
  body.market-home-view .market-logo{font-size:23px!important;font-weight:950!important;letter-spacing:-1.2px!important;color:#24213d!important}
  body.market-home-view .market-logo span{color:var(--alivo-pwa-violet)!important}
  body.market-home-view .alivo-tagline{max-width:145px!important;font-size:10px!important;line-height:1.25!important;letter-spacing:-.15px!important;color:#6856c8!important;white-space:normal!important}
  body.market-home-view .alivo-language-switch{gap:0!important;padding:2px!important;border:1px solid #e6e0ff!important;border-radius:15px!important;background:#ffffffc9!important;box-shadow:0 4px 15px rgba(75,62,140,.08)!important}
  body.market-home-view .alivo-language-switch button{min-width:28px!important;height:30px!important;min-height:30px!important;padding:0 4px!important;border-radius:10px!important;font-size:10px!important;font-weight:900!important}
  body.market-home-view .alivo-language-switch button[data-alivo-language="kk"]{min-width:31px!important}
  body.market-home-view #app{padding-top:4px!important}
  body.market-home-view .home-modern{padding-top:4px!important}
  body.market-home-view .home-modern .wrap{padding-right:15px!important;padding-left:15px!important}
  body.market-home-view .home-modern .home-hero{position:relative!important;margin:5px 0 14px!important;padding:15px!important;overflow:hidden!important;border:1px solid rgba(163,128,226,.35)!important;border-radius:24px!important;background:linear-gradient(135deg,#f5edff 0%,#f2e4ff 52%,#ffe6f2 100%)!important;box-shadow:0 12px 34px rgba(103,69,167,.12)!important}
  body.market-home-view .home-modern .home-hero::before{content:"";position:absolute;top:-54px;right:-26px;width:138px;height:138px;border-radius:50%;background:linear-gradient(135deg,rgba(129,101,255,.25),rgba(235,112,179,.2));pointer-events:none}
  body.market-home-view .home-modern .home-search-shell{position:relative!important;z-index:1!important;min-height:57px!important;height:57px!important;border:1px solid #cdb2f5!important;border-radius:18px!important;background:linear-gradient(115deg,#fff 0%,#fff5ff 45%,#ffedf6 100%)!important;box-shadow:0 8px 22px rgba(131,73,174,.17)!important}
  body.market-home-view .home-modern .home-search-icon{color:#7358e8!important}
  body.market-home-view .home-modern .home-search-shell input#q{font-size:15px!important;font-weight:550!important}
  body.market-home-view .home-modern .home-search-shell button#find{min-height:45px!important;border-radius:14px!important;background:linear-gradient(135deg,#7855f4,#4f83ee)!important;box-shadow:0 6px 16px rgba(105,82,220,.23)!important}
  body.market-home-view .home-modern .home-section{margin-top:21px!important}
  body.market-home-view .home-modern .home-section-head{margin-bottom:12px!important}
  body.market-home-view .home-modern .home-section-title{color:#26243c!important;font-weight:900!important;letter-spacing:-.55px!important}
  body.market-home-view .home-modern .home-category{position:relative!important;border:1px solid rgba(126,105,218,.14)!important;background:linear-gradient(145deg,#fff,#f8f6ff)!important;box-shadow:0 6px 17px rgba(45,43,81,.06)!important}
  body.market-home-view .home-modern .home-category:active{transform:scale(.97)!important}
  body.market-home-view .home-modern .home-listings-grid{gap:12px!important}
  body.market-home-view .home-modern article.market-listing-card,body.market-home-view .home-modern .card.market-listing-card{overflow:hidden!important;border:1px solid rgba(106,98,154,.11)!important;border-radius:20px!important;background:linear-gradient(180deg,#fff,#fbfbff)!important;box-shadow:0 8px 23px rgba(37,39,70,.085)!important}
  body.market-home-view .home-modern article.market-listing-card .photo,body.market-home-view .home-modern .card.market-listing-card .photo{border-radius:18px 18px 0 0!important}
  body.market-home-view .home-modern article.market-listing-card .card-body,body.market-home-view .home-modern .card.market-listing-card .card-body{padding:11px 12px 13px!important}
  body.market-home-view .home-modern article.market-listing-card .price,body.market-home-view .home-modern .card.market-listing-card .price{color:#292344!important;font-weight:950!important}
  body.market-home-view .home-modern #smartSearchTags{gap:7px!important}
  body.market-home-view .home-modern #smartSearchTags button{border:1px solid #e7e2fb!important;border-radius:999px!important;background:#fff!important;color:#6556a8!important;box-shadow:0 3px 9px rgba(50,40,110,.045)!important}
  body.market-home-view nav.mobile-bottom-nav{position:fixed!important;left:8px!important;right:8px!important;width:auto!important;box-sizing:border-box!important;bottom:0!important;z-index:1200!important;height:calc(79px + env(safe-area-inset-bottom))!important;padding:7px 7px calc(7px + env(safe-area-inset-bottom))!important;border:1px solid rgba(116,99,204,.20)!important;border-radius:25px 25px 0 0!important;background:#fff!important;background-color:#fff!important;box-shadow:0 12px 36px rgba(35,34,75,.20)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;isolation:isolate!important}
  body.market-home-view nav.mobile-bottom-nav .mobile-bottom-btn{height:59px!important;border-radius:17px!important;color:#74798b!important;font-size:10px!important;font-weight:750!important}
  body.market-home-view nav.mobile-bottom-nav .mobile-bottom-btn.active{background:linear-gradient(140deg,#f0ebff,#f0f4ff)!important;color:#634ee0!important}
  body.market-home-view nav.mobile-bottom-nav .mobile-bottom-icon{color:currentColor!important}
  body.market-home-view nav.mobile-bottom-nav .mobile-bottom-create{border:4px solid #fff!important;border-radius:23px!important;background:linear-gradient(145deg,#805af8,#506fee)!important;box-shadow:0 9px 22px rgba(101,75,224,.35)!important}
  body.market-home-view #app{padding-bottom:calc(160px + env(safe-area-inset-bottom))!important}
  body:not(.market-home-view) .market-header{padding-top:env(safe-area-inset-top)!important}
  .alivo-legal-links{margin:20px 0 4px!important;padding:13px 14px!important;border:1px solid #e9e6f6!important;border-radius:17px!important;background:linear-gradient(135deg,#fff,#f8f7ff)!important}
}

/* iPhone Safari / Home Screen: restore a normal vertical document scroll on
   the marketplace and keep the home search below the safe-area-aware header. */
@media screen and (max-width: 760px) and (pointer: coarse) {
  html:has(body.market-home-view) {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  body.market-home-view {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  body.market-home-view .market-header {
    top: 0 !important;
    padding-top: 0 !important;
  }
  body.market-home-view .market-header-inner {
    min-height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    padding-right: max(17px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: 13px !important;
    padding-left: max(17px, env(safe-area-inset-left, 0px)) !important;
  }
  body.market-home-view #app {
    position: relative !important;
    height: auto !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(122px + env(safe-area-inset-bottom, 0px)) !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }
  body.market-home-view .home-modern,
  body.market-home-view .home-modern > .wrap {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }
  body.market-home-view .home-modern .home-hero {
    scroll-margin-top: calc(74px + env(safe-area-inset-top, 0px)) !important;
  }
  body.market-home-view .home-modern .home-categories,
  body.market-home-view .home-modern .home-category-track,
  body.market-home-view .home-modern #smartSearchTags {
    touch-action: pan-x pan-y !important;
    overscroll-behavior-x: contain !important;
  }

  /* Direct and support chats occupy the visible iPhone area. The entire page
     stays still; messages alone scroll, while back and compose controls stay put. */
  html:has(body #app > .chat-avito-screen),
  html:has(body #app > .support-chat-screen),
  body:has(#app > .chat-avito-screen),
  body:has(#app > .support-chat-screen) {
    width: 100% !important;
    height: var(--alivo-visible-chat-height, 100dvh) !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }
  body:has(#app > .chat-avito-screen),
  body:has(#app > .support-chat-screen) {
    position: fixed !important;
    top: var(--alivo-visible-chat-offset-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 !important;
  }
  body:has(#app > .chat-avito-screen) #app,
  body:has(#app > .support-chat-screen) #app {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: var(--alivo-visible-chat-height, 100dvh) !important;
    min-height: 0 !important;
    max-height: var(--alivo-visible-chat-height, 100dvh) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  body #app > .chat-avito-screen,
  body #app > .support-chat-screen {
    display: flex !important;
    flex: 1 1 0 !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--alivo-visible-chat-height, 100dvh) !important;
    min-height: 0 !important;
    max-height: var(--alivo-visible-chat-height, 100dvh) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  body .chat-avito-screen .chat-avito-panel,
  body .support-chat-screen .support-chat-layout,
  body .support-chat-screen .support-chat-panel {
    display: flex !important;
    flex: 1 1 0 !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }
  body .chat-avito-screen .chat-avito-old-topbar,
  body .support-chat-screen > .support-chat-page-top,
  body .support-chat-screen .support-chat-reason {
    display: none !important;
  }
  body .chat-avito-screen .chat-avito-peerbar,
  body .support-chat-screen .support-chat-header {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    min-height: 58px !important;
    padding-top: max(7px, env(safe-area-inset-top, 0px)) !important;
    padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: 7px !important;
    padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
  }
  body .chat-avito-screen .chat-avito-mobile-back,
  body .support-chat-screen .support-chat-mobile-back {
    display: flex !important;
    flex: 0 0 40px !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 13px !important;
    touch-action: manipulation !important;
  }
  body .chat-avito-screen .chat-avito-listing-card,
  body .support-chat-screen .support-chat-listing-card {
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    min-height: 54px !important;
    max-width: 100% !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  body .chat-avito-screen #messages.chat-avito-messages,
  body .support-chat-screen #supportMessages.support-chat-messages {
    display: block !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  body .chat-avito-screen .chat-avito-composer,
  body .support-chat-screen #supportMessageForm {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-bottom: max(7px, env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* iPhone keyboard: reclaim the quick-reply row and keep the composer just
   above the software keyboard instead of leaving safe-area-sized dead space. */
@media screen and (max-width: 760px) and (pointer: coarse) {
  body.market-keyboard-open .chat-avito-screen .chat-avito-quick {
    display: none !important;
  }
  body.market-keyboard-open .chat-avito-screen .chat-avito-composer {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }
  body.market-keyboard-open .chat-avito-screen #messages.chat-avito-messages,
  body.market-keyboard-open .support-chat-screen #supportMessages.support-chat-messages {
    padding-bottom: 8px !important;
    scroll-padding-bottom: 8px !important;
  }
}

@media screen and (max-width: 760px) and (pointer: coarse) {
  #alivoPushButton {
    position: relative !important;
    z-index: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 30px !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    overflow: visible !important;
  }
  #alivoPushButton::after{content:"";position:absolute;top:50%;left:50%;width:44px;height:44px;transform:translate(-50%,-50%);pointer-events:auto}
  #alivoPushButton[hidden] { display: none !important; }
}

@media screen and (max-width: 760px) and (pointer: coarse) {
  body:not(:has(#app > .chat-avito-screen)):not(:has(#app > .support-chat-screen)) nav.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    height: calc(79px + env(safe-area-inset-bottom)) !important;
    padding-bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    border-radius: 25px 25px 0 0 !important;
    background: #fff !important;
    background-color: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 1200 !important;
  }
}
