.audio.green-audio-player {
    width: 80vw;
    max-width: 400px;
    min-width: 300px;
    height: 56px;
    display: flex;
    flex-direction: row; /* 🩹 iOS fix : forcer horizontal */
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-radius: 30px;
    user-select: none;
    -webkit-user-select: none;
    background-color: #f5f7fa;
    box-sizing: border-box;
}

/* 🩹 SVG fix pour iOS : évite le flex-shrink */
.audio.green-audio-player svg,
.audio.green-audio-player img {
    display: block;
    height: 16px;
    flex: 0 0 auto;
}

/* Bouton lecture/pause */
.audio.green-audio-player .play-pause-btn {
    display: none;
    cursor: pointer;
    flex: 0 0 auto;
}

/* Spinner de chargement */
.audio.green-audio-player .loading .spinner {
    width: 18px;
    height: 18px;
    background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/355309/loading.png);
    background-size: cover;
    background-repeat: no-repeat;
    animation: spin 0.6s linear infinite;
}

/* Contrôles principaux */
.audio.green-audio-player .controls {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 18px;
    color: #55606E;
    display: flex;
    flex: 1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 0 24px;
    white-space: nowrap; /* 🩹 iOS: évite le retour à la ligne */
}

/* Slider principal (barre de progression) */
.audio.green-audio-player .controls .slider {
    flex: 1;
    margin: 0 16px;
    border-radius: 2px;
    height: 4px;
    background-color: #D8D8D8;
    position: relative;
    cursor: pointer;
}

.audio.green-audio-player .controls .slider .progress {
    width: 0;
    height: 100%;
    background-color: var(--rz-primary);
    border-radius: inherit;
    position: absolute;
    pointer-events: none;
}

.audio.green-audio-player .controls .slider .progress .pin {
    height: 16px;
    width: 16px;
    border-radius: 8px;
    background-color: var(--rz-primary);
    position: absolute;
    right: -8px;
    top: -6px;
    pointer-events: all;
    box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.32);
}

/* Volume */
.audio.green-audio-player .volume {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio.green-audio-player .volume .volume-btn {
    cursor: pointer;
}

.audio.green-audio-player .volume .volume-btn.open path {
    fill: var(--rz-primary);
}

/* Menu volume (vertical) */
.audio.green-audio-player .volume .volume-controls {
    width: 30px;
    height: 135px;
    background-color: rgba(0, 0, 0, 0.62);
    border-radius: 7px;
    position: absolute;
    left: -3px;
    bottom: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.audio.green-audio-player .volume .volume-controls.hidden {
    display: none;
}

.audio.green-audio-player .volume .volume-controls .slider {
    margin: 12px 0;
    width: 6px;
    border-radius: 3px;
    background-color: #D8D8D8;
    position: relative;
}

.audio.green-audio-player .volume .volume-controls .slider .progress {
    bottom: 0;
    height: 100%;
    width: 6px;
    background-color: var(--rz-primary);
    position: absolute;
}

.audio.green-audio-player .volume .volume-controls .slider .progress .pin {
    left: -5px;
    top: -8px;
    height: 16px;
    width: 16px;
    border-radius: 8px;
    background-color: var(--rz-primary);
    position: absolute;
    pointer-events: all;
    box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.32);
}

/* Cache le tag audio natif */
.audio.green-audio-player audio {
    display: none !important;
}

/* Animation de chargement */
@keyframes spin {
    from {
        transform: rotateZ(0);
    }
    to {
        transform: rotateZ(1turn);
    }
}

/* 🩹 iOS < 15 fallback WebKit */
@supports (-webkit-touch-callout: none) {
    .audio.green-audio-player {
        display: -webkit-box;
        -webkit-box-orient: horizontal;
        -webkit-box-align: center;
    }
    .audio.green-audio-player .controls {
        display: -webkit-box;
        -webkit-box-orient: horizontal;
        -webkit-box-align: center;
    }

    .audio.green-audio-player .controls .slider .progress {
        transform: translateZ(0); /* force le layer GPU */
        -webkit-transform: translateZ(0);
        will-change: width;
        min-height: 4px; /* assure une taille visible */
        background-color: var(--rz-primary) !important;
        z-index: 2;
    }

    .audio.green-audio-player .controls .slider {
        overflow: hidden; /* sinon Safari masque parfois le fill */
        background-clip: content-box;
    }

    .audio.green-audio-player .controls .slider .progress .pin {
        display: block;
        visibility: visible;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .audio.green-audio-player {
        height: 50px;
    }

    .audio.green-audio-player .controls {
        margin: 0 8px;
    }

    .audio.green-audio-player .controls .slider {
        margin: 0 8px;
    }

    .audio.green-audio-player .volume .volume-controls {
        bottom: 40px;
    }

    .audio.green-audio-player .volume .volume-controls .slider {
        margin-top: 8px;
        margin-bottom: 8px;
    }
}