/* ==========================================================================
   TM LIGHTBOX — Shared styles
   Paired with /assets/js/lightbox.js. Enqueued globally so any page that
   calls TMLightbox.open() has the overlay styled correctly.
   Extracted from shop.css on 2026-04-15.
   ========================================================================== */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: tm-lb-fadeIn var(--duration) var(--ease);
}

@keyframes tm-lb-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    animation: tm-lb-scaleIn var(--duration-slow) var(--ease);
}

@keyframes tm-lb-scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
}

.lb-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

.lb-prev, .lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 1rem;
    z-index: 1;
}

.lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-prev { left: var(--space-md); }
.lb-next { right: var(--space-md); }

.lb-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-lg);
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--duration) var(--ease);
    padding: 0.5rem;
    z-index: 1;
}
.lb-close:hover { opacity: 1; }

.lb-counter {
    position: absolute;
    top: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.8125rem;
}

.lb-thumbs {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    max-width: 80vw;
    overflow-x: auto;
    scrollbar-width: none;
}

.lb-thumbs::-webkit-scrollbar { display: none; }

.lb-thumb {
    flex: 0 0 48px;
    height: 48px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: none;
}

.lb-thumb.active { border-color: white; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Optional metadata slot (used by my-products detail-panel lightbox) */
.lb-slot {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    max-width: 320px;
    color: rgba(255,255,255,0.9);
    font-size: 0.8125rem;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    z-index: 2;
}
.lb-slot:empty { display: none; }

@media (max-width: 700px) {
    .lb-slot {
        top: auto;
        bottom: 88px; /* above thumbnail strip */
        right: var(--space-sm);
        left: var(--space-sm);
        max-width: none;
    }
}
