/* ===== Structure générale ===== */
.wisal-feed-container {
    max-width: 630px;
    margin: 0 auto;
}

.wisal-feed-tabs {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef1f5;
    background: #fff;
}
.wisal-feed-tab {
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    padding-bottom: 8px;
    border-bottom: 2px solid transparent;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.wisal-feed-tab.active {
    color: #1e1e2e;
    border-bottom-color: #fdbb04;
}
.wisal-feed-tab:disabled {
    cursor: default;
    opacity: .5;
}

/* ===== Post ===== */
.wisal-post {
    background: #fff;
    border-bottom: 1px solid #eef1f5;
}

.wisal-post-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
}
.wisal-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}
.wisal-post-author {
    flex: 1;
    min-width: 0;
}
.wisal-post-username {
    font-weight: 600;
    font-size: 14px;
    color: #1e1e2e;
    margin-right: 6px;
}
.wisal-post-time {
    font-size: 12px;
    color: #94a3b8;
}
.wisal-post-menu-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 18px;
    padding: 4px 8px;
    cursor: pointer;
    position: relative;
}
.wisal-post-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 160px;
    z-index: 20;
    overflow: hidden;
}
.wisal-post-menu.open { display: block; }
.wisal-post-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    color: #1e1e2e;
}
.wisal-post-menu button:hover { background: #f8fafc; }
.wisal-post-menu button.danger { color: #ef4444; }

/* ===== Média ===== */
.wisal-post-media {
    position: relative;
    width: 100%;
    background: #000;
}
.wisal-post-media img,
.wisal-post-media video {
    width: 100%;
    max-height: 640px;
    object-fit: cover;
    display: block;
}
.wisal-post-media-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}
.wisal-post-media-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
}
.wisal-post-media-dots span.active { background: #fff; }

/* Vidéos/images format long (portrait, story) : limiter à une hauteur d'écran raisonnable sur mobile */
@media (max-width: 767.98px) {
    .wisal-post-media img,
    .wisal-post-media video {
        max-height: 50vh;
    }
}

/* Tag produit flottant */
.wisal-product-tag {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    text-decoration: none;
    max-width: 220px;
}
.wisal-product-tag img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.wisal-product-tag-info {
    min-width: 0;
}
.wisal-product-tag-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e1e2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wisal-product-tag-price {
    font-size: 12px;
    color: #64748b;
}
.wisal-product-tag-chevron {
    color: #94a3b8;
    font-size: 14px;
    flex-shrink: 0;
}

/* Sur une vidéo, remonter le tag pour ne pas chevaucher la barre de contrôle native (lecture/progression) */
.wisal-post-media.has-video .wisal-product-tag {
    bottom: 60px;
}

/* ===== Actions ===== */
.wisal-post-actions {
    display: flex;
    align-items: center;
    padding: 4px 6px 4px;
    gap: 4px;
}
.wisal-action-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #1e1e2e;
    cursor: pointer;
    padding: 10px 12px;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    border-radius: 8px;
    transition: background-color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.wisal-action-btn:active {
    background-color: rgba(0, 0, 0, .05);
}
.wisal-action-btn i { font-size: 22px; }
.wisal-action-btn i { font-size: 21px; }
.wisal-action-btn.liked i { color: #ef4444; }
.wisal-action-spacer { flex: 1; }
.wisal-action-btn.favorited i { color: #f15d08; }

/* ===== Légende ===== */
.wisal-post-caption {
    padding: 4px 14px 12px;
}
.wisal-post-caption-text {
    font-size: 14px;
    color: #1e1e2e;
    line-height: 1.5;
}
.wisal-post-caption-text strong { margin-right: 6px; }
.wisal-post-hashtags {
    font-size: 14px;
    color: #7c6df2;
    margin-top: 2px;
}
.wisal-post-comments-link {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* ===== Bouton flottant "Créer" ===== */
.wisal-feed-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ff8901;
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(255, 145, 1, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    z-index: 900;
    transition: transform .15s ease;
}
.wisal-feed-fab:hover { transform: scale(1.06); }
.wisal-feed-fab:active { transform: scale(0.94); }

/* Sur mobile, remonter au-dessus de la barre de navigation WisalMobileNav (65px + marge de sécurité) */
@media (max-width: 767.98px) {
    .wisal-feed-fab {
        bottom: 90px;
        bottom: calc(90px + env(safe-area-inset-bottom));
    }
}

/* ===== Desktop : feed centré avec respiration latérale ===== */
@media (min-width: 992px) {
    .wisal-feed-container {
        max-width: 680px;
        border-left: 1px solid #eef1f5;
        border-right: 1px solid #eef1f5;
    }
    .wisal-post-media img,
    .wisal-post-media video {
        max-height: 720px;
    }
}
/* ===== Toast "connectez-vous" ===== */
.wisal-guest-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    background: #1e1e2e;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    white-space: nowrap;
}
.wisal-guest-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}
.wisal-guest-toast a {
    color: #a5b4fc;
    font-weight: 600;
    text-decoration: underline;
    flex-shrink: 0;
}
/* ===== Bouton son vidéo ===== */
.wisal-video-mute-btn {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(2px);
}
.wisal-video-mute-btn:hover {
    background: rgba(0,0,0,.6);
}
/* Bloque le menu d'option et l'appui long natif */

/* Rendre la vidéo "invisible" aux clics du système tout en laissant fonctionner les boutons par-dessus */
/* Bloque le surlignage et l'appel natif d'iOS */
#wisal-feed-list img, 
#wisal-feed-list video {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}
/* On réautorise les clics sur les boutons superposés (ex: bouton Mute) */
.wisal-video-mute-btn {
    pointer-events: auto;
}
/* Alignement du header avec le bouton à droite */
.wisal-feed-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.wisal-feed-tabs-list {
    display: flex;
    gap: 8px;
}

.wisal-filter-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #4b5563;
    padding: 6px 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wisal-filter-btn:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Modal de filtres */
.wisal-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}
.wisal-filter-modal.wisal-modal-visible {
    display: block;
    opacity: 1 !important;
    visibility: visible !important;
}
.wisal-filter-modal.open {
    opacity: 1;
    visibility: visible;
}

.wisal-filter-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.wisal-filter-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1;
    overflow: hidden;
}

.wisal-filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.wisal-filter-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.wisal-filter-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
}

.wisal-filter-modal-body {
    padding: 20px;
}

.wisal-filter-group {
    margin-bottom: 18px;
}

.wisal-filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.wisal-filter-chips {
    display: flex;
    gap: 8px;
}

.wisal-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}

.wisal-chip.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.wisal-filter-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    outline: none;
}

.wisal-filter-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}
.wisal-pf-section {
    padding: 20px 16px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}
.wisal-pf-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

.wisal-pf-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.wisal-pf-scroll::-webkit-scrollbar { height: 4px; }
.wisal-pf-scroll::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.wisal-pf-card {
    position: relative;
    flex: 0 0 auto;
    width: 130px;
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    text-decoration: none;
    scroll-snap-align: start;
    display: block;
}

.wisal-pf-media {
    width: 100%;
    height: 100%;
    position: relative;
}
.wisal-pf-media img,
.wisal-pf-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wisal-pf-no-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 24px;
    background: #f1f5f9;
}

.wisal-pf-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 28px;
    opacity: .85;
    pointer-events: none;
    text-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.wisal-pf-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 10px;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.wisal-pf-stats i { margin-right: 3px; font-size: 11px; }
.wisal-post-media-carousel .wisal-post-media-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 100%;
}
.wisal-post-media-carousel .wisal-post-media-track::-webkit-scrollbar {
    display: none;
}
.wisal-post-media-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    width: 100%;
    height: 100%;
    position: relative;
}
.wisal-product-tag {
    z-index: 30;
}
.wisal-post-media-slide img,
.wisal-post-media-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wisal-post-media-indicator {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    z-index: 2;
}
.wisal-post-media-slide {
    background: #000;
}
.wisal-media-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wisal-media-spin .7s linear infinite;
    z-index: 1;
}
.wisal-post-media-slide img {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity .15s ease;
}
.wisal-post-media-slide img.wisal-media-loaded {
    opacity: 1;
}
@keyframes wisal-media-spin {
    to { transform: rotate(360deg); }
}