/* Shared raised-finish animation styles for A and B galleries. */
.pdp-gloss-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    /* The card-shaped touch surface reserves pan; the surrounding stage
       keeps normal page scrolling and zoom. */
    touch-action: auto;
    outline-offset: -3px;
    cursor: grab;
}
.pdp-gloss-stage[hidden] { display: none; }
.pdp-gloss-stage, .pdp-gloss-stage canvas, .pdp-gloss-touch-surface {
    /* Long holds interact with the card, without selecting surrounding content
       or opening Safari's image callout. Native pinch zoom remains available. */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.pdp-gloss-stage canvas { display: block; width: 100%; height: 100%; }
.pdp-gloss-touch-surface {
    position: absolute;
    pointer-events: none;
    touch-action: pinch-zoom;
}
.pdp-gloss-touch-surface path {
    pointer-events: none;
    touch-action: pinch-zoom;
}
.pdp-gloss-ready .pdp-gloss-touch-surface path { pointer-events: fill; }
.pdp-gloss-ready .pdp-gloss-stage { opacity: 1; pointer-events: auto; }
.pdp-gloss-ready [data-pz-layer] {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--pdp-gloss-reveal-duration, 180ms) ease-out;
}
/* Keep the rectangular JPEG inside the cut while its covering overlay fades. */
.pdp-gloss-ready [data-pz-layer="base"] {
    -webkit-mask-image: var(--pdp-gloss-silhouette);
    mask-image: var(--pdp-gloss-silhouette);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.pdp-gloss-ready .blur { filter: none !important; }
.pdp-gloss-ready > [data-pz-view] {
    z-index: 2;
    pointer-events: none;
    background: transparent !important;
}
.pdp-gloss-ready .spinner { display: none !important; }
.pdp-gloss-ready .pz-zoom-hint-trigger { pointer-events: auto; }
.pdp-gloss-ready .favorite { pointer-events: auto; }
.pdp-gloss-ready .real_foil { z-index: 2; pointer-events: none; }
.pdp-gloss-cue {
    position: absolute;
    top: 8px;
    left: 4px;
    z-index: 3;
    display: block;
    width: 64px;
    height: 88px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #655d57;
    cursor: pointer;
}
.pdp-gloss-cue[hidden] { display: none; }
#details_preview .pdp-gloss-cue { top: var(--pdp-gloss-cue-top, 38px); }
.pdp-gloss-cue svg { position: absolute; top: 0; left: 4px; display: block; width: 56px; height: 56px; overflow: visible; }
.pdp-gloss-cue .pdp-gloss-cue-cursor,
.pdp-gloss-cue .tilt-motion { display: none; }
.pdp-gloss-cue.is-demonstrating .tilt-motion { display: inline; }
.pdp-gloss-cue.is-demonstrating .tilt-rest { display: none; }
/* Swap the outline's 40 × 54 proportions while keeping the pointer upright. */
.pdp-gloss-cue.is-landscape .tilt-motion > path,
.pdp-gloss-cue.is-landscape .tilt-rest > rect {
    transform-origin: 48px 42px;
    transform: scale(1.35, .74074074);
    vector-effect: non-scaling-stroke;
}
.pdp-gloss-cue-label {
    position: absolute;
    left: 0;
    top: 54px;
    width: 64px;
    font: 11px/1.5 Arial, sans-serif;
    text-align: center;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
}
.pdp-gloss-cue-label span { display: block; white-space: nowrap; }
/* The mobile PDP sizes every descendant in vw; keep the portrait hint compact. */
#details-container .pdp-gloss-cue:not(.is-landscape) .pdp-gloss-cue-label,
#details-container .pdp-gloss-cue:not(.is-landscape) .pdp-gloss-cue-label span {
    font: 11px/13px Arial, sans-serif;
}
.pdp-gloss-cue.is-demonstrating .pdp-gloss-cue-label { animation: pdp-gloss-cue-label 6.4s both; }
.pdp-gloss-cue:focus-visible .pdp-gloss-cue-label { animation: none; opacity: 1; }
.pdp-gloss-cue:focus-visible { outline: 2px solid #54ba82; outline-offset: 3px; }
@media (min-width: 768px) {
    .pdp-gloss-cue { top: 38px; left: 16px; }
}
@media (max-width: 767px), (hover: none), (pointer: coarse) {
    .pdp-gloss-cue.is-landscape { width: 130px; height: 56px; }
    .pdp-gloss-cue.is-landscape .pdp-gloss-cue-label { left: 54px; top: 8px; width: 76px; text-align: left; }
}
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .pdp-gloss-cue { width: 130px; height: 64px; }
    .pdp-gloss-cue svg { width: 64px; height: 64px; left: 0; }
    .pdp-gloss-cue .pdp-gloss-cue-finger { display: none; }
    .pdp-gloss-cue .pdp-gloss-cue-cursor { display: inline; }
    .pdp-gloss-cue-label { left: 54px; top: 12px; width: 76px; font-size: 12px; line-height: 14px; text-align: left; }
    .pdp-gloss-cue.is-landscape { width: 138px; }
    .pdp-gloss-cue.is-landscape .pdp-gloss-cue-label { left: 62px; top: 15px; }
    .pdp-gloss-cue:hover .pdp-gloss-cue-label { animation: none; opacity: 1; }
}
@media (min-width: 768px) and (max-width: 1419px) and (hover: hover) and (pointer: fine) {
    .pdp-gloss-cue:not(.is-landscape) { width: 64px; height: 90px; }
    .pdp-gloss-cue:not(.is-landscape) .pdp-gloss-cue-label { left: -8px; top: 60px; width: 80px; text-align: center; }
}
@keyframes pdp-gloss-cue-label {
    0% { opacity: 0; transform: translateX(-3px); }
    12%, 70% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .pdp-gloss-cue .tilt-motion { display: none !important; }
    .pdp-gloss-cue .tilt-rest { display: inline !important; }
    .pdp-gloss-cue .pdp-gloss-cue-label { animation: none; opacity: 1; }
}

/* Preserve the original layered image for zoom and for WebGL/asset failure. */
#details_preview #scodix_img_first.pdp-gloss-enabled {
    position: absolute;
    inset: 0;
}
.pdp-preview-mobile #scodix_img_first.pdp-gloss-enabled {
    position: relative;
    inset: auto;
}


/* Opt-in diagnostic overlay: ?gloss_debug=1. No changes to the product layout. */
.pdp-gloss-debug {
    position: fixed;
    z-index: 10000;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow: auto;
    color: #26323c;
    background: #fff;
    border: 1px solid #bdc8cf;
    border-radius: 12px;
    box-shadow: 0 8px 32px #17202b26;
    font: 12px/1.4 system-ui, sans-serif;
    text-align: left;
}
.pdp-gloss-debug[hidden], .pdp-gloss-debug [hidden] { display: none; }
.pdp-gloss-debug * { box-sizing: border-box; }
.pdp-gloss-debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8ec;
}
.pdp-gloss-debug-header strong { font-size: 14px; }
.pdp-gloss-debug-header button {
    padding: 5px;
    border: 0;
    color: #285e43;
    background: transparent;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.pdp-gloss-debug-body { padding: 0 12px 10px; }
.pdp-gloss-debug-body > label { display: block; margin-top: 10px; font-size: 12px; }
.pdp-gloss-debug-layout { display: block; width: 100%; margin-top: 4px; padding: 6px; font: inherit; }
.pdp-gloss-debug p { margin: 8px 0; font-size: 12px; line-height: 1.4; }
.pdp-gloss-debug-map { display: block; width: 100%; height: auto; border-radius: 6px; }
.pdp-gloss-debug-sources { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pdp-gloss-debug-sources span { border-left: 4px solid; padding-left: 5px; min-width: 65px; }
.pdp-gloss-debug-coverage { font-weight: 600; }
.pdp-gloss-debug .pdp-gloss-debug-note { font-size: 11px; color: #66717a; }

.pdp-light-editor { padding: 8px 0; font-size: 12px; }
.pdp-light-editor select, .pdp-light-editor input[type="number"] { width: 100%; padding: 4px; box-sizing: border-box; font: inherit; }
.pdp-light-lock { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.pdp-light-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.pdp-light-editor button { padding: 5px 10px; cursor: pointer; }
.pdp-light-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pdp-light-copy-status:empty { display: none; }
.pdp-light-export { width: 100%; height: 140px; box-sizing: border-box; font: 11px monospace; }
.pdp-gloss-debug .pdp-light-lock input[type="checkbox"] { display: inline-block; appearance: auto; width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.pdp-gloss-debug select { appearance: auto; background-image: none; }
