/* Scalloped Product Gallery v1.3 */
*, *::before, *::after { box-sizing: border-box; }

.spg-main button,
.spg-lb-inner button {
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.spg-main button svg,
.spg-lb-inner button svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* ════════════════════════════════
   GALLERY LAYOUT
════════════════════════════════ */
.spg-gallery {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}

/* ════════════════════════════════
   THUMBNAILS (left column)
════════════════════════════════ */
.spg-thumbnails {
    width: 80px;
    min-width: 80px;
    flex-shrink: 0;
}

.spg-thumb-track {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spg-thumb {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    background: #f0ede8;
    transition: border-color 0.18s ease, opacity 0.18s ease;
    opacity: 0.72;
}

.spg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spg-thumb:hover  { opacity: 0.9; border-color: #aaa; }
.spg-thumb.active { opacity: 1;   border-color: #1a1a1a; }

/* ════════════════════════════════
   MAIN IMAGE (right column)
════════════════════════════════ */
.spg-main {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f4f1ed;
}

.spg-img-wrap {
    width: 100%;
    line-height: 0;
    position: relative;
}

.spg-main-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    aspect-ratio: 5 / 6;
    object-fit: cover;
}

.spg-main-img.spg-loading { opacity: 0.15; }

/* ════════════════════════════════
   SLIDE ARROWS
   — invisible by default
   — fade in on .spg-main hover
════════════════════════════════ */
.spg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    background: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(0,0,0,0.14);
    backdrop-filter: blur(6px);

    /* Hidden until hover */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.spg-main:hover .spg-arrow:not([disabled]) {
    opacity: 1;
    pointer-events: auto;
}

.spg-arrow svg { width: 16px; height: 16px; display: block; }

.spg-arrow-prev { left: 12px; }
.spg-arrow-next { right: 12px; }

.spg-arrow:hover {
    background: #1a1a1a;
    color: #fff;
    transform: translateY(-50%) scale(1.06);
}

.spg-arrow[disabled] {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ════════════════════════════════
   EXPAND / SEARCH ICON (top-right)
════════════════════════════════ */
.spg-expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    background: rgba(255, 255, 255, 0.88);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
    backdrop-filter: blur(6px);
    transition: background 0.18s, color 0.18s, transform 0.18s;
}

.spg-expand-btn svg { width: 15px; height: 15px; display: block; }

.spg-expand-btn:hover {
    background: #1a1a1a;
    color: #fff;
    transform: scale(1.08);
}

/* ════════════════════════════════
   LIGHTBOX
════════════════════════════════ */
.spg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.spg-lightbox.spg-lb-open {
    display: flex;
}

.spg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: zoom-out;
    animation: spgFadeIn 0.22s ease;
}

.spg-lb-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 48px 60px;
    animation: spgScaleIn 0.22s ease;
}

.spg-lb-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spg-lb-img {
    max-width: 90vw;
    max-height: 86vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 12px 60px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
    user-select: none;
}

.spg-lb-img.spg-lb-loading {
    opacity: 0;
}

/* Spinner */
.spg-lb-spinner {
    display: none;
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spgSpin 0.7s linear infinite;
}

.spg-lb-img.spg-lb-loading ~ .spg-lb-spinner {
    display: block;
}

/* Close button */
.spg-lb-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255,255,255,0.12);
    color: #fff;
    transition: background 0.18s, transform 0.18s;
    backdrop-filter: blur(6px);
}

.spg-lb-close svg { width: 18px; height: 18px; display: block; }
.spg-lb-close:hover { background: rgba(255,255,255,0.25); transform: scale(1.08); }

/* Lightbox arrows */
.spg-lb-prev,
.spg-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.22);
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255,255,255,0.12);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: background 0.18s, transform 0.18s, opacity 0.18s;
}

.spg-lb-prev { left: 16px; }
.spg-lb-next { right: 16px; }

.spg-lb-prev svg,
.spg-lb-next svg { width: 18px; height: 18px; display: block; }

.spg-lb-prev:hover,
.spg-lb-next:hover { background: rgba(255,255,255,0.28); transform: translateY(-50%) scale(1.06); }

.spg-lb-prev[disabled],
.spg-lb-next[disabled] { opacity: 0.25; pointer-events: none; }

/* Counter */
.spg-lb-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    letter-spacing: 0.08em;
    font-weight: 400;
    white-space: nowrap;
}

/* Animations */
@keyframes spgFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes spgScaleIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes spgSpin    { to { transform: rotate(360deg); } }

/* ── Magnifier (inline styles handle sizing) ── */
.spg-magnifier { position: absolute; pointer-events: none; z-index: 30; }

/* ════════════════════════════════
   MOBILE
════════════════════════════════ */
@media (max-width: 600px) {
    .spg-gallery   { flex-direction: column-reverse; gap: 8px; }
    .spg-thumbnails { width: 100%; min-width: unset; }
    .spg-thumb-track { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .spg-thumb { flex-shrink: 0; }
    .spg-arrow { opacity: 0.85 !important; pointer-events: auto !important; }
    .spg-lb-prev { left: 8px; }
    .spg-lb-next { right: 8px; }
    .spg-lb-inner { padding: 48px 10px; }
}

/* ════════════════════════════════
   CIRCLE MAGNIFIER ZOOM
════════════════════════════════ */
.spg-img-wrap { cursor: crosshair; }



.spg-magnifier.spg-mag-active {
    display: block;
}


