/* ==========================================================================
   Related Slidestorm v2.0.0 — Grille CSS pure, zéro Swiper
   ========================================================================== */

/* ── Grille 4 colonnes ──────────────────────────────────────────────────── */

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ── Titre section ──────────────────────────────────────────────────────── */

.related-slidestorm-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #111;
}

/* ── Card produit ───────────────────────────────────────────────────────── */

.piostorm-card {
    position: relative;
    background-color: #fff;
    border: 2px solid #81b825 !important;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

/* Image ratio fixe → évite le layout shift */
.piostorm-card a.ews-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 8px;
}

.piostorm-card a.ews-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* ── Étoiles ────────────────────────────────────────────────────────────── */

.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;
}

/* ── Titre produit ──────────────────────────────────────────────────────── */

.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; }

/* ── Prix ───────────────────────────────────────────────────────────────── */

.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;
}

/* ── Badge solde ────────────────────────────────────────────────────────── */

.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;
}

/* ── Zone variation ─────────────────────────────────────────────────────── */

.piostorm-card table.variations {
    border-collapse: collapse;
    border: none;
    margin-bottom: 8px;
}

.piostorm-card table.variations th.label { display: none; }
.piostorm-card table.variations td { border: none; padding: 0; }

.piostorm-card .single_variation_wrap {
    justify-content: flex-end;
    align-items: center;
    background-color: #ffe235;
    border-radius: 10px;
    padding: 8px;
    font-size: 14px;
    box-shadow: 0 7px 14px #81b825ad;
}

@media (min-width: 1024px) {
    .piostorm-card .single_variation_wrap {
        display: flex;
        flex-flow: row-reverse;
        justify-content: center;
    }
}

.piostorm-card .quantity { display: none !important; }

/* ── Bouton Ajouter au panier ───────────────────────────────────────────── */

.woocommerce-js .piostorm-card button.button {
    background-color: transparent;
    border-radius: 0;
    padding: 0 5px !important;
    color: #111;
    font-weight: 600;
    text-transform: uppercase;
    outline: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    width: 100%;
}

@media (min-width: 1024px) {
    .woocommerce-js .piostorm-card button.button {
        border-right: 2px solid #000;
        width: auto;
    }
}

/* ── FIX spinner WooCommerce ────────────────────────────────────────────── */

.woocommerce-js .piostorm-card button.button.loading {
    opacity: 1 !important;
}

.woocommerce-js .piostorm-card button.button.loading::after {
    display: none !important;
}

/* ── Autres ─────────────────────────────────────────────────────────────── */

.woocommerce-js .piostorm-card button.button.alt.disabled {
    background-color: transparent !important;
    cursor: not-allowed;
    color: #333 !important;
}

.woocommerce-js .piostorm-card .single_variation { margin-left: 5px; }
.piostorm-card .reset_variations { display: none !important; }
.pio-min-height { min-height: 110px; }
.piostorm-card .woocommerce-variation > div { margin-bottom: 0 !important; }
.piostorm-card table.variations select {
    min-width: 0 !important;
    border-radius: 8px;
    max-width: none !important;
}
.piostorm-card .woocommerce-variation-price { font-weight: bold; }
