/* ═══════════════════════════════════════════════════════════
   CATALOG — Dokomi 2026 product catalog window + lightbox.

   Window body shows 6 page thumbnails in a responsive grid.
   Clicking any thumb opens .catalog-lightbox (a sibling of
   the .win in index.html, so it lives outside the window
   chrome and can cover the full viewport on mobile).
   ═══════════════════════════════════════════════════════════ */

.catalog-body {
    padding: 14px;
    overflow-y: auto;
    background: var(--soft);
}

.catalog-head {
    text-align: center;
    margin-bottom: 12px;
}
.catalog-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--pink);
    line-height: 1.5;
}
.catalog-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: var(--dark);
    margin-top: 6px;
    opacity: 0.75;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.catalog-card {
    all: unset;
    cursor: pointer;
    display: block;
    background: var(--cream);
    border: 2.5px solid var(--dark);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.12s ease;
}
.catalog-card:hover {
    transform: translateY(-2px) rotate(-0.5deg);
}
.catalog-card:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 2px;
}

.catalog-card-img {
    aspect-ratio: 1190 / 1684;
    background: var(--soft);
    overflow: hidden;
}
.catalog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.catalog-card-label {
    padding: 7px 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: white;
    background: var(--pink);
    text-align: center;
    line-height: 1.35;
}

/* ── Lightbox overlay ─────────────────────────────────────── */
.catalog-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.catalog-lightbox.on {
    display: flex;
}

.catalog-lightbox-img-wrap {
    max-width: 96vw;
    max-height: calc(100vh - 90px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.catalog-lightbox-img-wrap img {
    max-width: 100%;
    max-height: calc(100vh - 90px);
    display: block;
    margin: 0 auto;
    border: 3px solid var(--dark);
    border-radius: var(--radius-md);
    box-shadow: 0 0 30px rgba(237, 30, 121, 0.35);
}

.catalog-lightbox-cap {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 6px 14px;
    border-radius: 999px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    max-width: 70vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--pink);
    color: white;
    border: 3px solid var(--dark);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.catalog-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--pink);
    color: white;
    border: 3px solid var(--dark);
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.catalog-lightbox-prev { left: 14px; }
.catalog-lightbox-next { right: 14px; }

@media (max-width: 768px) {
    .catalog-lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 22px;
    }
    .catalog-lightbox-prev { left: 8px; }
    .catalog-lightbox-next { right: 8px; }
    .catalog-lightbox-cap {
        font-size: 9px;
        padding: 5px 10px;
        top: 10px;
        max-width: 60vw;
    }
    .catalog-lightbox-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
    .catalog-lightbox-img-wrap,
    .catalog-lightbox-img-wrap img {
        max-height: calc(100vh - 70px);
    }
}
