/*
 * JBA v16.20.180 — desktop-only flat marketplace mega menu.
 * Purpose: match the clean Javaher Bazar ordering model: a fixed category rail
 * on the right and one flat top-to-bottom list of subcategories across columns.
 * Mobile/tablet navigation below 992px is intentionally untouched.
 */
@media (min-width:992px){
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-mega-shell{
    height:min(470px,calc(100vh - var(--jba-v1620175-top,142px) - 12px))!important;
    min-height:410px!important;
    max-height:470px!important;
    overflow:hidden!important;
    background:#fff!important;
  }

  /* Right-hand primary category rail, close to the marketplace reference. */
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-rail{
    flex:0 0 190px!important;
    width:190px!important;
    min-width:190px!important;
    max-width:190px!important;
    height:100%!important;
    padding:8px 0!important;
    border-left:1px solid #eceef2!important;
    background:#fff!important;
    overflow:hidden!important;
    scrollbar-width:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-rail::-webkit-scrollbar{
    display:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-tab{
    height:50px!important;
    min-height:50px!important;
    padding:0 17px!important;
    gap:0!important;
    border-radius:0!important;
    background:#fff!important;
    color:#17191f!important;
    font-size:14px!important;
    font-weight:750!important;
    line-height:1.5!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-tab::before{
    display:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-icon{
    display:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-arrow{
    display:inline-block!important;
    margin-right:auto!important;
    color:#7c49ba!important;
    font-size:18px!important;
    font-weight:900!important;
    line-height:1!important;
    opacity:0!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-tab:hover,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-tab:focus-visible,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-tab.is-active{
    background:#f7df9b!important;
    color:#44206e!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-tab.is-active .jba-v1620175-category-arrow{
    opacity:1!important;
  }

  /* Content is a single flat list; old panel heading/group wrappers are gone. */
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-content{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
    overscroll-behavior:none!important;
    scrollbar-width:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-content::-webkit-scrollbar{
    display:none!important;
    width:0!important;
    height:0!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-panel{
    box-sizing:border-box!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    padding:28px 34px 26px!important;
    overflow:hidden!important;
    animation:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-panel[hidden]{
    display:none!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-panel-head,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-groups,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-group{
    display:none!important;
  }

  /*
   * Exact ordering model: fill each column from top to bottom, then continue
   * into the next column from right to left. Rows are recalculated by JS after
   * legacy links are appended, so no category is omitted and no scroll appears.
   */
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links{
    --jba-v1620180-rows:var(--jba-v1620180-rows-6,8);
    display:grid!important;
    grid-auto-flow:column!important;
    grid-template-rows:repeat(var(--jba-v1620180-rows),minmax(22px,1fr))!important;
    grid-auto-columns:minmax(126px,1fr)!important;
    align-content:start!important;
    align-items:center!important;
    justify-content:stretch!important;
    column-gap:24px!important;
    row-gap:2px!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    direction:rtl!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links > a,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat a{
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    height:100%!important;
    min-height:30px!important;
    margin:0!important;
    padding:2px 5px!important;
    border:0!important;
    border-radius:5px!important;
    background:transparent!important;
    color:#526b9f!important;
    font-family:inherit!important;
    font-size:14px!important;
    font-weight:650!important;
    line-height:1.55!important;
    text-align:right!important;
    text-decoration:none!important;
    white-space:normal!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    transition:background-color .1s ease,color .1s ease!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links > a:hover,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links > a:focus-visible,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat a:hover,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat a:focus-visible{
    background:#f5f7fb!important;
    color:#0a2861!important;
    outline:0!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-all-link{
    color:#203f7d!important;
    font-weight:850!important;
  }

  /* The hidden legacy source can append future categories into this exact grid. */
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat:not([hidden]),
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat:not([hidden]) > span{
    display:contents!important;
  }
}

@media (min-width:1200px) and (max-width:1439px){
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links{
    --jba-v1620180-rows:var(--jba-v1620180-rows-5,9)!important;
    column-gap:21px!important;
  }
}

@media (min-width:992px) and (max-width:1199px){
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-category-rail{
    flex-basis:176px!important;
    width:176px!important;
    min-width:176px!important;
    max-width:176px!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-panel{
    padding-right:22px!important;
    padding-left:22px!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links{
    --jba-v1620180-rows:var(--jba-v1620180-rows-5,10)!important;
    grid-auto-columns:minmax(105px,1fr)!important;
    column-gap:16px!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links > a,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat a{
    font-size:13.5px!important;
  }
}

@media (min-width:1440px){
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links{
    --jba-v1620180-rows:var(--jba-v1620180-rows-6,8)!important;
  }
}

@media (min-width:992px) and (max-height:720px){
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-mega-shell{
    height:min(420px,calc(100vh - var(--jba-v1620175-top,142px) - 8px))!important;
    min-height:380px!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620175-panel{
    padding-top:20px!important;
    padding-bottom:18px!important;
  }

  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-flat-links > a,
  html body > .jba-v1620175-mega.jba-v1620180-flat-marketplace .jba-v1620180-auto-flat a{
    min-height:27px!important;
    font-size:13px!important;
    line-height:1.4!important;
  }
}
