/* 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-main-wrap.is-magnifying .gallery-zoom-hint{opacity:0}
.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;z-index:100000!important}
.gallery-lightbox .lb-close{z-index:4!important}
.gallery-lightbox img{
  max-width:88vw!important;
  max-height:82vh!important;
  transform:translate3d(var(--lightbox-pan-x,0),var(--lightbox-pan-y,0),0) scale(var(--lightbox-scale,1));
  transform-origin:center;
  transition:transform .18s ease;
  user-select:none;
  -webkit-user-drag:none;
  touch-action:none;
}
.gallery-lightbox.is-zoomed img{cursor:grab;transition:none}
.gallery-lightbox.is-zoomed img:active{cursor:grabbing}
.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}
.lb-gesture-hint{
  position:absolute;
  inset-inline-start:50%;
  bottom:max(4.8rem,calc(env(safe-area-inset-bottom) + 4rem));
  transform:translateX(-50%);
  z-index:2;
  margin:0;
  padding:.42rem .75rem;
  border-radius:999px;
  background:rgba(8,14,18,.7);
  color:#fff;
  font-size:.72rem;
  white-space:nowrap;
  pointer-events:none;
  opacity:.82;
  transition:opacity .18s ease;
}
.gallery-lightbox.is-zoomed .lb-gesture-hint{opacity:0}

@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}
  .lb-toolbar{bottom:max(.8rem,env(safe-area-inset-bottom))}
  .lb-gesture-hint{bottom:max(4.5rem,calc(env(safe-area-inset-bottom) + 3.8rem));font-size:.66rem}
}

@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}

/* Full zoom viewer for products opened in the quick product sheet. */
.psheet-main-img.is-zoomable{position:relative;border:0;padding:0;width:100%;cursor:zoom-in;color:inherit}
.psheet-image-zoom-badge{position:absolute;z-index:2;inset-inline-end:.7rem;bottom:.7rem;display:inline-flex;align-items:center;gap:.38rem;min-height:36px;padding:.4rem .7rem;border:1px solid rgba(25,20,16,.1);border-radius:999px;background:rgba(255,255,255,.92);color:#3b3028;font-size:.7rem;box-shadow:0 6px 18px rgba(25,20,16,.1);pointer-events:none}
.psheet-zoom-viewer{position:fixed;z-index:100200;inset:0;display:none;align-items:center;justify-content:center;background:rgba(8,7,6,.96);overflow:hidden}
.psheet-zoom-viewer.open{display:flex}
.psheet-zoom-stage{width:100%;height:100%;display:grid;place-items:center;overflow:hidden}
.psheet-zoom-stage img{max-width:94vw;max-height:82vh;object-fit:contain;transform-origin:center;user-select:none;-webkit-user-drag:none;touch-action:none;transition:transform .16s ease}
.psheet-zoom-viewer.is-zoomed .psheet-zoom-stage img{cursor:grab;transition:none}
.psheet-zoom-close{position:absolute;z-index:3;top:max(1rem,env(safe-area-inset-top));inset-inline-end:1rem;width:46px;height:46px;border:1px solid rgba(255,255,255,.18);border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:1.05rem}
.psheet-zoom-toolbar{position:absolute;z-index:3;bottom:max(1rem,env(safe-area-inset-bottom));inset-inline-start:50%;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(20,16,13,.78);backdrop-filter:blur(12px)}
.psheet-zoom-toolbar button{width:42px;height:42px;border:0;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.12);color:#fff}
.psheet-zoom-toolbar output{min-width:52px;color:#fff;font-size:.76rem;font-weight:800;text-align:center}
.psheet-zoom-viewer>p{position:absolute;bottom:max(4.8rem,calc(env(safe-area-inset-bottom) + 4rem));inset-inline-start:50%;transform:translateX(-50%);margin:0;padding:.4rem .7rem;border-radius:999px;background:rgba(20,16,13,.7);color:#fff;font-size:.68rem;white-space:nowrap;pointer-events:none}
body.psheet-zoom-open{overflow:hidden!important}
@media(max-width:768px){.psheet-image-zoom-badge b{display:none}.psheet-image-zoom-badge{width:38px;height:38px;padding:0;justify-content:center}.psheet-zoom-stage img{max-width:100vw;max-height:78vh}.psheet-zoom-viewer>p{max-width:92vw;white-space:normal;text-align:center}}
