/* =========================================================
   LelangPet V4 — Real Media Gallery
   Loaded after the base theme so it can polish without
   destabilising the existing design system.
   ========================================================= */

:root {
    --lp-gallery-radius: 26px;
    --lp-gallery-shadow: 0 24px 70px rgba(74, 50, 36, .12);
}

.lp-media-gallery {
    width: 100%;
    min-width: 0;
}

.lp-gallery-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 420px;
    overflow: hidden;
    border-radius: var(--lp-gallery-radius);
    background:
        radial-gradient(circle at 20% 10%, rgba(245,161,38,.12), transparent 42%),
        linear-gradient(145deg, #f3f6ff, #e6ebf7);
    box-shadow: var(--lp-gallery-shadow);
    isolation: isolate;
}

.lp-gallery-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(24,18,15,.22));
    pointer-events: none;
}

.lp-gallery-slide {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.018);
    transition:
        opacity .46s cubic-bezier(.2,.8,.2,1),
        transform .7s cubic-bezier(.2,.8,.2,1),
        visibility .46s;
    pointer-events: none;
}

.lp-gallery-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.lp-gallery-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.015);
    filter: saturate(.96);
    transition: opacity .35s ease, transform .8s cubic-bezier(.2,.8,.2,1);
}

.lp-gallery-slide img.is-loaded,
.lp-gallery-slide img[data-gallery-image]:not([loading="lazy"]) {
    opacity: 1;
    transform: scale(1);
}

.lp-gallery-nav,
.lp-gallery-expand {
    position: absolute;
    z-index: 6;
    border: 1px solid rgba(255,255,255,.32);
    background: rgba(22,18,16,.44);
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,.14);
    transition: transform .2s ease, background .2s ease, opacity .2s ease;
}

.lp-gallery-nav {
    top: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.lp-gallery-nav span {
    transform: translateY(-1px);
    font-size: 30px;
    line-height: 1;
    font-weight: 400;
}

.lp-gallery-nav.is-prev { left: 16px; }
.lp-gallery-nav.is-next { right: 16px; }

.lp-gallery-nav:hover {
    background: rgba(245,161,38,.88);
    transform: translateY(-50%) scale(1.06);
}

.lp-gallery-meta {
    position: absolute;
    z-index: 5;
    left: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-gallery-count,
.lp-gallery-photo-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    color: #fff;
    background: rgba(22,18,16,.46);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .02em;
}

.lp-gallery-expand {
    right: 16px;
    bottom: 16px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.lp-gallery-expand span { font-size: 16px; }
.lp-gallery-expand small { font-size: 9px; font-weight: 700; }

.lp-gallery-expand:hover {
    background: rgba(245,161,38,.9);
    transform: translateY(-2px);
}

.lp-gallery-thumbs {
    display: flex;
    gap: 9px;
    margin-top: 11px;
    padding: 2px 1px 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(245,161,38,.4) transparent;
}

.lp-gallery-thumb {
    position: relative;
    flex: 0 0 86px;
    width: 86px;
    height: 66px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #e8edf8;
    cursor: pointer;
    opacity: .64;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

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

.lp-gallery-thumb span {
    position: absolute;
    right: 5px;
    bottom: 5px;
    min-width: 22px;
    height: 19px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    color: #fff;
    background: rgba(25,20,17,.52);
    font-size: 7px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.lp-gallery-thumb:hover,
.lp-gallery-thumb.is-active {
    opacity: 1;
    transform: translateY(-2px);
}

.lp-gallery-thumb.is-active {
    border-color: var(--orange);
    box-shadow: 0 8px 20px rgba(245,161,38,.18);
}

/* Cards gain a quiet second-photo reveal instead of cartoon-like media. */
.auction-media {
    position: relative;
    background: #e5eaf6;
}

.auction-media > img {
    transition: opacity .5s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
}

.auction-media .auction-media-secondary {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.auction-card:hover .auction-media-primary {
    opacity: 0;
    transform: scale(1.025);
}

.auction-card:hover .auction-media-secondary {
    opacity: 1;
    transform: scale(1.018);
}

.auction-topline,
.auction-photo-count {
    z-index: 4;
}

.auction-photo-count {
    position: absolute;
    left: 12px;
    bottom: 12px;
    min-height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    color: #fff;
    background: rgba(23,18,15,.5);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 8px;
    font-weight: 700;
}

/* Real-photo hero. */
.hero-real-stage {
    width: min(100%, 520px);
    min-height: 500px;
    position: relative;
    margin-left: auto;
}

.hero-real-main {
    position: absolute;
    inset: 30px 38px 36px 44px;
    overflow: hidden;
    border-radius: 32px;
    box-shadow: 0 35px 90px rgba(77,52,38,.18);
    background: #e4e9f5;
    transform: rotate(1.25deg);
    animation: lpRealHeroFloat 7s ease-in-out infinite;
}

.hero-real-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(.96) contrast(1.02);
}

.hero-real-main::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 52%, rgba(19,14,12,.62));
}

.hero-real-info {
    position: absolute;
    z-index: 3;
    left: 24px;
    right: 24px;
    bottom: 24px;
    color: #fff;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.hero-real-info small {
    display: block;
    margin-bottom: 4px;
    font-size: 8px;
    letter-spacing: .12em;
    font-weight: 800;
}

.hero-real-info strong {
    display: block;
    max-width: 260px;
    font-size: clamp(17px,2vw,23px);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.hero-real-price {
    text-align: right;
    white-space: nowrap;
}

.hero-real-price b {
    display: block;
    font-size: 15px;
    font-weight: 750;
}

.hero-real-float {
    position: absolute;
    z-index: 5;
    width: 112px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 6px solid rgba(255,255,255,.92);
    border-radius: 25px;
    background: #e4e9f5;
    box-shadow: 0 20px 50px rgba(60,41,31,.16);
}

.hero-real-float img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-real-float.one {
    left: 0;
    top: 8px;
    transform: rotate(-8deg);
    animation: lpMiniFloatOne 6s ease-in-out infinite;
}

.hero-real-float.two {
    right: 0;
    bottom: 4px;
    transform: rotate(7deg);
    animation: lpMiniFloatTwo 6.8s ease-in-out infinite;
}

.hero-real-live {
    position: absolute;
    z-index: 6;
    right: 10px;
    top: 50px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(24,18,15,.58);
    border: 1px solid rgba(255,255,255,.26);
    backdrop-filter: blur(12px);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .09em;
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
}

.hero-real-live i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: #66dc8e;
    box-shadow: 0 0 0 5px rgba(102,220,142,.15);
}

@keyframes lpRealHeroFloat {
    0%,100% { transform: translateY(0) rotate(1.25deg); }
    50% { transform: translateY(-7px) rotate(.5deg); }
}

@keyframes lpMiniFloatOne {
    0%,100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(7px) rotate(-5deg); }
}

@keyframes lpMiniFloatTwo {
    0%,100% { transform: translateY(0) rotate(7deg); }
    50% { transform: translateY(-8px) rotate(4deg); }
}

/* Existing-photo manager in seller wizard. */
.lp-existing-media-wrap {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.54);
}

.lp-existing-media-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 11px;
}

.lp-existing-media-head h3 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 720;
}

.lp-existing-media-head p,
.lp-media-limit-note {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.lp-existing-media-grid,
.lp-new-photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 10px;
}

.lp-existing-photo,
.lp-new-photo-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}

.lp-existing-photo.is-removed {
    opacity: .36;
    transform: scale(.98);
}

.lp-existing-photo img,
.lp-new-photo-card img {
    width: 100%;
    aspect-ratio: 1.25;
    object-fit: cover;
    display: block;
}

.lp-existing-photo-actions {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.lp-cover-radio,
.lp-remove-photo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    font-weight: 650;
}

.lp-cover-radio input {
    accent-color: var(--orange);
}

.lp-remove-photo {
    border: 0;
    background: transparent;
    color: #b74e43;
    cursor: pointer;
}

.lp-new-photo-preview {
    margin-top: 12px;
}

.lp-new-photo-card {
    animation: lpPreviewIn .28s ease both;
}

.lp-new-photo-card span {
    display: block;
    padding: 7px 8px 8px;
    overflow: hidden;
    color: var(--muted);
    font-size: 7.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-new-photo-card button {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 25px;
    height: 25px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    color: #fff;
    background: rgba(26,20,17,.58);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.lp-new-photo-card:first-child::after {
    content: "Cover baru";
    position: absolute;
    left: 7px;
    top: 7px;
    padding: 5px 7px;
    border-radius: 999px;
    color: #fff;
    background: rgba(245,161,38,.92);
    font-size: 7px;
    font-weight: 750;
}

@keyframes lpPreviewIn {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* Lightbox */
body.lp-lightbox-open { overflow: hidden; }

.lp-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s ease, visibility .24s;
}

.lp-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lp-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18,14,12,.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.lp-gallery-lightbox-dialog {
    position: relative;
    z-index: 2;
    width: min(1100px, 96vw);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 26px;
    background: #15204a;
    box-shadow: 0 40px 100px rgba(0,0,0,.46);
    transform: translateY(14px) scale(.985);
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
}

.lp-gallery-lightbox.is-open .lp-gallery-lightbox-dialog {
    transform: none;
}

.lp-gallery-lightbox-head {
    min-height: 62px;
    padding: 11px 14px 11px 18px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.lp-gallery-lightbox-head small {
    display: block;
    margin-bottom: 2px;
    color: rgba(255,255,255,.48);
    font-size: 7px;
    letter-spacing: .16em;
    font-weight: 750;
}

.lp-gallery-lightbox-head strong {
    display: block;
    font-size: 13px;
    font-weight: 650;
}

.lp-gallery-lightbox-head > span {
    color: rgba(255,255,255,.7);
    font-size: 10px;
}

.lp-gallery-lightbox-head button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.06);
    font-size: 20px;
    cursor: pointer;
}

.lp-gallery-lightbox-stage {
    position: relative;
    min-height: 0;
    flex: 1;
    display: grid;
    place-items: center;
    background: #0e1735;
}

.lp-gallery-lightbox-stage > img {
    display: block;
    max-width: 100%;
    max-height: calc(94vh - 105px);
    object-fit: contain;
    opacity: 0;
    transform: scale(.99);
    transition: opacity .2s ease, transform .25s ease;
}

.lp-gallery-lightbox-stage > img.is-ready {
    opacity: 1;
    transform: none;
}

.lp-lightbox-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    color: #fff;
    background: rgba(26,20,17,.5);
    backdrop-filter: blur(10px);
    font-size: 28px;
    cursor: pointer;
    transform: translateY(-50%);
}

.lp-lightbox-nav.is-prev { left: 14px; }
.lp-lightbox-nav.is-next { right: 14px; }

.lp-gallery-lightbox-hint {
    padding: 8px 14px 10px;
    color: rgba(255,255,255,.42);
    background: #15204a;
    text-align: center;
    font-size: 7.5px;
}

/* Member/admin detail grid should respect a larger real gallery. */
.listing-preview-v4 {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(250px, .95fr);
    gap: 22px;
    align-items: start;
}

.listing-preview-v4 .lp-gallery-stage {
    min-height: 330px;
}

.admin-gallery-v4 .lp-gallery-stage {
    min-height: 390px;
}

/* Photo download/source note. */



/* responsive */
@media (max-width: 980px) {
    .hero-real-stage { min-height: 430px; margin: 0 auto; }
    .hero-real-main { inset: 26px 50px 30px; }
    .hero-real-float { width: 92px; }
    .lp-gallery-stage { min-height: 360px; }
}

@media (max-width: 760px) {
    .lp-gallery-stage {
        min-height: 0;
        aspect-ratio: 1 / .82;
        border-radius: 20px;
    }

    .lp-gallery-nav {
        width: 38px;
        height: 38px;
    }

    .lp-gallery-nav.is-prev { left: 10px; }
    .lp-gallery-nav.is-next { right: 10px; }

    .lp-gallery-meta { left: 10px; bottom: 10px; }
    .lp-gallery-expand { right: 10px; bottom: 10px; }
    .lp-gallery-expand small { display: none; }
    .lp-gallery-photo-badge { display: none; }

    .lp-gallery-thumb {
        flex-basis: 72px;
        width: 72px;
        height: 56px;
        border-radius: 11px;
    }

    .listing-preview-v4 { grid-template-columns: 1fr; }

    .hero-real-stage {
        min-height: 390px;
        width: 100%;
    }

    .hero-real-main { inset: 24px 32px 32px; border-radius: 25px; }
    .hero-real-float { width: 82px; border-width: 4px; border-radius: 19px; }
    .hero-real-info { left: 16px; right: 16px; bottom: 16px; }
    .hero-real-price { display: none; }

    .lp-gallery-lightbox { padding: 0; }
    .lp-gallery-lightbox-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .lp-gallery-lightbox-stage > img {
        max-height: calc(100dvh - 110px);
    }
}

@media (hover: none) {
    .auction-card:hover .auction-media-primary { opacity: 1; transform: none; }
    .auction-card:hover .auction-media-secondary { opacity: 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-real-main,
    .hero-real-float {
        animation: none !important;
    }

    .lp-gallery-slide,
    .lp-gallery-slide img,
    .lp-gallery-lightbox,
    .lp-gallery-lightbox-dialog {
        transition-duration: .01ms !important;
    }
}
