/* WhatsApp Store v1.5 */

/* ── Grille ── */
.wbs-store-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 24px 0;
}
.wbs-cols-1 { grid-template-columns: repeat(1, 1fr); }
.wbs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wbs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wbs-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Carte ── */
.wbs-product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    transition: transform .25s ease, box-shadow .25s ease;
}
.wbs-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

/* ── Zone image carte ── */
.wbs-product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f8f8;
}
.wbs-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform .3s ease;
}
.wbs-card-img:hover { transform: scale(1.05); }

.wbs-no-image { background: #f0f0f0; }
.wbs-no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Badge nb photos */
.wbs-img-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    pointer-events: none;
}

/* ── Texte carte ── */
.wbs-product-card > .wbs-product-title,
.wbs-product-card > .wbs-product-description,
.wbs-product-card > .wbs-product-price,
.wbs-product-card > .wbs-buy-btn { padding-left: 16px; padding-right: 16px; }

.wbs-product-title { font-weight: 700; font-size: 15px; margin: 14px 0 6px; color: #1a1a1a; }
.wbs-product-description { font-size: 13px; color: #666; flex-grow: 1; padding-bottom: 8px; }
.wbs-product-description p { margin: 4px 0; }
.wbs-product-price { font-weight: 700; color: #ffcc06; font-size: 18px; margin: 8px 0; }

/* ── Bouton WhatsApp ── */
.wbs-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    padding: 12px 16px;
    margin: 12px 16px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background .25s ease;
    text-align: center;
}
.wbs-buy-btn::before {
    content: "";
    display: inline-block;
    width: 18px; height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.890-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}
.wbs-buy-btn:hover { background: #128C7E; color: #fff; }

.wbs-empty { text-align: center; color: #888; padding: 20px; font-style: italic; }

/* ══════════════════════════════════════
   MODALE
══════════════════════════════════════ */
.wbs-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.wbs-modal.wbs-modal-open {
    display: flex;
}

/* Fond sombre */
.wbs-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
    cursor: pointer;
}

/* Boîte blanche */
.wbs-modal-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

/* Bouton fermer */
.wbs-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0,0,0,.5);
    border: none;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .2s;
}
.wbs-modal-close:hover { background: rgba(0,0,0,.8); }

/* Partie gauche — images */
.wbs-modal-left {
    width: 55%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.wbs-modal-main-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}
.wbs-modal-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-height: 420px;
}

/* Vignettes */
.wbs-modal-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: #111;
    overflow-x: auto;
    flex-shrink: 0;
}
.wbs-modal-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    opacity: .65;
    transition: opacity .2s, border-color .2s;
}
.wbs-modal-thumb:hover { opacity: 1; }
.wbs-modal-thumb.active { border-color: #ffcc06; opacity: 1; }

/* Partie droite — infos */
.wbs-modal-right {
    flex: 1;
    padding: 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wbs-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}
.wbs-modal-price {
    font-size: 24px;
    font-weight: 800;
    color: #ffcc06;
}
.wbs-modal-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    flex-grow: 1;
}
.wbs-modal-desc p { margin: 6px 0; }

/* Bouton WhatsApp dans la modale */
.wbs-modal-right .wbs-buy-btn { margin: 0; }

/* Bloquer le scroll body quand modale ouverte */
body.wbs-no-scroll { overflow: hidden; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .wbs-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .wbs-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
    .wbs-store-container,
    .wbs-cols-1, .wbs-cols-2, .wbs-cols-3, .wbs-cols-4 {
        grid-template-columns: repeat(1, 1fr);
    }
    .wbs-modal-box { flex-direction: column; max-height: 95vh; }
    .wbs-modal-left { width: 100%; }
    .wbs-modal-main-wrap { min-height: 200px; }
    .wbs-modal-main-img { max-height: 240px; }
    .wbs-modal-right { padding: 18px 16px; }
}

/* ── Infinite scroll ── */
.wbs-sentinel {
    display: flex;
    justify-content: center;
    padding: 28px 0;
}
.wbs-spinner {
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,.1);
    border-top-color: #ffcc06;
    border-radius: 50%;
}
.wbs-spinner.spinning {
    animation: wbs-spin 0.8s linear infinite;
}
@keyframes wbs-spin { to { transform: rotate(360deg); } }

.wbs-load-more-btn {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.wbs-load-more-btn:hover { background: #128C7E; }
