/* Reserve the existing image box while a photo is on its way. */
img[data-image-state="loading"] {
  color:transparent;
  background-color:var(--image-wait-base,#e3e1d8);
  background-image:linear-gradient(105deg,transparent 30%,var(--image-wait-light,#f8f7f1) 49%,transparent 68%);
  background-size:240% 100%;
  animation:ceyvi-image-wait 1.65s ease-in-out infinite;
}
.identity-art { --image-wait-base:#171c18; --image-wait-light:#363d30; }
.story-image,.study-image-damascus { --image-wait-base:#232820; --image-wait-light:#424a35; }
.gallery-open,.cart-item-image { position:relative; }
.images-loading-enabled .identity-art:has(> img[data-image-state="loading"])::before,
.images-loading-enabled .finish-lab-image:has(> img[data-image-state="loading"])::before,
.images-loading-enabled .gallery-open:has(> img[data-image-state="loading"])::before,
.images-loading-enabled .product-photo:has(> .card-primary-image[data-image-state="loading"])::before,
.images-loading-enabled .cart-item-image:has(> img[data-image-state="loading"])::before {
  content:""; position:absolute; top:50%; left:50%; width:24px; height:24px;
  margin:-12px 0 0 -12px; border:2px solid #89917b55; border-top-color:#97a834;
  border-radius:50%; z-index:3; pointer-events:none;
  box-shadow:0 0 0 7px var(--image-wait-base,#e3e1d8);
  animation:ceyvi-image-turn .85s linear infinite;
}
.images-loading-enabled .identity-art:has(> img[data-image-state="loading"])::before { left:75%; border-top-color:#deed58; }
@media(max-width:800px) { .images-loading-enabled .identity-art:has(> img[data-image-state="loading"])::before { top:auto; bottom:15%; } }
img[data-image-reveal]:not(.card-alternate-image) { animation:ceyvi-image-reveal .22s ease-out; }
img[data-image-state="error"] { background:#e7e5dd; object-fit:contain; mix-blend-mode:normal; }
/* A hover image must be ready before it replaces the visible studio photo. */
.product-photo:has(.card-alternate-image:not([data-image-state="ready"])) .card-primary-image { opacity:1; }
.product-photo .card-alternate-image:not([data-image-state="ready"]) { opacity:0; }
/* Gallery requests keep the previous photo visible with a small progress line. */
[data-product-gallery][aria-busy="true"] .gallery-stage::after,
.pdp-lightbox[aria-busy="true"] .pdp-lightbox-header::after,
.pdp-lightbox:has([data-lightbox-image][data-image-state="loading"]) .pdp-lightbox-header::after {
  content:""; position:absolute; bottom:0; left:0; width:100%; height:3px;
  background:linear-gradient(90deg,transparent 0%,#9aab2c 42%,#deed58 52%,transparent 72%);
  background-size:240% 100%; animation:ceyvi-image-wait 1.35s ease-in-out infinite;
  pointer-events:none; z-index:4;
}
.pdp-lightbox-header { position:relative; }
@keyframes ceyvi-image-wait { from { background-position:160% 0; } to { background-position:-70% 0; } }
@keyframes ceyvi-image-reveal { from { opacity:0; } to { opacity:1; } }
@keyframes ceyvi-image-turn { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) {
  img[data-image-state="loading"],img[data-image-reveal],
  [data-product-gallery][aria-busy="true"] .gallery-stage::after,
  .pdp-lightbox[aria-busy="true"] .pdp-lightbox-header::after,
  .pdp-lightbox:has([data-lightbox-image][data-image-state="loading"]) .pdp-lightbox-header::after,
  .identity-art::before,.finish-lab-image::before,.gallery-open::before,.product-photo::before,.cart-item-image::before { animation:none!important; }
}
