/* =========================================================
   MOBA Product Gallery – gallery.css
   ========================================================= */

/* ── Wrapper layouts ── */
.mpg-wrapper {
    display: flex;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    position: relative;
}
.mpg-wrapper.mpg-thumbs-left,
.mpg-wrapper.mpg-thumbs-right {
    flex-direction: row;
    align-items: flex-start;
}
.mpg-col-full {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* ── Main panel ── */
.mpg-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mpg-main-stage {
    position: relative;
    width: 100%;
    height: 540px;
    background: #f8f8f6;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    cursor: zoom-in;
}
[data-mpg-zoom=""] .mpg-main-stage { cursor: zoom-in; }

/* ── Slides ── */
.mpg-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(.4,0,.2,1),
                transform 0.35s cubic-bezier(.4,0,.2,1);
    transform: scale(1.015);
    pointer-events: none;
}
.mpg-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    z-index: 1;
}
.mpg-slide.slide-out {
    opacity: 0;
    transform: scale(0.985);
}
.mpg-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: inherit;
    transition: transform 0.25s ease;
    will-change: transform;
}

/* ── Zoom behaviour ── */
.mpg-main-stage.is-zooming .mpg-main-img {
    transform: scale(1.9);
    cursor: zoom-out;
}
.mpg-zoom-lens {
    display: none; /* purely JS-driven overlay, kept for future use */
}

/* ── Arrows ── */
.mpg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(6px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    opacity: 0;
    transition: opacity .2s, background .15s, transform .15s;
    padding: 0;
}
.mpg-arrow svg {
    width: 18px;
    height: 18px;
}
.mpg-main-stage:hover .mpg-arrow { opacity: 1; }
.mpg-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.mpg-prev { left: 12px; }
.mpg-next { right: 12px; }

/* ── Expand / lightbox trigger ── */
.mpg-expand-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(6px);
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    opacity: 0;
    transition: opacity .2s, background .15s;
    padding: 0;
}
.mpg-expand-btn svg { width: 16px; height: 16px; }
.mpg-main-stage:hover .mpg-expand-btn { opacity: 1; }
.mpg-expand-btn:hover { background: #fff; }

/* ── Counter badge ── */
.mpg-counter {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
}
.mpg-counter-inner {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 20px;
    line-height: 1;
}

/* ── Dot indicators ── */
.mpg-dots {
    display: none;
    justify-content: center;
    gap: 6px;
}
.mpg-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d0d0ce;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}
.mpg-dot.is-active {
    background: #1a1a1a;
    transform: scale(1.25);
}

/* ── Thumbnails – vertical ── */
.mpg-thumbs-v {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 88px;
    flex-shrink: 0;
    max-height: 540px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.mpg-thumbs-v::-webkit-scrollbar { width: 4px; }
.mpg-thumbs-v::-webkit-scrollbar-track { background: transparent; }
.mpg-thumbs-v::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── Thumbnails – horizontal ── */
.mpg-thumbs-h {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    padding-bottom: 4px;
}
.mpg-thumbs-h::-webkit-scrollbar { height: 4px; }
.mpg-thumbs-h::-webkit-scrollbar-track { background: transparent; }
.mpg-thumbs-h::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── Thumb button ── */
.mpg-thumb {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #f8f8f6;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .18s, opacity .18s, box-shadow .18s;
    outline: none;
}
.mpg-thumbs-h .mpg-thumb {
    width: 72px;
    height: 72px;
}
.mpg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}
.mpg-thumb:hover img { transform: scale(1.06); }
.mpg-thumb.is-active {
    border-color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.mpg-thumb:hover { border-color: #1a1a1a; opacity: .9; }
.mpg-thumb:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }

/* ── Placeholder (editor) ── */
.mpg-placeholder {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.mpg-lb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,10,.94);
    backdrop-filter: blur(8px);
    animation: mpgLbIn .25s ease;
    padding: 20px;
    box-sizing: border-box;
}
@keyframes mpgLbIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.mpg-lb.is-closing {
    animation: mpgLbOut .2s ease forwards;
}
@keyframes mpgLbOut {
    to { opacity: 0; }
}

.mpg-lb-inner {
    position: relative;
    max-width: 1060px;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.mpg-lb-img-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
}
.mpg-lb-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    animation: mpgImgIn .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
@keyframes mpgImgIn {
    from { opacity:0; transform: scale(.96); }
    to   { opacity:1; transform: scale(1);   }
}

/* Lightbox buttons */
.mpg-lb-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    padding: 0;
}
.mpg-lb-btn svg { width: 22px; height: 22px; }
.mpg-lb-btn:hover { background: #1a1a1a; transform: translateY(-50%) scale(1.08); }
.mpg-lb-prev { left: -56px; }
.mpg-lb-next { right: -56px; }

.mpg-lb-close {
    position: absolute;
    top: -16px;
    right: 0;
    transform: none;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.14);
    border-radius: 8px;
    z-index: 3;
}
.mpg-lb-close:hover {
    background: #1a1a1a;
    transform: scale(1.08);
}

/* Lightbox thumbnail strip */
.mpg-lb-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 4px;
    max-width: 100%;
}
.mpg-lb-thumbs::-webkit-scrollbar { display: none; }
.mpg-lb-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.2);
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
    background: #111;
    padding: 0;
}
.mpg-lb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .65;
    transition: opacity .15s;
}
.mpg-lb-thumb.is-active {
    border-color: #fff;
    transform: scale(1.06);
}
.mpg-lb-thumb.is-active img,
.mpg-lb-thumb:hover img {
    opacity: 1;
}
.mpg-lb-thumb:hover { border-color: rgba(255,255,255,.7); }

/* Lightbox caption / counter */
.mpg-lb-info {
    color: rgba(255,255,255,.5);
    font-size: 12px;
    letter-spacing: .08em;
    text-align: center;
    font-family: inherit;
}
.mpg-lb-info strong { color: #fff; font-weight: 600; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 767px) {
    .mpg-wrapper.mpg-thumbs-left,
    .mpg-wrapper.mpg-thumbs-right {
        flex-direction: column;
    }
    .mpg-thumbs-v {
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-y: visible;
        overflow-x: auto;
        height: 64px;
    }
    .mpg-thumbs-v .mpg-thumb {
        width: 64px;
        height: 64px;
    }
    .mpg-main-stage { height: 320px !important; }
    .mpg-dots { display: flex; }
    .mpg-lb-prev { left: -10px; }
    .mpg-lb-next { right: -10px; }
    .mpg-lb-btn { width: 38px; height: 38px; }
    .mpg-lb-btn svg { width: 18px; height: 18px; }
}
