:root {
    --ab-blue: #1e3a5f;
    --ab-blue-dark: #0f2036;
    --ab-orange: #f0862c;
    --ab-orange-dark: #c96613;
    --ab-bg: #f4f5f7;
    --ab-surface: #ffffff;
    --ab-text: #1f2933;
    --ab-text-muted: #64748b;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ab-bg: #10151c;
        --ab-surface: #1a2029;
        --ab-text: #eef2f6;
        --ab-text-muted: #9aa7b6;
    }
}

* { box-sizing: border-box; }

body.catalog-body {
    margin: 0;
    min-height: 100dvh;
    background: var(--ab-bg);
    color: var(--ab-text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
}

.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--ab-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 20;
}

.catalog-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.catalog-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ab-orange), var(--ab-orange-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.catalog-brand-text {
    min-width: 0;
}

.catalog-brand-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
    color: var(--ab-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
    .catalog-brand-text strong { color: #cfe0f5; }
}

.catalog-brand-text span {
    display: block;
    font-size: 0.72rem;
    color: var(--ab-text-muted);
}

.catalog-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.catalog-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--ab-surface);
    color: var(--ab-text);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}

.catalog-btn.primary {
    background: var(--ab-orange);
    border-color: var(--ab-orange-dark);
    color: #fff;
}

.catalog-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.catalog-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px 4px;
    overflow: hidden;
    touch-action: pan-y;
}

.catalog-viewport {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: min(78dvh, 900px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-page-shell {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 30px rgba(15, 32, 54, 0.18);
    border-radius: 4px;
    overflow: hidden;
    background: var(--ab-surface);
    cursor: zoom-in;
}

.catalog-page-shell img {
    display: block;
    max-width: 100%;
    max-height: min(78dvh, 900px);
    width: auto;
    height: auto;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.catalog-page-shell img.is-loaded { opacity: 1; }

.catalog-page-shell.is-flipping img {
    animation: catalog-flip 0.28s ease;
}

@keyframes catalog-flip {
    from { transform: rotateY(6deg) scale(0.98); opacity: 0.4; }
    to { transform: rotateY(0deg) scale(1); opacity: 1; }
}

.catalog-nav-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: transparent;
    z-index: 5;
}

.catalog-nav-zone.prev { left: 0; }
.catalog-nav-zone.next { right: 0; }

.catalog-nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ab-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.catalog-main:hover .catalog-nav-arrow { opacity: 1; }

.catalog-nav-arrow svg { width: 20px; height: 20px; }

.catalog-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ab-text-muted);
    font-size: 0.85rem;
}

.catalog-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--ab-surface);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.catalog-footer button {
    border: none;
    background: transparent;
    color: var(--ab-blue);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.catalog-footer button:hover { background: rgba(30, 58, 95, 0.08); }
.catalog-footer button svg { width: 20px; height: 20px; }

.catalog-slider-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.catalog-slider-wrap input[type="range"] {
    flex: 1;
    accent-color: var(--ab-orange);
}

.catalog-page-label {
    font-size: 0.78rem;
    color: var(--ab-text-muted);
    white-space: nowrap;
    min-width: 64px;
    text-align: right;
}

.catalog-body.is-zoomed .catalog-page-shell {
    cursor: zoom-out;
}

.catalog-body.is-zoomed .catalog-viewport {
    max-width: 100%;
    height: 100dvh;
    position: fixed;
    inset: 0;
    background: rgba(15, 21, 28, 0.92);
    z-index: 50;
    overflow: auto;
    padding: 16px;
}

.catalog-body.is-zoomed .catalog-page-shell img {
    max-height: none;
    width: 100%;
    max-width: 900px;
}

@media (max-width: 480px) {
    .catalog-brand-text span { display: none; }
    .catalog-btn span.label-full { display: none; }
}
