.flipbook-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.flipbook-overlay.active {
    opacity: 1;
    visibility: visible;
}

.flipbook-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.flipbook-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flipbook-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 18px;
    -webkit-tap-highlight-color: transparent;
}

.flipbook-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.flipbook-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.flipbook-close-btn:hover {
    background: rgba(200, 76, 100, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.flipbook-page-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: system-ui, sans-serif;
    min-width: 80px;
    text-align: center;
}

.flipbook-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.flipbook-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flipbook-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.flipbook-nav.prev { left: 8px; }
.flipbook-nav.next { right: 8px; }

.flipbook-nav .flipbook-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    font-size: 22px;
}

.flipbook-nav .flipbook-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Page flip container */
.flipbook-book {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}

.flipbook-book .stf__parent {
    box-shadow: none !important;
}

.flipbook-page {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flipbook-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Loading state */
.flipbook-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.flipbook-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #c84c64;
    border-radius: 50%;
    animation: flipbook-spin 0.8s linear infinite;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
    .flipbook-toolbar {
        padding: 8px 12px;
    }

    .flipbook-page-info {
        font-size: 12px;
    }

    .flipbook-nav {
        top: auto;
        bottom: 60px;
        transform: none;
    }

    .flipbook-nav.prev { left: 24px; }
    .flipbook-nav.next { right: 24px; }

    .flipbook-nav .flipbook-btn {
        width: 52px;
        height: 52px;
        background: rgba(0, 0, 0, 0.65);
        border: 1.5px solid rgba(255, 255, 255, 0.2);
    }

    .flipbook-close-btn {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .flipbook-container {
        touch-action: none;
    }
}

/* Fullscreen mode */
.flipbook-overlay.fullscreen .flipbook-toolbar {
    position: absolute;
    top: 0;
    z-index: 30;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

/* Contact bar at the bottom of the flipbook */
.flipbook-contact-bar {
    flex-shrink: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4));
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.flipbook-contact-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.flipbook-contact-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-family: system-ui, sans-serif;
    white-space: nowrap;
}

.flipbook-contact-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.flipbook-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-family: system-ui, sans-serif;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.flipbook-contact-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.flipbook-contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: system-ui, sans-serif;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 6px;
    background: #c84c64;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.flipbook-contact-cta:hover {
    background: #b03d55;
    color: #fff;
    transform: translateY(-1px);
}

/* Mobile contact bar */
@media (max-width: 768px) {
    .flipbook-contact-bar {
        padding: 8px 12px;
    }

    .flipbook-contact-label {
        display: none;
    }

    .flipbook-contact-links {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }

    .flipbook-contact-link,
    .flipbook-contact-cta {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Copy email feedback */
.flipbook-email-text {
    transition: opacity 0.2s;
}

.flipbook-contact-link.copied {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

/* Contact form slide-in panel */
.flipbook-contact-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 460px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1000001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
}

.flipbook-contact-panel.open {
    transform: translateX(0);
}

.flipbook-panel-header {
    flex-shrink: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.flipbook-panel-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #c84c64;
    font-size: 14px;
    font-weight: 500;
    font-family: system-ui, sans-serif;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.flipbook-panel-back:hover {
    background: #fce4ec;
}

.flipbook-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 40px;
    -webkit-overflow-scrolling: touch;
}

.flipbook-panel-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    font-family: system-ui, sans-serif;
}

.flipbook-panel-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
    font-family: system-ui, sans-serif;
    line-height: 1.5;
}

.flipbook-panel-form input,
.flipbook-panel-form textarea {
    font-family: system-ui, sans-serif;
}

@media (max-width: 768px) {
    .flipbook-contact-panel {
        width: 100%;
    }

    .flipbook-panel-body {
        padding: 20px 16px 32px;
    }

    .flipbook-panel-title {
        font-size: 20px;
    }
}

/* The "View Products" trigger button */
.flipbook-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    color: #333;
    text-align: center;
    padding: 14px 24px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #999;
    font-size: 15px;
    font-family: inherit;
    text-decoration: none;
    margin-bottom: 12px;
    transition: border-color 0.2s, color 0.2s;
}

.flipbook-trigger-btn:hover {
    border-color: #c84c64;
    color: #c84c64;
}

.flipbook-trigger-btn svg {
    flex-shrink: 0;
}
