/* BUYZZY compact product cards + smart catalogue image framing */
@layer buyzzy-shopping {
  .shelf-photo,.product-card .photo{
    aspect-ratio:1/1!important;
    background:#f7f8fb!important;
    overflow:hidden!important;
  }
  .shelf-photo img,.product-card .photo img{
    width:100%!important;
    height:100%!important;
    aspect-ratio:1/1!important;
    object-fit:cover!important;
    object-position:center!important;
    padding:0!important;
    transform:scale(1.015)!important;
    transform-origin:center!important;
    transition:transform .28s cubic-bezier(.2,.7,.2,1)!important;
  }
  .shelf-product,.product-card{
    transition:transform .18s ease,box-shadow .22s ease,border-color .22s ease!important;
    will-change:transform;
  }
  .shelf-product:active,.product-card:active{transform:scale(.988)!important}
  .shelf-product:hover,.product-card:hover{box-shadow:0 8px 22px rgba(31,55,88,.08)!important}
  .shelf-actions button,.product-actions button,#detailAdd,#detailBuy{
    transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease!important;
  }
  .shelf-actions button:active,.product-actions button:active,#detailAdd:active,#detailBuy:active{
    transform:scale(.975)!important;
  }

  #productDialog[open]::backdrop{
    background:rgba(15,29,49,.34)!important;
    animation:buyzzyBackdropIn .2s ease both;
  }
  #productDialog[open] .product-page-shell{
    animation:buyzzyProductIn .26s cubic-bezier(.22,.8,.24,1) both!important;
  }
  #productDialog[open] .detail-photo{
    animation:buyzzyPhotoIn .32s .04s cubic-bezier(.22,.8,.24,1) both!important;
  }
  .product-page-shell .gallery-main{
    background:#fbfcfe!important;
    border-color:#e5eaf0!important;
  }
  .product-page-shell .detail-photo{
    padding:4px!important;
    object-fit:contain!important;
  }
  .product-page-shell .detail-copy{
    background:#fff!important;
  }
  .product-page-shell .detail-actions{
    backdrop-filter:saturate(125%) blur(10px);
    background:rgba(255,255,255,.97)!important;
  }
  #detailBuy{box-shadow:0 6px 14px rgba(32,63,105,.18)!important}

  @keyframes buyzzyBackdropIn{from{opacity:0}to{opacity:1}}
  @keyframes buyzzyProductIn{from{opacity:0;transform:translateY(18px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}
  @keyframes buyzzyPhotoIn{from{opacity:.7;transform:scale(.97)}to{opacity:1;transform:scale(1)}}

  @media(max-width:760px){
    #featuredProducts .shelf-product,#newProducts .shelf-product{
      flex:0 0 calc((100% - 9px)/2)!important;
      width:calc((100% - 9px)/2)!important;
    }
    .shelf-copy{
      grid-template-rows:13px 34px 15px 24px 42px!important;
      gap:4px!important;
      padding:8px!important;
    }
    .product-body{
      grid-template-rows:13px 34px 15px 24px 18px 42px!important;
      gap:4px!important;
      padding:8px!important;
    }
    .shelf-copy h3,.product-body h3{
      height:34px!important;
      min-height:34px!important;
      max-height:34px!important;
      line-height:17px!important;
      font-size:12.5px!important;
    }
    .shelf-copy h3 button,.product-title-link{line-height:17px!important}
    .shelf-variant,.variant-line{height:15px!important;min-height:15px!important;line-height:15px!important}
    .shelf-price,.prices{height:24px!important;min-height:24px!important}
    .shelf-price strong,.prices strong{font-size:16px!important;line-height:22px!important}
    .product-meta{height:18px!important;min-height:18px!important}
    .shelf-actions,.product-actions{height:42px!important;min-height:42px!important;gap:5px!important}
    .shelf-actions button,.product-actions button{
      height:42px!important;
      min-height:42px!important;
      max-height:42px!important;
      font-size:10.5px!important;
      padding:4px 2px!important;
    }
    .shelf-wish,.wishlist-toggle{
      width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;
      top:7px!important;right:7px!important;font-size:20px!important;
    }
    .product-page-shell .detail-media{padding:8px!important}
    .product-page-shell .gallery-main{border-radius:10px!important}
    .product-page-shell .detail-copy{padding:8px 15px 18px!important}
  }

  .sort-menu-wrap{position:relative!important}
  .sort-trigger{
    height:38px!important;min-width:126px!important;max-width:154px!important;
    border:1px solid #dbe3ec!important;border-radius:11px!important;background:#fff!important;
    color:#24364a!important;padding:5px 9px 5px 10px!important;
    display:grid!important;grid-template-columns:1fr 16px!important;grid-template-rows:12px 17px!important;
    column-gap:5px!important;text-align:left!important;align-items:center!important;
    box-shadow:0 2px 8px rgba(31,55,88,.055)!important;cursor:pointer!important;
  }
  .sort-trigger>span{grid-column:1;font-size:8.5px!important;line-height:11px!important;color:#718096!important;font-weight:700!important;letter-spacing:.04em!important;text-transform:uppercase!important}
  .sort-trigger>b{grid-column:1;font-size:11px!important;line-height:16px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .sort-trigger>svg{grid-column:2;grid-row:1/3;width:15px!important;height:15px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;transition:transform .18s ease!important}
  .sort-trigger[aria-expanded="true"]>svg{transform:rotate(180deg)!important}
  #sortButton,#sortMenu{overflow-anchor:none!important}
    .sort-menu{
    position:absolute!important;right:0!important;top:46px!important;z-index:90!important;
    width:min(272px,calc(100vw - 32px))!important;padding:6px!important;
    border:1px solid #dde4ec!important;border-radius:14px!important;background:#fff!important;
    box-shadow:0 18px 44px rgba(24,40,62,.18)!important;
  }
  .sort-menu[hidden]{display:none!important}
  .sort-menu:not([hidden]){display:grid!important;gap:2px!important;animation:sortMenuIn .11s ease both!important}
  .sort-menu button{
    min-height:50px!important;border:0!important;border-radius:10px!important;background:transparent!important;
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;
    padding:7px 9px!important;text-align:left!important;color:#24364a!important;cursor:pointer!important;
  }
  .sort-menu button:active,.sort-menu button.is-selected{background:#f2f7fb!important}
  .sort-menu button span{display:grid!important;gap:2px!important}
  .sort-menu button b{font-size:12px!important;line-height:16px!important}
  .sort-menu button small{font-size:9.5px!important;line-height:13px!important;color:#7b8796!important}
  .sort-menu button i{font-style:normal!important;color:#15806f!important;font-size:15px!important;opacity:0!important}
  .sort-menu button.is-selected i{opacity:1!important}
  @keyframes sortMenuIn{from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:none}}

  @media(max-width:760px){
    #featuredProducts.discovery-grid,#newProducts.discovery-grid{
      padding-left:12px!important;padding-right:12px!important;
      scroll-padding-left:12px!important;scroll-padding-right:12px!important;
    }
    #productsSection .catalog-toolbar{
      position:relative!important;min-height:64px!important;
      padding:9px 9px 9px 12px!important;margin:0 0 11px!important;
      display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
      background:#fff!important;border:1px solid #e1e7ee!important;border-radius:14px!important;
      box-shadow:0 4px 14px rgba(31,55,88,.055)!important;
    }
    #productsSection .catalog-toolbar:before{display:none!important}
    #productsSection .catalog-heading{min-width:0!important;flex:1!important}
    #productsSection .catalog-heading h2{font-size:20px!important;line-height:23px!important;letter-spacing:-.025em!important;margin:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
    #productsSection .catalog-heading span{font-size:9.5px!important;line-height:13px!important;margin-top:3px!important;color:#7b8796!important}
    #productsSection .catalog-actions{flex:0 0 auto!important;margin:0!important}
    #productsSection .clear-filters{display:none!important}
    .sort-trigger{min-width:118px!important;max-width:132px!important;height:40px!important;touch-action:manipulation!important}
    .shelf-photo,.product-card .photo{
      aspect-ratio:auto!important;
      height:clamp(150px,42vw,164px)!important;
      min-height:clamp(150px,42vw,164px)!important;
      max-height:164px!important;
    }
    body.sort-menu-open::before{display:none!important}
    .sort-menu{
      position:fixed!important;
      left:14px!important;right:14px!important;top:auto!important;
      bottom:calc(78px + env(safe-area-inset-bottom))!important;
      z-index:9999!important;width:auto!important;max-width:none!important;
      padding:8px!important;border-radius:18px!important;
      border:1px solid #dbe3ec!important;background:#fff!important;
      box-shadow:0 18px 46px rgba(18,32,50,.22)!important;
    }
    .sort-menu:not([hidden]){
      display:grid!important;gap:3px!important;
      animation:sortSheetIn .16s cubic-bezier(.2,.75,.25,1) both!important;
    }
    .sort-menu:before{
      content:"Sort products";display:block;padding:6px 9px 8px;
      font-size:12px;font-weight:850;color:#24364a;letter-spacing:-.01em;
    }
    .sort-menu button{min-height:48px!important;touch-action:manipulation!important}
    @keyframes sortSheetIn{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
  }

  @media(max-width:760px){
    #store #productsSection #allProducts .card-photo-wrap{
      position:relative!important;
      height:164px!important;
      min-height:164px!important;
      max-height:164px!important;
      overflow:hidden!important;
    }
    #store #productsSection #allProducts .product-card .photo{
      position:absolute!important;
      inset:0!important;
      width:100%!important;
      height:100%!important;
      min-height:0!important;
      max-height:none!important;
      margin:0!important;
      padding:0!important;
      line-height:0!important;
      overflow:hidden!important;
    }
    #store #productsSection #allProducts .product-card .photo img{
      object-fit:cover!important;
      object-position:50% 60%!important;
      padding:0!important;
      transform:translateY(8%) scale(1.10)!important;
      transform-origin:50% 60%!important;
      transition:none!important;
    }
    #store #productsSection #allProducts .product-card.visual-denim .photo img{
      transform:translateY(8%) scale(1.18)!important;
      transform-origin:50% 62%!important;
      object-position:50% 62%!important;
    }
    #store #productsSection #allProducts .product-card.visual-footwear .photo img{
      transform:translateY(9%) scale(1.11)!important;
      transform-origin:50% 61%!important;
      object-position:50% 61%!important;
    }
    #store #productsSection #allProducts .product-card.visual-apparel .photo img{
      transform:translateY(5%) scale(1.10)!important;
      transform-origin:50% 58%!important;
      object-position:50% 58%!important;
    }
  }

  /* duplicate generic mobile image override removed */

  @media(prefers-reduced-motion:reduce){
    #productDialog[open] .product-page-shell,#productDialog[open] .detail-photo,#productDialog[open]::backdrop{animation:none!important}
    .shelf-photo img,.product-card .photo img,.shelf-product,.product-card,.shelf-actions button,.product-actions button,#detailAdd,#detailBuy{transition:none!important}
  }
}