
/* The Modal (background) */
.image-zoom-modal {
  display: block; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 10000; /* Sit on top */
  padding-top: 100px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0, 0, 0); /* Fallback color */
  background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

/* Modal Content (image) */
.image-zoom-modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
}

/* Caption of Modal Image */
#image-zoom-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

/* Add Animation */
.image-zoom-modal-content ,
#image-zoom-caption {
  -webkit-animation-name: zoom;
  -webkit-animation-duration: 0.6s;
  animation-name: zoom;
  animation-duration: 0.6s;
}

@-webkit-keyframes zoom {
  from {
    -webkit-transform: scale(0);
  }
  to {
    -webkit-transform: scale(1);
  }
}

@keyframes zoom {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* The Close Button */
.image-zoom-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.image-zoom-close:hover,
.image-zoom-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px) {
  .image-zoom-modal-content {
    width: 100%;
  }
}

/* ---- Product photo viewer (views/image-zoom.ejs) ---- */
html.pv-open, html.pv-open body { overflow: hidden !important; }
.pv {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; flex-direction: column;
  background: rgba(12, 12, 14, 0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-family: inherit;
  animation: pv-fade .18s ease-out;
  -webkit-tap-highlight-color: transparent;
}
@keyframes pv-fade { from { opacity: 0; } to { opacity: 1; } }
.pv-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
.pv-count { font-size: 14px; font-weight: 600; letter-spacing: .02em; background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 999px; }
.pv-btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.14); width: 44px; height: 44px; border-radius: 50%; padding: 0; transition: background .15s, opacity .15s, transform .15s; }
.pv-btn:hover { background: rgba(255,255,255,.26); }
.pv-btn:active { transform: scale(.94); }
.pv-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pv-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.pv-track { display: flex; height: 100%; transition: transform .38s cubic-bezier(.22,.8,.24,1); will-change: transform; }
.pv-track.is-dragging { transition: none; }
.pv-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 8px 16px; box-sizing: border-box; }
.pv-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: center / contain no-repeat; user-select: none; -webkit-user-drag: none; animation: pv-in .25s ease-out; }
@keyframes pv-in { from { opacity: .4; transform: scale(.985); } to { opacity: 1; transform: none; } }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: rgba(255,255,255,.92); color: #111; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.pv-nav:hover { background: #fff; }
.pv-nav:active { transform: translateY(-50%) scale(.94); }
.pv-nav[disabled] { opacity: 0; pointer-events: none; }
.pv-prev { left: 16px; } .pv-next { right: 16px; }
@media (hover: none), (max-width: 640px) { .pv-nav { display: none; } }
.pv-bottom { padding: 8px 14px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pv-thumbs { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.pv-thumbs::-webkit-scrollbar { display: none; }
.pv-thumb { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; padding: 0; border: 2px solid transparent; background: rgba(255,255,255,.08); opacity: .55; cursor: pointer; transition: opacity .15s, border-color .15s; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-thumb:hover { opacity: .85; }
.pv-thumb.active { opacity: 1; border-color: #fff; }
.pv-info { width: 100%; max-width: 640px; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 10px 10px 10px 16px; box-sizing: border-box; }
.pv-meta { flex: 1; min-width: 0; }
.pv-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-price { font-size: 14px; opacity: .9; margin-top: 2px; }
.pv-price s { opacity: .55; margin-left: 6px; font-size: 13px; }
.pv-add { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; background: #25d366; color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; padding: 11px 18px; border-radius: 10px; transition: filter .15s, transform .15s; }
.pv-add:hover { filter: brightness(1.06); }
.pv-add:active { transform: scale(.97); }
.pv-oos { font-size: 13px; opacity: .7; padding: 0 8px; }

/* Photo-count badge on product thumbnails that have more than one photo */
.list-card-image { position: relative; }
.gallery-wrap { position: relative; display: inline-block; }
.gallery-wrap img { display: block; }
.list-card-image img[class*="item-img"], .gallery-wrap img { cursor: zoom-in; }
.gallery-count {
  position: absolute; right: 6px; bottom: 6px; z-index: 6; /* template 3/4 thumbnails use z-index 4 */
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px 2px 5px; border-radius: 999px;
  background: rgba(17, 24, 39, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; font-weight: 600; line-height: 16px;
  cursor: zoom-in; white-space: nowrap; pointer-events: auto;
}
.gallery-count svg { width: 12px; height: 12px; display: block; }

/* Auto-cycling product photos: layered crossfade. The outgoing photo stays fully visible
   underneath; the incoming one fades in on top with a slight settle. */
.list-card-image, .gallery-wrap { position: relative; }
.cycle-img { position: relative; z-index: 2; }
.list-card-image img.cycle-img { z-index: 5 !important; } /* above template 3/4's own z-index 4 */
.cyc-enter-active { transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1), transform 1.6s cubic-bezier(.4, 0, .2, 1); }
.cyc-enter { opacity: 0; transform: scale(1.015); }
.cyc-leave-active { position: absolute !important; z-index: 1 !important; transition: opacity 0s linear 1.6s; pointer-events: none; }
.list-card-image img.cyc-leave-active { z-index: 3 !important; }
.cyc-leave-to { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .cyc-enter-active, .cyc-leave-active { transition: none !important; }
  .pv, .pv-slide img { animation: none !important; } .pv-track { transition: none !important; }
}
