/* =============================================================================
   SPC Product Images – Elementor Widget
   ============================================================================= */

/* Wrapper */
.spc-piw {
    position: relative;
}

/* Inner wrap */
.spc-piw__wrap {
    position: relative;
    display: block;
    line-height: 0;
    overflow: hidden;
}

/* Product image */
.spc-piw__img {
    display: block;
    width: 100%;
    height: auto;
}

/* SPC rendered composite overlay */
.spc-piw__overlay {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.spc-piw__overlay.is-active {
    display: block;
}

/* =============================================================================
   Loupe button – frosted glass dark circle
   ============================================================================= */
.spc-piw__loupe {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;

    /* Size */
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;

    /* Shape */
    border-radius: 50%;

    /* Hard-reset any theme/WooCommerce button styles (red border etc.) */
    border: none !important;
    outline: none;
    box-sizing: border-box;
    text-decoration: none;

    /* Frosted-glass dark look */
    background: rgba(18, 18, 18, 0.58) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Inner border via box-shadow so theme `border` can't override it */
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.20),
        0 2px 8px  rgba(0, 0, 0, 0.30),
        0 1px 2px  rgba(0, 0, 0, 0.20);

    /* Icon */
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition:
        background  0.18s ease,
        transform   0.18s ease,
        box-shadow  0.18s ease;
}

.spc-piw__loupe:hover {
    background: rgba(18, 18, 18, 0.82) !important;
    transform: scale(1.10);
    box-shadow:
        inset 0 0 0 1px rgba(141, 202, 255, 0.45),
        0 4px 18px rgba(0, 0, 0, 0.38),
        0 1px 4px  rgba(0, 0, 0, 0.22);
}

.spc-piw__loupe:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

.spc-piw__loupe:focus-visible {
    outline: 2px solid #8DCAFF;
    outline-offset: 3px;
}

.spc-piw__loupe svg {
    display: block;
    flex-shrink: 0;
    stroke-width: 2.2px;
    pointer-events: none;
}

/* Pulse when SPC image is first applied */
@keyframes spc-loupe-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(255,255,255,0.55); }
    60%  { box-shadow: 0 0 0 10px rgba(255,255,255,0.00); }
    100% { box-shadow: 0 0 0 0   rgba(255,255,255,0.00); }
}

.spc-piw__loupe.spc-loupe-pulse {
    animation: spc-loupe-pulse 0.55s ease-out;
}

/* =============================================================================
   Lightbox
   ============================================================================= */
.spc-piw__lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spc-piw__lightbox[hidden] {
    display: none !important;
}

.spc-piw__lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
    animation: spc-lb-fade-in 0.2s ease;
}

.spc-piw__lb-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(90vw, 960px);
    max-height: 90vh;
    animation: spc-lb-zoom-in 0.22s ease;
}

.spc-piw__lb-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.55);
    user-select: none;
}

.spc-piw__lb-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
    z-index: 1;

    /* Hard-reset any theme button styles (red/pink border etc.) */
    border: none !important;
    outline: none;
    box-sizing: border-box;

    background: #ffffff !important;
    color: #333333 !important;

    /* Inner border via box-shadow so theme can't override */
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.10),
        0 2px 10px rgba(0, 0, 0, 0.22);

    transition: background 0.12s ease, transform 0.12s ease;
}

.spc-piw__lb-close:hover {
    background: #f0f0f0 !important;
    transform: scale(1.08);
}

.spc-piw__lb-close:active {
    transform: scale(0.94);
    transition-duration: 0.07s;
}

.spc-piw__lb-close:focus-visible {
    outline: 2px solid #8DCAFF;
    outline-offset: 2px;
}

@keyframes spc-lb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes spc-lb-zoom-in {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

@media (max-width: 600px) {
    .spc-piw__lb-close {
        top: -12px;
        right: -12px;
    }

    .spc-piw__lb-box {
        max-width: 96vw;
    }
}
