/* V152 audit / mobile hardening overrides */

/* Hide floating widgets while navigation overlays are open */
body.ub-drawer-open .ub-ai,
body.ub-mega-open .ub-ai,
body.ub-drawer-open .ub-cookie-manage,
body.ub-mega-open .ub-cookie-manage{
  opacity:0 !important;
  pointer-events:none !important;
  transform:translateY(10px) !important;
}

/* Product detail popular products: keep stable card widths even when item count is low */
.ub-pdp-popular-grid{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:12px;
  align-items:stretch;
  justify-content:flex-start !important;
}
.ub-pdp-popular-card{
  flex:0 0 240px !important;
  width:240px !important;
  min-width:240px !important;
  max-width:240px !important;
}
@media (max-width:640px){
  .ub-pdp-popular-card{
    flex-basis:100% !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
  }
}

/* Mobile header quick actions audit fix */
@media (max-width:640px){
  .ub-topbar__in{align-items:stretch}
  .ub-actions{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    justify-content:stretch;
  }
  .ub-actions > *{
    min-width:0;
    flex:0 1 auto !important;
  }
  .ub-action{
    min-height:64px;
    padding:12px 10px;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    gap:6px;
  }
  .ub-action__i{font-size:20px;line-height:1}
  .ub-action__t{
    display:block !important;
    font-size:11px;
    line-height:1.15;
    white-space:normal;
  }
}


/* V159: hide floating assistant/widgets hard when drawer/mega overlays are active */
body.ub-drawer-open #ubAiAssistant,
body.ub-mega-open #ubAiAssistant,
body.ub-drawer-open .ub-ai,
body.ub-mega-open .ub-ai{
  display:none !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transform:translate3d(0,24px,0) !important;
}
body.ub-drawer-open #ubAiAssistant .ub-ai__panel,
body.ub-mega-open #ubAiAssistant .ub-ai__panel{
  display:none !important;
}

/* V161: PDP popular products must keep fixed card widths and only stretch vertically */
.ub-pdp-popular-grid > .ub-pdp-popular-card{
  align-self:stretch !important;
  justify-self:auto !important;
  flex-grow:0 !important;
}
@media (max-width:640px){
  .ub-pdp-popular-grid > .ub-pdp-popular-card{
    flex-basis:100% !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
  }
}


/* V164: PDP popular products keep fixed desktop card widths; single items never stretch full-row. */
.ub-pdp-popular-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fill,minmax(230px,260px)) !important;
  gap:12px !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
}
.ub-pdp-popular-grid > .ub-pdp-popular-card{
  width:100% !important;
  min-width:0 !important;
  max-width:260px !important;
}
@media (max-width:640px){
  .ub-pdp-popular-grid{grid-template-columns:1fr !important;}
  .ub-pdp-popular-grid > .ub-pdp-popular-card{max-width:none !important;}
}
