/* ============================================================
   lightbox.css — общий модуль просмотра фото.
   Подключается на страницах, где нужен полноэкранный просмотр:
   event.html, favorites.html, cart.html и т.д.
   DOM создаёт и управляет им static/js/lightbox.js.
   ============================================================ */

.lb {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.lb.open { display: flex; }
.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 10, 0.94);
    cursor: pointer;
}
.lb-window {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    z-index: 1;
}
.lb-photo-block {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
}
.lb-counter {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #bbb;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
}
.lb-close {
    position: absolute;
    top: -52px;
    right: -52px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    transition: background 0.15s;
    font-family: inherit;
}
.lb-close:hover { background: rgba(255, 94, 188, 0.45); }

.lb-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 2px 8px;
    font-size: 12px;
    color: #ccc;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
}
.lb-meta .lm-orig { color: #ccc; font-weight: 600; }
.lb-meta .lm-pct  { color: #ff5ebc; font-weight: 700; font-size: 14px; letter-spacing: 0.3px; }

.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lb-arrow i { line-height: 1; display: block; }
.lb-arrow:hover:not(:disabled) { background: rgba(255, 94, 188, 0.55); }
.lb-arrow:disabled { opacity: 0.25; cursor: not-allowed; }
.lb-arrow.prev { left: -70px; }
.lb-arrow.next { right: -70px; }

.lb-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 85vw;
    max-height: 78vh;
    overflow: hidden;
    background: #111;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    cursor: zoom-in;
    user-select: none;
}
.lb-image-wrap.zoomed { cursor: grab; }
.lb-image-wrap.zoomed.dragging { cursor: grabbing; }
.lb-image-wrap.no-zoom { cursor: default; }
.lb-image-wrap .lb-img-placeholder {
    display: block;
    max-width: 85vw;
    max-height: 78vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.lb-image-wrap .lb-img-placeholder.faded { opacity: 0; }
.lb-image-wrap .lb-img-large {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    opacity: 0;
}
.lb-image-wrap .lb-img-large.loaded { opacity: 1; }
.lb-image-wrap.dragging .lb-img-large { transition: none; }

.lb-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-width: 420px;
    min-height: 320px;
    background: #0a0a12;
    color: #888;
    border-radius: 8px;
    padding: 60px;
    cursor: default;
}
.lb-placeholder i { font-size: 64px; color: #666; }
.lb-placeholder p { margin: 0; font-size: 15px; text-align: center; }

.lb-like-badge {
    position: absolute;
    top: 10px; right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
    cursor: pointer;
    z-index: 5;
    backdrop-filter: blur(6px);
    transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.lb-like-badge:hover { background: rgba(255, 94, 188, 0.35); border-color: rgba(255, 94, 188, 0.6); }
.lb-like-badge:active { transform: scale(0.95); }
.lb-like-badge i { color: #ff5e9c; font-size: 15px; }
.lb-like-badge.is-gold { border-color: rgba(255, 210, 74, 0.7); box-shadow: 0 0 14px rgba(255, 210, 74, 0.65), 0 0 28px rgba(255, 210, 74, 0.4); }
.lb-like-badge.is-gold i { color: #ffd24a; text-shadow: 0 0 8px rgba(255, 210, 74, 0.9); }
.lb-like-badge span.is-infinity { font-size: 19px; font-weight: 900; line-height: 1; }
@keyframes lb-like-pop {
    0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); }
}
.lb-like-badge.pop { animation: lb-like-pop 0.35s ease; }

.lb-note {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
    text-align: center;
    max-width: 85vw;
    padding: 0 20px;
    line-height: 1.4;
}

.lb-actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.lb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.lb-action-btn:hover { background: rgba(255, 94, 188, 0.2); border-color: rgba(255, 94, 188, 0.55); color: #fff; }
.lb-action-btn:active { transform: scale(0.97); }
.lb-action-btn i { font-size: 14px; color: #ff5e9c; }

/* Красная кнопка — «Убрать из избранного» / «Убрать совсем». */
.lb-action-btn.lb-btn-danger {
    border-color: rgba(212, 70, 92, 0.5);
    background: rgba(212, 70, 92, 0.12);
    color: #ff8a9e;
}
.lb-action-btn.lb-btn-danger i { color: #ff6b82; }
.lb-action-btn.lb-btn-danger:hover {
    background: rgba(212, 70, 92, 0.28);
    border-color: rgba(212, 70, 92, 0.85);
    color: #fff;
}

/* Зелёная кнопка — «Переместить в корзину» / «Вернуть в избранное». */
.lb-action-btn.lb-btn-success {
    border-color: rgba(80, 200, 100, 0.5);
    background: rgba(80, 200, 100, 0.12);
    color: #7fe08a;
}
.lb-action-btn.lb-btn-success i { color: #4fc45a; }
.lb-action-btn.lb-btn-success:hover {
    background: rgba(80, 200, 100, 0.28);
    border-color: rgba(80, 200, 100, 0.85);
    color: #fff;
}