.barang-foto-thumb-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
    line-height: 0;
}
.barang-foto-thumb {
    width: 36px;
    height: 48px; /* portrait 3:4 */
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    vertical-align: middle;
}
.barang-foto-thumb--lg {
    width: 84px;
    height: 112px;
    border-radius: 8px;
}
.barang-foto-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 48px;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: default;
}
.barang-foto-count {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 1px solid #fff;
}

.barang-foto-source {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.barang-foto-source .btn {
    min-width: 140px;
}
.barang-foto-source__hint {
    width: 100%;
    margin: 0;
}

.barang-foto-tambah-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.barang-foto-tambah-preview__item {
    width: 78px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    background: #f8fafc;
    text-align: center;
}
.barang-foto-tambah-preview__item img {
    width: 66px;
    height: 88px; /* portrait */
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    margin-bottom: 4px;
}
.barang-foto-tambah-preview__item label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    margin: 0;
    cursor: pointer;
}

.barang-foto-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20050;
    align-items: center;
    justify-content: center;
}
.barang-foto-lightbox.is-open {
    display: flex;
}
.barang-foto-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}
.barang-foto-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    background: #0f172a;
    border-radius: 12px;
    padding: 12px 12px 16px;
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.barang-foto-lightbox__close {
    position: absolute;
    top: 6px;
    right: 10px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
.barang-foto-lightbox__title {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 36px 8px 8px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.barang-foto-lightbox__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    background: #020617;
    border-radius: 8px;
    overflow: hidden;
}
.barang-foto-lightbox__img {
    width: auto;
    max-width: 100%;
    height: min(72vh, 640px);
    aspect-ratio: 3 / 4;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}
.barang-foto-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}
.barang-foto-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.28);
}
.barang-foto-lightbox__nav--prev { left: 10px; }
.barang-foto-lightbox__nav--next { right: 10px; }
.barang-foto-lightbox__meta {
    text-align: center;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #94a3b8;
}
body.barang-foto-lightbox-open {
    overflow: hidden;
}
