/* ==========================================================================
   Gridstorm v1.4.0 — Grille + Filtre sidebar
   ========================================================================== */

/* ── Card produit ───────────────────────────────────────────────────────── */

.piostorm-card {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    padding: 8px;
    border: 2px solid #81b825 !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    margin: 5px;
}

/* Préfixe .elementor comme dans slidestorm — crée le bon contexte */
.elementor .piostorm-card a.ews-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 8px;
}

.elementor .piostorm-card a.ews-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* ── Ruban rupture de stock ─────────────────────────────────────────────── */

.ews-outofstock-ribbon-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    display: block !important;
}

.woocommerce-js .piostorm-card .star-rating::before {
    color: #000;
    content: "\53\53\53\53\53";
}

.piostorm-card .review-rating { display: inline-block; }

.ews-rating {
    display: flex;
    justify-content: center;
    color: #f5bb0b;
}

.ews-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0;
}

.piostorm-card .ews-title a,
.entry-content .piostorm-card a.woocommerce-review-link {
    color: #100f0d;
    margin: 12px 0;
    text-decoration: none;
    line-height: 0.75;
}

.piostorm-card p { font-size: 1rem; color: #666; }

.ews-price {
    margin-top: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ews-price strong { font-weight: 900; }

.piostorm-card del {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

.piostorm-card del::after {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 100%; height: 2px;
    background: red;
    transform: rotate(-10deg);
    transform-origin: center;
}

.ews-sale-badge {
    position: absolute;
    top: 10px; right: 10px;
    background-color: #ff0000;
    color: #fff;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 16px;
    pointer-events: none;
}

.pio-min-height { min-height: 110px; }

.gridstorm-no-results { text-align: center; padding: 40px; color: #666; }

/* ── Bouton Voir le produit ─────────────────────────────────────────────── */

.gs-view-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background-color: #81b825;
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    box-sizing: border-box;
}

.gs-view-btn:hover {
    opacity: 0.85;
    color: #fff !important;
    text-decoration: none;
}

/* ==========================================================================
   Filtre sidebar
   ========================================================================== */

.gs-filter-wrap { font-family: inherit; }

.gs-filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: #81b825;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    width: 100%;
    justify-content: center;
}

@media (max-width: 1023px) {
    .gs-filter-toggle-btn { display: flex; }

    .gs-filter-panel {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 85%;
        max-width: 320px;
        height: 100%;
        background: #fff;
        z-index: 99999;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .gs-filter-panel.gs-open {
        display: block;
        transform: translateX(0);
    }

    .gs-filter-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99998;
    }

    .gs-filter-overlay.gs-open { display: block; }

    .gs-filter-close {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }
}

@media (min-width: 1024px) {
    .gs-filter-close { display: none; }
    .gs-filter-panel { display: block !important; transform: none !important; }
}

.gs-active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.gs-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #81b82522;
    border: 1px solid #81b825;
    color: #333;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

.gs-active-badge a { color: #999; text-decoration: none; font-size: 14px; line-height: 1; }

.gs-clear-all {
    font-size: 12px;
    color: #e00;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    margin-bottom: 12px;
}

.gs-section { border-bottom: 1px solid #eee; padding: 12px 0; }

.gs-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #222;
    user-select: none;
}

.gs-section-title .gs-arrow { transition: transform 0.2s; font-size: 10px; }
.gs-section.gs-collapsed .gs-arrow { transform: rotate(-90deg); }
.gs-section-body { padding-top: 10px; }
.gs-section.gs-collapsed .gs-section-body { display: none; }

.gs-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
}

.gs-checkbox-item input[type="checkbox"] {
    appearance: none;
    width: 16px; height: 16px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.gs-checkbox-item input[type="checkbox"]:checked {
    background: #81b825;
    border-color: #81b825;
}

.gs-checkbox-item input[type="checkbox"]:checked::after {
    content: "✓";
    color: #fff;
    font-size: 11px;
    position: absolute;
    top: -1px; left: 2px;
}

.gs-count { color: #aaa; font-size: 11px; margin-left: auto; }

.gs-price-inputs { display: flex; gap: 8px; margin-top: 10px; }

.gs-price-inputs input {
    width: 50%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.gs-price-range {
    position: relative;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 16px 4px;
}

.gs-price-range-fill {
    position: absolute;
    height: 100%;
    background: #81b825;
    border-radius: 2px;
}

.gs-range-input {
    position: absolute;
    width: 100%;
    height: 4px;
    opacity: 0;
    cursor: pointer;
    top: 0;
}

.gs-range-thumb {
    position: absolute;
    width: 16px; height: 16px;
    background: #81b825;
    border-radius: 50%;
    top: -6px;
    transform: translateX(-50%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}

.gs-apply-btn {
    width: 100%;
    padding: 10px;
    background: #81b825;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 14px;
    transition: opacity 0.2s;
}

.gs-apply-btn:hover { opacity: 0.9; }