/* ================================================================
   RENPOL — Catalog Flipbook Viewer
   ================================================================ */

/* ── Przycisk otwierający ── */
.btn-catalog-flip {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-600) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 20px rgba(40,40,40,0.25);
    text-decoration: none;
}
.btn-catalog-flip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(40,40,40,0.35);
    opacity: 0.95;
}
.btn-catalog-flip svg { flex-shrink: 0; }

/* ── Modal Overlay ── */
.catalog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(8, 8, 12, 0.97);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    overflow: hidden;
}
.catalog-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Header ── */
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    gap: 1rem;
}
.catalog-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.catalog-header-brand svg {
    color: var(--brand-400, #7a9db8);
}
.catalog-header-brand span {
    font-family: var(--font-display, 'Syne', sans-serif);
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}
.catalog-page-info {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.catalog-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}
.catalog-close-btn:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

/* ── Loading screen ── */
.catalog-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 10;
    pointer-events: none;
}
.catalog-loading.hidden { display: none; }

.catalog-loading-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-600, #4d6370), var(--brand-900, #282828));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: catalog-pulse 2s ease-in-out infinite;
}
.catalog-loading-icon svg { color: #fff; }
@keyframes catalog-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.08); opacity: 0.85; }
}
.catalog-loading-text {
    text-align: center;
}
.catalog-loading-text p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}
.catalog-progress-bar-wrap {
    width: 14rem;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 9999px;
    overflow: hidden;
}
.catalog-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-600, #4d6370), var(--brand-400, #7a9db8));
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.catalog-progress-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
    margin-top: 0.5rem;
}

/* ── Viewport ── */
.catalog-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    min-height: 0;
    position: relative;
}

/* ── Nav buttons ── */
.catalog-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    flex-shrink: 0;
    font-size: 1.25rem;
}
.catalog-nav-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    transform: scale(1.08);
}
.catalog-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
}

/* ── Flipbook container ── */
.catalog-flipbook-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    min-width: 0;
}
#catalog-flipbook {
    box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
}
#catalog-flipbook .page {
    background: #fff;
    overflow: hidden;
}
#catalog-flipbook .page canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ── Footer ── */
.catalog-footer {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.catalog-footer-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
}
.catalog-download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s;
}
.catalog-download-link:hover { color: rgba(255,255,255,0.85); }

/* ── Error state ── */
.catalog-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    color: rgba(255,255,255,0.6);
}
.catalog-error svg { color: rgba(255,100,100,0.7); }
.catalog-error p { font-size: 0.9375rem; }

/* Mobile tweaks */
@media (max-width: 600px) {
    .catalog-nav-btn { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
    .catalog-viewport { padding: 0.75rem 0.5rem; gap: 0.5rem; }
    .catalog-footer-hint { display: none; }
}

/* ── Catalog Actions (przyciski w nagłówku katalogu) ── */
.catalog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
