/* Store UI repair and shopping helpers. Loaded last on every storefront page. */

/* Category rail: keep it in normal flow and stop it covering the section heading. */
body.page-home .cat-chips-bar{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  z-index:2!important;
  width:100%!important;
  max-width:100%!important;
  margin:1.15rem 0 1.45rem!important;
  padding:.45rem!important;
  overflow:hidden!important;
  border:1px solid var(--beige-dark)!important;
  border-radius:18px!important;
  background:var(--surface)!important;
  box-shadow:0 8px 24px rgba(24,35,45,.055)!important;
  backdrop-filter:none!important;
}
body.page-home .cat-chips-bar::after{display:none!important}
body.page-home .cat-chips-scroll{
  display:flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:.45rem!important;
  width:100%!important;
  padding:.08rem!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scroll-padding-inline:.5rem!important;
  scroll-snap-type:x proximity!important;
  overscroll-behavior-inline:contain!important;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch!important;
}
body.page-home .cat-chips-scroll::-webkit-scrollbar{display:none!important}
body.page-home .cat-chip{
  flex:0 0 auto!important;
  min-width:max-content!important;
  min-height:44px!important;
  height:44px!important;
  padding:.4rem .72rem!important;
  gap:.42rem!important;
  border:1px solid transparent!important;
  border-radius:13px!important;
  white-space:nowrap!important;
  box-shadow:none!important;
  scroll-snap-align:start!important;
}
body.page-home .cat-chip-label{
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  line-height:1.25!important;
}
body.page-home .cat-chip-icon{
  width:28px!important;
  height:28px!important;
  flex:0 0 28px!important;
}
body.page-home .cat-chip-count{flex:0 0 auto!important}
body.page-home #shopResults{
  position:relative!important;
  margin-top:0!important;
}
body.page-home #shopResults>.app-section-head{
  position:relative!important;
  z-index:1!important;
  margin:0 0 .9rem!important;
}

/* Product media: clean frame plus real pointer magnifier. */
body.page-product .product-detail{align-items:start!important}
body.page-product .gallery-main-wrap{
  isolation:isolate!important;
  border-radius:18px!important;
  background:#f7f4ef!important;
  box-shadow:none!important;
}
body.page-product .gallery-main-img{
  transform:none!important;
  transition:opacity .2s ease!important;
}
body.page-product .gallery-main-wrap:hover .gallery-main-img{transform:none!important}
.image-magnifier-lens{
  position:absolute;
  z-index:5;
  width:168px;
  height:168px;
  display:none;
  pointer-events:none;
  border:3px solid rgba(255,255,255,.94);
  border-radius:50%;
  background-repeat:no-repeat;
  background-color:#fff;
  box-shadow:0 12px 32px rgba(15,25,35,.22),0 0 0 1px rgba(20,35,45,.12);
  will-change:left,top,background-position;
}
.image-magnifier-lens.is-visible{display:block}
.gallery-zoom-hint{
  position:absolute;
  z-index:4;
  inset-inline-end:.75rem;
  bottom:.75rem;
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  min-height:34px;
  padding:.35rem .65rem;
  border:1px solid rgba(24,35,45,.08);
  border-radius:999px;
  background:rgba(255,255,255,.9);
  color:#34434d;
  font-size:.7rem;
  font-weight:750;
  box-shadow:0 5px 18px rgba(20,30,40,.08);
  backdrop-filter:blur(8px);
  pointer-events:none;
}
.gallery-zoom-btn{
  border:1px solid rgba(24,35,45,.09)!important;
  border-radius:50%!important;
  background:rgba(255,255,255,.94)!important;
  box-shadow:0 6px 18px rgba(20,30,40,.08)!important;
}
.gallery-zoom-btn:hover{background:var(--gold)!important;color:#fff!important}

/* Clear, labelled shopping tools instead of hidden icon-only actions. */
.shopping-assist{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.55rem;
  margin:0 0 1.2rem;
  padding:.65rem;
  border:1px solid var(--beige-dark);
  border-radius:16px;
  background:color-mix(in srgb,var(--surface) 92%,var(--beige) 8%);
}
.shopping-assist-btn{
  min-width:0;
  min-height:48px;
  padding:.5rem .45rem;
  border:1px solid transparent;
  border-radius:11px;
  background:var(--surface);
  color:var(--text-primary);
  font:inherit;
  font-size:.75rem;
  font-weight:780;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.32rem;
  transition:border-color .18s ease,background .18s ease,color .18s ease,transform .18s ease;
}
.shopping-assist-btn i{color:var(--gold);font-size:.92rem}
.shopping-assist-btn:hover,
.shopping-assist-btn:focus-visible{
  border-color:color-mix(in srgb,var(--gold) 42%,transparent);
  background:var(--gold-dim);
  color:var(--text-primary);
  outline:none;
  transform:translateY(-1px);
}
.shopping-assist-status{
  grid-column:1/-1;
  min-height:0;
  color:var(--text-secondary);
  font-size:.72rem;
  text-align:center;
}
.shopping-assist-status:empty{display:none}

/* Lightbox controls are usable with mouse, keyboard and touch. */
.gallery-lightbox{overflow:hidden!important}
.gallery-lightbox img{
  max-width:88vw!important;
  max-height:82vh!important;
  transform:scale(var(--lightbox-scale,1));
  transform-origin:center;
  transition:transform .18s ease;
  user-select:none;
  -webkit-user-drag:none;
}
.gallery-lightbox.is-zoomed img{cursor:zoom-out}
.lb-toolbar{
  position:absolute;
  z-index:2;
  inset-inline-start:50%;
  bottom:max(1rem,env(safe-area-inset-bottom));
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:.4rem;
  padding:.42rem;
  border:1px solid rgba(255,255,255,.16);
  border-radius:999px;
  background:rgba(16,23,28,.7);
  backdrop-filter:blur(12px);
}
.lb-tool-btn{
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
}
.lb-tool-btn:hover,.lb-tool-btn:focus-visible{background:rgba(255,255,255,.23);outline:none}
.lb-zoom-value{min-width:54px;color:#fff;font-size:.76rem;font-weight:800;text-align:center}

@media (max-width:768px){
  body.page-home .cat-chips-bar{
    margin:.8rem 0 1.25rem!important;
    padding:.36rem!important;
    border-radius:15px!important;
    box-shadow:none!important;
  }
  body.page-home .cat-chip{
    min-height:42px!important;
    height:42px!important;
    padding:.36rem .62rem!important;
    border-radius:11px!important;
  }
  body.page-home .cat-chip-icon{
    width:27px!important;
    height:27px!important;
    flex-basis:27px!important;
  }
  body.page-home #shopResults>.app-section-head{
    margin:.15rem 0 .75rem!important;
    padding:.25rem .1rem!important;
  }
  body.page-product .gallery-main-wrap{border-radius:14px!important}
  .image-magnifier-lens{display:none!important}
  .gallery-zoom-hint{font-size:.66rem;bottom:.6rem;inset-inline-end:.6rem}
  .shopping-assist{grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem;padding:.5rem;margin-bottom:1rem}
  .shopping-assist-btn{min-height:50px;flex-direction:row;justify-content:flex-start;padding:.55rem .7rem;font-size:.74rem}
  .gallery-lightbox img{max-width:96vw!important;max-height:76vh!important}
}

@media (max-width:390px){
  body.page-home .cat-chip-count{display:none!important}
  .gallery-zoom-hint span{display:none}
  .gallery-zoom-hint{width:34px;height:34px;padding:0;justify-content:center}
}

body.dark .shopping-assist,
body.dark .gallery-zoom-hint{border-color:var(--beige-dark)}
body.dark .gallery-zoom-hint{background:rgba(23,34,42,.9);color:#eef3f5}
