/* ── Physical Product Gallery Integrated Styles ─────────────────────── */

.pg-media-area {
    width: 100%;
    padding: 10px;
}

.pg-main-frame {
    width: 100%;
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    aspect-ratio: 1/1;
    cursor: zoom-in;
}

.pg-main-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-thumb-strip {
    display: flex;
    gap: 8px;
    width: 100%;
    padding-bottom: 5px;
}

.pg-mini-box {
    flex: 0 0 calc((100% - 32px) / 5);
    min-width: 0;
    aspect-ratio: 1/1;
    height: auto;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
}

.pg-mini-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-mini-box:hover {
    border-color: #4f46e5;
}

.pg-mini-box.active {
    border-color: #4f46e5;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Penyesuaian header agar galeri tidak terlalu mepet dengan teks */
.product header #mainImgGallery {
    margin-top: 10px;
}

/* ── Lightbox Preview ─────────────────────────────────────── */
.pg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Hide by default and allow click-through */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pg-lightbox.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.pg-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pg-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pg-lightbox.show .pg-lightbox-content img {
    transform: scale(1);
}

.pg-lightbox-close {
    position: fixed;
    top: 25px;
    right: 25px;
    font-size: 32px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    background: #4f46e5 !important;
    color: #fff !important;
    z-index: 11000;
    /* Ensure it stays in front of everything */
}

.pg-lightbox-close:hover {
    background: #362ec0 !important;
    color: #fff !important;
    transform: scale(1.1);
}

/* ── Quill.js 2.0 Fixes ─────────────────────────────────── */
.pg-long-desc ol,
.pg-long-desc ul {
    list-style: none !important;
    padding-left: 1.5em !important;
    margin: 0 0 1em 0 !important;
    counter-reset: ql-counter;
}

.pg-long-desc li {
    position: relative;
    padding-left: 1.5em !important;
    margin-bottom: 0.25em;
    list-style-type: none !important;
}

/* Bullet handling for <ol> or <ul> from Quill */
.pg-long-desc li[data-list="bullet"]:before {
    content: "\2022";
    /* Bullet point symbol */
    position: absolute;
    left: 0;
    color: inherit;
    font-size: 1.2em;
    line-height: 1;
}

/* Ordered list handling */
.pg-long-desc li[data-list="ordered"]:before {
    counter-increment: ql-counter;
    content: counter(ql-counter) ". ";
    position: absolute;
    left: 0;
    color: inherit;
}

/* Hide Quill internal UI elements */
.pg-long-desc .ql-ui {
    display: none !important;
}

.pg-product-card header {
    padding: 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.pg-product-card header span[id$="-name"] {
    display: block;
    font-size: 1.05rem;
}

/* ── Custom Specs Button ── */
.btn-specs-custom {
    color: #2971fb !important;
    border-color: #2971fb !important;
    background-color: transparent !important;
}

.btn-specs-custom:hover {
    background-color: #2971fb !important;
    color: #fff !important;
}

/* ── Lightbox Navigation ──────────────────────────────────── */
.pg-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    background: rgb(63 81 181 / 59%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10600;
}

.pg-lightbox-nav:hover {
    background: #4f46e5;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

.pg-prev {
    left: 30px;
}

.pg-next {
    right: 30px;
}

.pg-lightbox-nav.hidden {
    display: none;
}

/* Lazy Load Transition */
.pg-lazy {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.pg-lazy.loaded {
    opacity: 1;
}

@media (max-width: 992px) {
    .pg-lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .pg-prev {
        left: 15px;
    }

    .pg-next {
        right: 15px;
    }
}