/* Brochures feature — scoped under .brochures-feature to prevent global regressions. */
.brochures-feature__cover {
    width: 100%;
    height: 320px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brochures-feature__cover-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brochures-feature__cover-title {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
}

.brochures-feature__cover-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
}

.brochures-feature {
    padding: 40px 0 60px;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
    color: #222;
}

.brochures-feature__title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #2c3e50;
}

.brochures-feature__intro {
    font-size: 16px;
    color: #555;
    margin: 0 0 30px;
}

.brochures-feature__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.brochures-feature__card {
    cursor: pointer;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.brochures-feature__card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.brochures-feature__preview {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brochures-feature__canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brochures-feature__img-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brochures-feature__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #888;
    background: #f5f5f5;
    pointer-events: none;
}

.brochures-feature__preview.is-loaded .brochures-feature__loading {
    display: none;
}

/* Progress bar (grid previews + viewer) */
.brochures-feature__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.brochures-feature__progress-fill {
    height: 100%;
    width: 0%;
    background: #feca0a;
    transition: width 0.3s ease;
}

.brochures-feature__name {
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.brochures-feature__empty {
    font-size: 16px;
    color: #888;
}

/* Flipbook overlay — fullscreen */
.brochures-feature__overlay {
    position: fixed;
    inset: 0;
    background: #1a1a1a;
    display: none;
    flex-direction: column;
    z-index: 100000;
}

.brochures-feature__overlay.is-open {
    display: flex;
}

/* Top-left: page indicator (dark button, rounded bg) */
.brochures-feature__page-indicator {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
    z-index: 100002;
    pointer-events: none;
    user-select: none;
}

/* Top-right: close button (dark, rounded) */
.brochures-feature__close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.brochures-feature__close-btn:hover {
    background: rgba(231, 76, 60, 0.85);
}

/* Flipbook area — fills space between top and bottom bar */
.brochures-feature__flipbook-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Side page-turn arrows overlaid on the viewer */
.brochures-feature__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100001;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.brochures-feature__nav:hover {
    background: rgba(0, 0, 0, 0.75);
}

.brochures-feature__nav--prev {
    left: 16px;
}

.brochures-feature__nav--next {
    right: 16px;
}

.brochures-feature__viewer-progress {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    z-index: 100003;
}

.brochures-feature__viewer-progress .brochures-feature__progress {
    position: relative;
    height: 4px;
    border-radius: 2px;
}

.brochures-feature__flipbook {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    position: relative;
}

.brochures-feature__flipbook.is-small-document {
    --brochures-side-mask-width: calc((100% - var(--brochures-page-width, 100%)) / 2);
}

.brochures-feature__flipbook canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.brochures-feature__flipbook.is-small-document::before,
.brochures-feature__flipbook.is-small-document::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--brochures-side-mask-width);
    background: #1a1a1a;
    pointer-events: none;
    z-index: 1;
}

.brochures-feature__flipbook.is-small-document::before {
    left: 0;
}

.brochures-feature__flipbook.is-small-document::after {
    right: 0;
}

.brochures-feature__small-sheet {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2200px;
}

.brochures-feature__small-sheet-canvas {
    display: block;
}

.brochures-feature__small-sheet-stage {
    position: relative;
    transform-origin: center center;
    transform-style: preserve-3d;
}

.brochures-feature__small-sheet-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.brochures-feature__small-sheet-card.is-animating {
    will-change: transform;
}

.brochures-feature__small-sheet-card.is-flipping-forward,
.brochures-feature__small-sheet-card.is-flipping-back {
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.35));
}

.brochures-feature__small-sheet-card::before,
.brochures-feature__small-sheet-card::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18%;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

.brochures-feature__small-sheet-card::before {
    left: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
}

.brochures-feature__small-sheet-card::after {
    right: 0;
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0));
}

.brochures-feature__small-sheet-card.is-flipping-forward {
    transform-origin: center center;
    animation-name: brochures-small-sheet-forward;
    animation-timing-function: cubic-bezier(0.34, 0.82, 0.08, 1);
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-back {
    transform-origin: center center;
    animation-name: brochures-small-sheet-back;
    animation-timing-function: cubic-bezier(0.34, 0.82, 0.08, 1);
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-forward::before,
.brochures-feature__small-sheet-card.is-flipping-forward::after,
.brochures-feature__small-sheet-card.is-flipping-back::before,
.brochures-feature__small-sheet-card.is-flipping-back::after {
    animation-duration: inherit;
    animation-timing-function: ease;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-forward::before,
.brochures-feature__small-sheet-card.is-flipping-back::after {
    animation-name: brochures-small-sheet-shadow-strong;
}

.brochures-feature__small-sheet-card.is-flipping-forward::after,
.brochures-feature__small-sheet-card.is-flipping-back::before {
    animation-name: brochures-small-sheet-shadow-soft;
}

.brochures-feature__small-sheet-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transform-style: preserve-3d;
}

.brochures-feature__small-sheet-face--back {
    transform: rotateY(180deg) translateZ(1px);
}

.brochures-feature__small-sheet-face--front {
    transform: translateZ(1px);
}

.brochures-feature__small-sheet-card.is-flipping-forward .brochures-feature__small-sheet-face--front,
.brochures-feature__small-sheet-card.is-flipping-back .brochures-feature__small-sheet-face--back {
    animation-name: brochures-small-sheet-face-hide;
    animation-duration: inherit;
    animation-timing-function: linear;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-forward .brochures-feature__small-sheet-face--back,
.brochures-feature__small-sheet-card.is-flipping-back .brochures-feature__small-sheet-face--front {
    animation-name: brochures-small-sheet-face-show;
    animation-duration: inherit;
    animation-timing-function: linear;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-surface {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    will-change: transform, filter;
}

.brochures-feature__small-sheet-surface::before,
.brochures-feature__small-sheet-surface::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22%;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.brochures-feature__small-sheet-surface::before {
    left: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}

.brochures-feature__small-sheet-surface::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
}

.brochures-feature__small-sheet-card.is-flipping-forward .brochures-feature__small-sheet-face--front .brochures-feature__small-sheet-surface,
.brochures-feature__small-sheet-card.is-flipping-back .brochures-feature__small-sheet-face--back .brochures-feature__small-sheet-surface {
    animation-name: brochures-small-sheet-surface-out;
    animation-duration: inherit;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-forward .brochures-feature__small-sheet-face--back .brochures-feature__small-sheet-surface,
.brochures-feature__small-sheet-card.is-flipping-back .brochures-feature__small-sheet-face--front .brochures-feature__small-sheet-surface {
    animation-name: brochures-small-sheet-surface-in;
    animation-duration: inherit;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-forward .brochures-feature__small-sheet-face--front .brochures-feature__small-sheet-surface::before,
.brochures-feature__small-sheet-card.is-flipping-back .brochures-feature__small-sheet-face--back .brochures-feature__small-sheet-surface::before {
    animation-name: brochures-small-sheet-surface-shadow-out;
    animation-duration: inherit;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-card.is-flipping-forward .brochures-feature__small-sheet-face--back .brochures-feature__small-sheet-surface::after,
.brochures-feature__small-sheet-card.is-flipping-back .brochures-feature__small-sheet-face--front .brochures-feature__small-sheet-surface::after {
    animation-name: brochures-small-sheet-surface-highlight-in;
    animation-duration: inherit;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

.brochures-feature__small-sheet-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

@keyframes brochures-small-sheet-forward {
    0% { transform: rotateY(0deg) rotateZ(0deg) scale(1); }
    18% { transform: rotateY(-22deg) rotateZ(-0.25deg) scaleY(1.01); }
    50% { transform: rotateY(-95deg) rotateZ(-0.55deg) scaleX(0.985) scaleY(1.015); }
    82% { transform: rotateY(-158deg) rotateZ(-0.18deg) scaleY(1.005); }
    100% { transform: rotateY(-180deg) rotateZ(0deg) scale(1); }
}

@keyframes brochures-small-sheet-back {
    0% { transform: rotateY(-180deg) rotateZ(0deg) scale(1); }
    18% { transform: rotateY(-158deg) rotateZ(0.18deg) scaleY(1.005); }
    50% { transform: rotateY(-85deg) rotateZ(0.55deg) scaleX(0.985) scaleY(1.015); }
    82% { transform: rotateY(-22deg) rotateZ(0.25deg) scaleY(1.01); }
    100% { transform: rotateY(0deg) rotateZ(0deg) scale(1); }
}

@keyframes brochures-small-sheet-face-hide {
    0%, 48% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes brochures-small-sheet-face-show {
    0%, 48% { opacity: 0; }
    50%, 100% { opacity: 1; }
}

@keyframes brochures-small-sheet-shadow-strong {
    0%, 100% { opacity: 0; }
    24% { opacity: 0.18; }
    50% { opacity: 0.42; }
    76% { opacity: 0.16; }
}

@keyframes brochures-small-sheet-shadow-soft {
    0%, 100% { opacity: 0; }
    20% { opacity: 0.08; }
    50% { opacity: 0.2; }
    80% { opacity: 0.06; }
}

@keyframes brochures-small-sheet-surface-out {
    0%, 100% { transform: scaleX(1) skewY(0deg); filter: brightness(1); }
    26% { transform: scaleX(0.985) skewY(-0.5deg); filter: brightness(0.97); }
    50% { transform: scaleX(0.93) skewY(-1.25deg); filter: brightness(0.9); }
    76% { transform: scaleX(0.985) skewY(-0.35deg); filter: brightness(0.98); }
}

@keyframes brochures-small-sheet-surface-in {
    0%, 100% { transform: scaleX(1) skewY(0deg); filter: brightness(1); }
    24% { transform: scaleX(0.985) skewY(0.35deg); filter: brightness(0.98); }
    50% { transform: scaleX(0.94) skewY(1deg); filter: brightness(0.92); }
    74% { transform: scaleX(0.985) skewY(0.35deg); filter: brightness(0.99); }
}

@keyframes brochures-small-sheet-surface-shadow-out {
    0%, 100% { opacity: 0; }
    24% { opacity: 0.12; }
    50% { opacity: 0.36; }
    76% { opacity: 0.1; }
}

@keyframes brochures-small-sheet-surface-highlight-in {
    0%, 100% { opacity: 0; }
    26% { opacity: 0.05; }
    50% { opacity: 0.18; }
    76% { opacity: 0.04; }
}

.brochures-feature__flipbook.is-page-cover canvas,
.brochures-feature__flipbook.is-page-spread canvas,
.brochures-feature__flipbook.is-page-last canvas {
    transform: translateX(var(--brochures-page-shift, 0%));
}

.brochures-feature__flipbook.is-page-position-animated:not(.is-flip-fwd):not(.is-flip-back) canvas {
    transition: transform 450ms ease;
}

/* Visual-only page-turn feedback for images. */
.brochures-feature__flipbook.is-flip-fwd,
.brochures-feature__flipbook.is-flip-back {
    perspective: 1800px;
    transform-style: preserve-3d;
}

.brochures-feature__flipbook.is-flip-fwd canvas,
.brochures-feature__flipbook.is-flip-fwd img,
.brochures-feature__flipbook.is-flip-back canvas,
.brochures-feature__flipbook.is-flip-back img {
    backface-visibility: visible;
    transform-style: preserve-3d;
    will-change: transform, filter, box-shadow;
}

.brochures-feature__flipbook.is-flip-fwd canvas,
.brochures-feature__flipbook.is-flip-fwd img {
    transform-origin: left center;
    animation: brochures-flip-fwd 1.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.brochures-feature__flipbook.is-flip-back canvas,
.brochures-feature__flipbook.is-flip-back img {
    transform-origin: right center;
    animation: brochures-flip-back 1.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes brochures-flip-fwd {
    0%   { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(0) rotateZ(0); filter: brightness(1); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
    42%  { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(-72deg) rotateZ(-0.6deg); filter: brightness(0.72); box-shadow: 24px 12px 42px rgba(0,0,0,0.38); }
    55%  { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(-78deg) rotateZ(-0.7deg); filter: brightness(0.66); box-shadow: 30px 14px 48px rgba(0,0,0,0.42); }
    78%  { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(-24deg) rotateZ(-0.15deg); filter: brightness(0.9); box-shadow: 10px 10px 30px rgba(0,0,0,0.27); }
    100% { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(0) rotateZ(0); filter: brightness(1); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
}

@keyframes brochures-flip-back {
    0%   { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(0) rotateZ(0); filter: brightness(1); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
    42%  { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(72deg) rotateZ(0.6deg); filter: brightness(0.72); box-shadow: -24px 12px 42px rgba(0,0,0,0.38); }
    55%  { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(78deg) rotateZ(0.7deg); filter: brightness(0.66); box-shadow: -30px 14px 48px rgba(0,0,0,0.42); }
    78%  { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(24deg) rotateZ(0.15deg); filter: brightness(0.9); box-shadow: -10px 10px 30px rgba(0,0,0,0.27); }
    100% { transform: translateX(var(--brochures-page-shift, 0%)) rotateY(0) rotateZ(0); filter: brightness(1); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
}

/* Page loading indicator (slow server). */
.brochures-feature__page-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.brochures-feature__page-loading p {
    color: #666;
    font-size: 14px;
    margin: 12px 0 0;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
}

.brochures-feature__spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #feca0a;
    border-radius: 50%;
    margin: 0 auto;
    animation: brochures-spin 0.8s linear infinite;
}

@keyframes brochures-spin {
    to { transform: rotate(360deg); }
}

.brochures-feature__page-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.brochures-feature__page-error p {
    color: #e74c3c;
    font-size: 15px;
    margin: 0 0 12px;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
}

.brochures-feature__page-error-retry {
    background: #feca0a;
    color: #2c3e50;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    font-family: 'FiraGO', 'Segoe UI', Arial, sans-serif;
}

.brochures-feature__page-error-retry:hover {
    background: #e6b800;
}

.brochures-feature__viewer-img {
    max-width: 98vw;
    max-height: calc(100vh - 60px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    draggable: false;
    transition: none !important;
}

/* Bottom: white bar with centered controls */
.brochures-feature__controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 6px 10px;
    z-index: 100002;
}

.brochures-feature__controls button {
    background: #f8f8f8;
    border: 1px solid #ddd;
    color: #333;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.brochures-feature__controls button svg {
    display: block;
    pointer-events: none;
}

.brochures-feature__controls button:hover {
    background: #e8e8e8;
    border-color: #bbb;
}

.brochures-feature__controls button:active {
    background: #d8d8d8;
}

/* More menu */
.brochures-feature__more-wrap {
    position: relative;
}

.brochures-feature__more-menu {
    display: none;
    position: absolute;
    bottom: 54px;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    min-width: 160px;
    z-index: 100003;
}

.brochures-feature__more-menu.is-open {
    display: block;
}

.brochures-feature__more-menu button {
    width: 100%;
    height: auto;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #333;
    padding: 10px 16px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    display: block;
}

.brochures-feature__more-menu button:hover {
    background: #f0f0f0;
}

@media (max-width: 600px) {
    .brochures-feature__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }
    .brochures-feature__title { font-size: 24px; }
    .brochures-feature__name { font-size: 13px; padding: 8px 10px; }
    .brochures-feature__controls button {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .brochures-feature__controls { gap: 6px; padding: 8px 12px; }
}
