/* KPZ Mobile Finish 2026-10-24: consistent marketplace tiles & listings.
   Loaded after legacy layers so styles remain isolated and reversible. */
@media(max-width:780px){
  :root{--kpz-touch:44px}
  body{background:#f5f8fd}
  .kpz-main{min-width:0}
  .kpz-subpage{padding-top:18px!important;padding-bottom:42px!important}
  .kpz-subpage>h1{font-size:clamp(25px,6.2vw,33px)!important;line-height:1.17;color:#092e69;margin:3px 0 15px!important}
  .kpz-subpage>.kpz-kicker{font-size:10px!important;margin:0 0 5px!important}

  /* Homepage category panel */
  body.home .kpz-main .kpz-categories-v3{
    width:calc(100% - 20px)!important;
    max-width:100%!important;
    margin:10px auto 0!important;
    padding:13px 10px 12px!important;
    background:#fff;
    border:1px solid #e2ebf7;
    border-radius:18px!important;
    box-shadow:0 5px 19px rgba(7,47,110,.06);
  }
  body.home .kpz-categories-v3 .kpz-section-heading{margin:1px 2px 13px!important;gap:10px!important}
  body.home .kpz-categories-v3 .kpz-section-heading h2{
    font-size:clamp(18px,4.7vw,21px)!important;
    font-weight:850;
    line-height:1.16;
    letter-spacing:-.025em;
  }
  body.home .kpz-categories-v3 .kpz-section-heading>a{
    font-size:11px!important;
    color:#0953b2;
    flex-shrink:0;
    min-height:40px;
    display:inline-flex;
    align-items:center;
  }
  body.home .kpz-categories-v3 .kpz-cat-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
    align-items:stretch!important;
  }
  body.home .kpz-categories-v3 .kpz-cat{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%;
    min-width:0!important;
    min-height:118px!important;
    padding:8px 5px 10px!important;
    gap:2px!important;
    border-radius:13px!important;
    border:1px solid #e4ecf8;
    box-shadow:none!important;
    transition:transform .16s ease,border-color .16s ease;
  }
  body.home .kpz-categories-v3 .kpz-cat:active{transform:scale(.975)}
  body.home .kpz-categories-v3 .kpz-cat:focus-visible{outline:3px solid #0b5fe0;outline-offset:2px}
  body.home .kpz-categories-v3 .kpz-cat-icon{
    height:71px!important;
    min-height:71px;
    max-height:71px;
    display:flex!important;
    justify-content:center;
    align-items:center;
    overflow:hidden!important;
    width:100%!important;
  }
  body.home .kpz-categories-v3 .kpz-cat-icon img{
    display:block;
    height:68px!important;
    max-height:68px!important;
    width:auto!important;
    max-width:95%!important;
    object-fit:contain!important;
    margin:auto;
  }
  body.home .kpz-categories-v3 .kpz-cat-title{
    width:100%;
    max-width:100%!important;
    min-height:29px!important;
    margin:0 auto!important;
    padding:0 1px!important;
    display:-webkit-box!important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden!important;
    font-size:11.5px!important;
    font-weight:800;
    line-height:1.24!important;
    letter-spacing:-.015em;
    text-align:center;
    overflow-wrap:anywhere;
    color:#10366e;
  }
  body.home .kpz-categories-v3 .kpz-cat:first-child .kpz-cat-title{color:#fff}
  body.home .kpz-categories-v3 .kpz-cat-preview{display:none!important}
  body.home .kpz-categories-v3.kpz-mobile-cats-collapsed>.kpz-cat-grid>.kpz-cat:nth-child(n+10),
  body.home .kpz-categories-v3.kpz-mobile-cats-collapsed>.kpz-more-categories{display:none!important}
  .kpz-cats-mobile-more{
    width:100%;display:flex;align-items:center;justify-content:center;gap:7px;
    margin-top:10px;min-height:45px;
    background:#ecf4ff;color:#094eaa;
    border:1px solid #ccdcf3;border-radius:12px;
    font-size:12px;font-weight:850;cursor:pointer;
  }
  .kpz-cats-mobile-more:hover{background:#e2efff}
  .kpz-cats-mobile-more:focus-visible{outline:3px solid #0a61d7;outline-offset:2px}
  body.home .kpz-categories-v3 .kpz-more-categories{
    border-top:1px solid #e5edf8;
    margin-top:10px;
    padding-top:8px;
  }
  body.home .kpz-categories-v3 .kpz-more-categories summary{font-size:12px}
  /* Consistent listing cards in all catalog sections */
  .kpz-card-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
    gap:10px!important;
  }
  .kpz-card-grid>.kpz-ad-card{
    display:flex;
    flex-direction:column;
    min-width:0!important;
    height:100%;
    overflow:hidden!important;
    background:white;
    border:1px solid #e0e9f5;
    border-radius:14px!important;
    box-shadow:0 4px 13px rgba(9,53,119,.07)!important;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-card-pic{
    display:block;
    width:100%;
    aspect-ratio:4 / 3!important;
    flex:none;
    position:relative;
    background:#f0f5fc;
    overflow:hidden;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-card-pic img{
    display:block;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    object-position:center;
    margin:0;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-ad-details{
    display:flex;
    flex:1;
    flex-direction:column;
    min-width:0;
    padding:10px 10px 11px!important;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-card-title{
    display:-webkit-box!important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    min-height:36px!important;
    max-height:38px;
    line-height:1.4!important;
    font-size:12.5px!important;
    color:#18345c;
    font-weight:800;
    white-space:normal!important;
    overflow:hidden;
    overflow-wrap:anywhere;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-price{
    margin:auto 0 5px!important;
    padding-top:8px;
    color:#0647a8!important;
    line-height:1.2;
    font-size:18px!important;
    font-weight:900;
    word-break:normal;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-card-meta{
    display:flex;
    flex-wrap:wrap;
    gap:5px;
    align-items:center;
    justify-content:flex-start!important;
    min-height:19px;
    line-height:1.3;
    color:#627999;
    font-size:10px!important;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-verified{
    font-size:9px!important;
    padding:3px 5px;
    color:#0b5cba;
    white-space:nowrap;
  }
  .kpz-card-grid>.kpz-ad-card .kpz-heart-button,
  .kpz-card-grid>.kpz-ad-card .kpz-heart-form .kpz-heart-button{
    position:absolute;
    top:7px!important;
    right:7px!important;
    width:36px!important;
    height:36px!important;
    display:grid;place-items:center;
    background:rgba(255,255,255,.96);
    color:#0b4f9b;
    border-radius:50%;
    box-shadow:0 3px 9px #0b336533;
    font-size:22px!important;
    line-height:1;
  }
  .kpz-section-heading{gap:8px!important}
  .kpz-section-heading h2{font-size:19px!important;line-height:1.2}
  .kpz-section-heading>a{min-height:36px;display:inline-flex;align-items:center}
  .kpz-section-heading p{font-size:12px;line-height:1.45}

  /* Catalog search and advanced filters: avoid overwide fields on phones */
  .kpz-subpage>.kpz-search{margin:10px 0 16px}
  .kpz-subpage>.kpz-search input,.kpz-subpage>.kpz-search select{min-height:44px}
  .kpz-subpage>.kpz-search .kpz-btn{min-height:44px}
  .kpz-subpage>.kpz-filters{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    align-items:end;
    padding:13px!important;
    margin:14px 0 20px!important;
    border-radius:15px!important;
    box-shadow:0 4px 12px rgba(12,54,107,.04);
  }
  .kpz-subpage>.kpz-filters label{
    display:flex;flex-direction:column;gap:5px;
    min-width:0;
    width:100%;
    font-size:12px;
    line-height:1.3;
    font-weight:800;
  }
  .kpz-subpage>.kpz-filters select,
  .kpz-subpage>.kpz-filters input{
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    min-height:44px;
    font-size:16px!important;
    padding:9px 8px;
    border-radius:10px;
  }
  .kpz-subpage>.kpz-filters label:first-child{grid-column:1/-1}
  .kpz-subpage>.kpz-filters .kpz-btn{
    grid-column:1/-1;
    width:100%;min-height:45px;
    margin:2px 0 0;
    border-radius:11px;
  }
  .kpz-subcats{padding:14px!important;border-radius:15px;margin:14px 0 18px}
  .kpz-subcats h2{font-size:17px!important;line-height:1.25;margin:4px 0 12px}
  .kpz-subcats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .kpz-subcats-grid a{
    gap:7px;
    min-width:0;min-height:64px;
    padding:9px 8px;
    border-radius:11px;
  }
  .kpz-subcats-grid a strong{font-size:11.5px;overflow-wrap:anywhere}
  .kpz-subcats-grid a>span:first-child{padding:5px}
  .kpz-subcats-grid a>span:last-child{font-size:15px}
}
@media(min-width:781px){.kpz-cats-mobile-more{display:none!important}}
@media(max-width:375px){
  .kpz-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.home .kpz-categories-v3 .kpz-cat-grid{gap:6px!important}
  body.home .kpz-categories-v3 .kpz-cat{padding:7px 3px 9px!important;min-height:112px!important}
  body.home .kpz-categories-v3 .kpz-cat-icon{height:64px!important;min-height:64px}
  body.home .kpz-categories-v3 .kpz-cat-icon img{height:61px!important;max-height:61px!important}
  body.home .kpz-categories-v3 .kpz-cat-title{font-size:10.8px!important}
  .kpz-card-grid{gap:8px!important}
  .kpz-card-grid>.kpz-ad-card .kpz-ad-details{padding:8px!important}
  .kpz-card-grid>.kpz-ad-card .kpz-price{font-size:16px!important}
}
@media(max-width:320px){
  body.home .kpz-categories-v3 .kpz-cat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kpz-card-grid{grid-template-columns:1fr!important}
  .kpz-subcats-grid{grid-template-columns:1fr!important}
}
@media(prefers-reduced-motion:reduce){
  body.home .kpz-categories-v3 .kpz-cat{transition:none!important}
}
