.mag-flipbook-wrapper {
    background: #1e1e1e;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
    position: relative;
    overflow: hidden;
}

#mag-flipbook-container {
    width: 100%;
    max-width: 1200px;
    height: 75vh;
    max-height: 800px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background: #111;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.stf__parent {
    margin: 0 auto;
}

.stf__item {
    background-color: #ffffff;
}

.stf__item canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

/* Barre de contrôle */
.mag-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 30px;
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}

.mag-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mag-btn:hover {
    transform: scale(1.15);
    color: #ea580c; /* Orange de la charte */
}

.mag-page-info {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Loader */
.mag-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: system-ui, sans-serif;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mag-loader::after {
    content: "";
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ea580c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Adaptabilité Mobile */
@media (max-width: 768px) {
    .mag-flipbook-wrapper {
        padding: 10px 0;
        min-height: 100vh;
    }
    #mag-flipbook-container {
        height: 70vh;
        border-radius: 0;
        box-shadow: none;
    }
    .mag-controls {
        bottom: 10px;
    }
}