/* SARAIL MARKET - balanced desktop layout + full-width mobile authentication panels */
/* Desktop: keep the original right-aligned two-card layout and reserve the left area for artwork. */
#authGrid{
  box-sizing:border-box!important;
  width:75%!important;
  max-width:1000px!important;
  margin:0 0 0 auto!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px!important;
  align-items:stretch!important;
}
#authGrid>.auth-panel{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
}
#authGrid .auth-panel form,
#authGrid .auth-panel label{width:100%;min-width:0}
#authGrid .auth-panel input,
#authGrid .auth-panel select,
#authGrid .auth-panel textarea{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
/* Tablet and narrow laptop: stack cards only when two columns become cramped. */
@media(max-width:900px){
  #authGrid{
    width:100%!important;
    max-width:720px!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:16px!important;
    margin:0 auto!important;
  }
  #authGrid>.auth-panel{
    min-height:0!important;
    padding:clamp(18px,4vw,28px)!important;
    border-radius:19px!important;
  }
  #authGrid .card-head{gap:12px;align-items:center}
  #authGrid .card-head h2{font-size:clamp(18px,3vw,22px)!important}
  #authGrid .auth-panel input,
  #authGrid .auth-panel select{min-height:48px!important;font-size:16px!important}
}
@media(max-width:600px){
  .wrap{width:calc(100% - 24px)!important;max-width:none!important}
  #authGrid{
    width:100%!important;
    max-width:none!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
    padding:0!important;
  }
  #authGrid>.auth-panel{
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:18px 16px!important;
    border-radius:16px!important;
  }
  #authGrid .card-head{width:100%;min-width:0}
  #authGrid .card-head>div:first-child{min-width:0;flex:1}
  #authGrid .card-head p{line-height:1.9}
  #authGrid .auth-panel form{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  #authGrid .auth-panel label{display:block;width:100%;font-size:13px}
  #authGrid .auth-panel input,
  #authGrid .auth-panel select,
  #authGrid .auth-panel textarea{
    display:block!important;
    width:100%!important;
    min-height:49px!important;
    margin-top:7px!important;
    font-size:16px!important;
  }
  #authGrid .auth-panel button,
  #authGrid .auth-panel .btn{min-height:48px;max-width:100%}
  #authGrid .benefit-strip{width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:380px){
  #authGrid>.auth-panel{padding:16px 13px!important}
  #authGrid .card-head h2{font-size:17px!important}
  #authGrid .benefit-strip{grid-template-columns:minmax(0,1fr)!important}
}

/* Mobile-only fix v4: target the actual store-return link and override the
   small-phone hide rule. Cache key is bumped in marketplace/index.php. */
@media screen and (max-width:760px){
  .site-header{
    display:flex!important;
    flex-wrap:wrap!important;
    row-gap:10px!important;
  }
  .site-header > .header-actions{
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    flex:1 0 100%!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    min-width:0!important;
  }
  .site-header > .header-actions > a[href="../index.html"]{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    position:static!important;
    flex:0 0 auto!important;
    align-items:center!important;
    justify-content:center!important;
    order:-1!important;
    white-space:nowrap!important;
    min-height:40px!important;
    padding:8px 14px!important;
  }
  #login .login-brand-logo{
    margin-top:auto!important;
    padding-top:22px!important;
    transform:translateY(-12px)!important;
  }
}
@media screen and (max-width:420px){
  .site-header > .header-actions > a[href="../index.html"]{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
  }
}
