/* ═══════════════════════════════════════
   produits.css — Boutique RoniBarber
   ═══════════════════════════════════════ */

.products-wrap {
    max-width: 1100px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.products-hero {
    margin: 28px 0 24px;
    text-align: center;
}

.products-hero h1 {
    margin: 0;
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 800;
}

.products-hero .muted {
    margin-top: 6px;
    font-size: 15px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.product-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: rgba(244, 143, 177, 0.35);
}

/* Visuel produit : photo sur fond blanc (packshots), sinon bandeau neutre */
.product-img {
    position: relative;
    height: 170px;
    background: #fff;
    overflow: hidden;
}

.product-img:not(:has(img)) {
    background:
        radial-gradient(120% 140% at 20% 0%, var(--accent-soft) 0%, transparent 55%),
        var(--surface-2);
}

/* Les deux photos sont superposées ; .active est visible */
.product-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* les packshots ont déjà leur marge blanche intégrée ;
       légèrement descendus pour centrer visuellement les pots */
    transform: scale(1.35) translateY(8%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* La poudre (flacon haut) reste centrée */
.product-img.img-centered img {
    transform: scale(1.35);
}

.product-img img.active { opacity: 1; }

/* Flèches de navigation entre les deux photos */
.img-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(12, 12, 16, 0.45);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.img-arrow:hover { background: rgba(12, 12, 16, 0.7); }
.img-arrow.left  { left: 8px; }
.img-arrow.right { right: 8px; }

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
}

.product-body h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.product-desc {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
    flex: 1;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-price {
    font-weight: 800;
    font-size: 17px;
    color: var(--accent);
    white-space: nowrap;
}

.btn.btn-small {
    margin: 0;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13.5px;
    width: auto;
}

/* ══════════════════════════════════
   MOBILE
   ══════════════════════════════════ */
@media (max-width: 768px) {

    .products-wrap {
        margin-bottom: 96px; /* place pour le bouton panier flottant */
        padding: 0 14px;
    }

    .products-hero { margin: 20px 0 16px; }

    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-img  { height: 120px; }

    .product-body { padding: 12px; }
    .product-body h2 { font-size: 14.5px; }
    .product-desc { font-size: 12.5px; margin-bottom: 10px; }

    /* Footer de carte empilé : prix au-dessus, bouton pleine largeur */
    .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .product-price { font-size: 16px; }

    .btn.btn-small {
        width: 100%;
        min-height: 44px;
    }
}
