/* Jahankala Final Polish v2.3 — shared finishing layer */
:root{--jk-focus:#ff5a36;--jk-surface:#fff;--jk-soft:#f6f8fb;--jk-text:#10263f;--jk-muted:#728094}
html{scroll-behavior:smooth;scroll-padding-top:105px}body{overflow-x:hidden}
*{box-sizing:border-box}img{max-width:100%}button,input,select,textarea{font:inherit}
::selection{background:rgba(255,90,54,.18);color:#10263f}
:focus-visible{outline:3px solid rgba(255,90,54,.32)!important;outline-offset:3px!important}
a,button,[role="button"]{-webkit-tap-highlight-color:transparent}
button:disabled,[aria-disabled="true"]{cursor:not-allowed;opacity:.62}
input,select,textarea{min-height:44px}
textarea{resize:vertical}
input::placeholder,textarea::placeholder{color:#9aa5b2;opacity:1}
input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-text-fill-color:#10263f;-webkit-box-shadow:0 0 0 1000px #fff inset;transition:background-color 9999s ease-out}

/* visual consistency */
.jk-shell{margin-inline:auto}
.jk-section-head h1,.jk-section-head h2,.jk-section-head h3{letter-spacing:-.02em}
.jk-primary-btn,.jk-add-cart,.jkc-pay-btn,.jka-primary,.jkp-add-cart{box-shadow:0 8px 22px rgba(15,39,66,.10)}
.jk-primary-btn:hover,.jk-add-cart:hover,.jkc-pay-btn:hover,.jka-primary:hover,.jkp-add-cart:hover{transform:translateY(-1px)}
.jk-product-card,.jkc-card,.jka-card,.jkp-card{isolation:isolate}
.jk-product-card img,.jkp-gallery img{user-select:none;-webkit-user-drag:none}

/* better scroll areas */
.jk-product-row,.jk-brand-grid,.jk-category-grid,.jk-cars-list{scrollbar-width:thin;scrollbar-color:#cbd4dd transparent}
.jk-product-row::-webkit-scrollbar,.jk-brand-grid::-webkit-scrollbar,.jk-category-grid::-webkit-scrollbar,.jk-cars-list::-webkit-scrollbar{height:5px}
.jk-product-row::-webkit-scrollbar-thumb,.jk-brand-grid::-webkit-scrollbar-thumb,.jk-category-grid::-webkit-scrollbar-thumb,.jk-cars-list::-webkit-scrollbar-thumb{background:#cbd4dd;border-radius:20px}

/* tables and long content */
table{max-width:100%}.jk-table-wrap,.jka-table-wrap,.jkc-table-wrap{overflow:auto;-webkit-overflow-scrolling:touch}
.jk-empty,.jka-empty,.jkc-empty,.jkp-empty{border:1px dashed #d8e0e8;background:linear-gradient(180deg,#fff,#fafbfd);border-radius:20px;padding:34px 22px;text-align:center;color:#728094}

/* public/account form finish */
.jka-field input,.jka-field select,.jka-field textarea,.jkp-field input,.jkp-field select,.jkp-field textarea{transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}
.jka-field input:focus,.jka-field select:focus,.jka-field textarea:focus,.jkp-field input:focus,.jkp-field select:focus,.jkp-field textarea:focus{border-color:#9fb1c5;box-shadow:0 0 0 4px rgba(15,39,66,.06)}

/* header/footer final details */
.jk-header{backdrop-filter:saturate(1.05);-webkit-backdrop-filter:saturate(1.05)}
.jk-footer a{transition:color .18s ease,opacity .18s ease}.jk-footer a:hover{opacity:1}
.jk-mobile-nav{padding-bottom:max(5px,env(safe-area-inset-bottom))}

/* 404 */
.jk-error-page{min-height:100svh;background:radial-gradient(circle at 80% 10%,rgba(255,90,54,.08),transparent 34%),#f5f7fa;display:grid;place-items:center;padding:28px}
.jk-error-card{width:min(720px,100%);background:#fff;border:1px solid #dfe5ec;border-radius:30px;padding:48px 38px;text-align:center;box-shadow:0 24px 65px rgba(15,39,66,.10)}
.jk-error-code{font-size:76px;font-weight:900;line-height:1;color:#0f2742;letter-spacing:-4px}.jk-error-code span{color:#ff5a36}
.jk-error-card h1{margin:18px 0 8px;font-size:25px;color:#10263f}.jk-error-card p{margin:0 auto 24px;max-width:540px;color:#728094;font-size:12px;line-height:2.1}
.jk-error-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.jk-error-actions a{min-height:46px;padding:0 18px;border-radius:14px;display:inline-flex;align-items:center;gap:8px;font-size:11px;font-weight:800;border:1px solid #dfe5ec;background:#fff;color:#10263f}.jk-error-actions a:first-child{background:#0f2742;color:#fff;border-color:#0f2742}.jk-error-actions img{width:17px}.jk-error-actions a:first-child img{filter:brightness(0) invert(1)}

@media(max-width:900px){
  html{scroll-padding-top:80px}
  body{padding-bottom:max(84px,calc(76px + env(safe-area-inset-bottom)))}
  .jk-shell{width:min(100% - 22px,var(--jk-shell,1320px))}
  .jk-section-head{gap:12px}
  .jk-link-btn{min-height:38px;display:inline-flex;align-items:center}
  .jk-error-card{padding:36px 22px;border-radius:24px}.jk-error-code{font-size:62px}
}
@media(max-width:560px){
  .jk-section-head{align-items:flex-start!important}
  .jk-section-title h2{line-height:1.6}
  .jk-primary-btn,.jk-ghost-btn,.jkc-pay-btn,.jka-primary{min-height:44px}
  .jk-error-page{padding:14px}.jk-error-card{padding:30px 18px}.jk-error-code{font-size:52px}.jk-error-card h1{font-size:20px}.jk-error-actions a{width:100%;justify-content:center}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* ===== v2.7.7 Mobile Overflow & Product Grid Hotfix ===== */
html,body{
  width:100%;
  max-width:100%;
  overflow-x:hidden!important;
}
main,header,footer,section,.jk-shell,.jk-product-sections,.jk-product-group{
  min-width:0;
  max-width:100%;
}

@media(max-width:720px){
  html,body{overflow-x:clip!important}
  body{position:relative}

  .jk-shell{
    width:calc(100% - 20px)!important;
    max-width:calc(100% - 20px)!important;
    margin-inline:auto!important;
  }

  .jk-header__main,
  .jk-header__actions,
  .jk-search-mobile-wrap,
  .jk-search--mobile,
  .jk-section,
  .jk-products-section,
  .jk-product-sections,
  .jk-product-group{
    min-width:0!important;
    max-width:100%!important;
  }

  /* Horizontal rails stay inside their own box and never drag the page. */
  .jk-cars,
  .jk-cars--v273,
  .jk-category-grid,
  .jk-brand-grid,
  .jk-promo-grid{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
    touch-action:pan-x;
  }

  #cars .jk-shell,
  #categories .jk-shell,
  .jk-products-section .jk-shell{
    width:calc(100% - 20px)!important;
    max-width:calc(100% - 20px)!important;
    overflow:hidden!important;
    margin-inline:auto!important;
  }

  /* The product list is a real responsive grid on mobile, not a wide carousel. */
  .jk-product-group{
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
    padding:10px!important;
    border-radius:16px!important;
  }
  .jk-product-group__head{
    gap:8px!important;
    margin-bottom:10px!important;
  }
  .jk-product-group__head h3{
    min-width:0!important;
    font-size:12px!important;
  }
  .jk-product-group__head a{
    flex:0 0 auto!important;
    font-size:8.5px!important;
  }
  .jk-product-row{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    padding:0!important;
    scroll-snap-type:none!important;
  }
  .jk-product-card{
    flex:initial!important;
    flex-basis:auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
    border-radius:14px!important;
  }
  .jk-product-card__media{
    width:100%!important;
    height:auto!important;
    aspect-ratio:1/1!important;
  }
  .jk-product-card__media img{
    width:100%!important;
    height:100%!important;
    padding:8px!important;
    object-fit:contain!important;
  }
  .jk-product-card__body{padding:9px!important;min-width:0!important}
  .jk-product-card__brand{font-size:7.5px!important;height:16px!important}
  .jk-product-card h4{
    font-size:9.5px!important;
    line-height:1.75!important;
    min-height:34px!important;
  }
  .jk-product-card__compat{font-size:7px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .jk-product-card__price{font-size:10.5px!important}
  .jk-product-card__price small{font-size:7px!important}
  .jk-product-card__badge{top:7px!important;right:7px!important;font-size:7.5px!important;padding:3px 6px!important}
  .jk-product-card__fav{top:7px!important;left:7px!important;width:28px!important;height:28px!important}
  .jk-product-card__actions{gap:5px!important;margin-top:7px!important}
  .jk-add-cart{height:34px!important;font-size:7.5px!important;padding-inline:5px!important;white-space:nowrap}
  .jk-add-cart img{width:13px!important}
  .jk-view-product{width:34px!important;height:34px!important;flex:0 0 34px!important}

  .jk-mobile-nav{
    left:10px!important;
    right:10px!important;
    width:auto!important;
    max-width:calc(100% - 20px)!important;
  }
}

@media(max-width:390px){
  .jk-shell,
  #cars .jk-shell,
  #categories .jk-shell,
  .jk-products-section .jk-shell{
    width:calc(100% - 14px)!important;
    max-width:calc(100% - 14px)!important;
  }
  .jk-product-row{gap:6px!important}
  .jk-product-group{padding:7px!important}
  .jk-product-card__body{padding:7px!important}
  .jk-product-card h4{font-size:9px!important}
  .jk-product-card__price{font-size:10px!important}
  .jk-view-product{display:none!important}
  .jk-add-cart{width:100%!important}
}


/* ===== v2.19.0 Mobile Chat / Bottom Nav Harmony ===== */
@media(max-width:900px){
  body.jk-ai-open .jk-mobile-nav{
    opacity:0!important;
    pointer-events:none!important;
    transform:translateY(18px)!important;
    transition:opacity .18s ease,transform .18s ease!important;
  }
  body.jk-ai-open{overflow:hidden!important}
}
