.slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 20px;

  .slider-container {
    margin: 0 auto;
    overflow: hidden;
    width: 90%;

    .cards {
      display: flex;
      transition: transform 0.4s ease-in-out;
      gap: 0;

      .card {
        flex: 0 0 auto;
        width: 240px;
        /* marge horizontale : laisse la place a la bordure + l'ombre, sinon
           le overflow:hidden du carrousel rogne la carte de bord. slider.js
           inclut ces marges dans son calcul de largeur, il s'y adapte. */
        margin: 12px 14px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        text-align: left;
        text-decoration: none;
        color: inherit;
        background: #ffffff;
        border: 1px solid rgba(198, 158, 127, 0.16);
        border-radius: 16px;
        padding: 14px 14px 16px;
        box-shadow: 0 10px 24px rgba(51, 51, 51, 0.06);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                    box-shadow 0.25s ease,
                    border-color 0.25s ease;

        &:hover {
          transform: translateY(-5px);
          box-shadow: 0 16px 30px rgba(51, 51, 51, 0.14);
          border-color: #c69e7f;
        }

        /* image : boite carree, fond neutre, contain -> aucun rognage */
        .img-produit {
          position: relative;
          width: 100%;
          height: auto;
          aspect-ratio: 1 / 1;
          background: #f4efe9;
          border-radius: 12px;
          overflow: hidden;
          display: grid;
          place-items: center;
          margin: 0 0 0.85rem;

          img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 14px;
            transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
          }

          .ref-badges {
            position: absolute;
            bottom: 8px;
            right: 8px;
            z-index: 1;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 4px;
          }

          .ref-coloris-badge,
          .ref-taille-badge {
            font-size: 0.68rem;
            font-weight: 600;
            padding: 0.18rem 0.55rem;
            border-radius: 999px;
            border: none;
          }

          .ref-taille-badge {
            color: #ffffff;
            background: #c69e7f;
          }

          .ref-coloris-badge {
            color: #c69e7f;
            background: #ffffff;
            box-shadow: 0 0 0 1px #c69e7f inset;
          }
        }

        &:hover .img-produit img {
          transform: scale(1.06);
        }

        .content {
          padding: 0;
          display: flex;
          flex-direction: column;
          flex: 1;

          p {
            padding: 0;
            margin: 0;
          }

          .reference {
            font-size: 0.74rem;
            letter-spacing: 0.02em;
            text-transform: none;
            color: #8a7f74;
            margin-bottom: 0.35rem;
            font-variant-numeric: tabular-nums;
          }

          .title {
            font-size: 0.98rem;
            font-weight: 600;
            text-transform: none;
            line-height: 1.3;
            color: #372f28;
            margin-bottom: 0.6rem;
            min-height: 2.55em;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
          }

          .prix-ligne {
            margin-top: auto;
            padding-top: 0.7rem;
            border-top: 1px solid rgba(198, 158, 127, 0.16);
            display: flex;
            align-items: baseline;
            gap: 0.35rem;
          }

          .prix {
            color: #c69e7f;
            font-size: 1.12rem;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
          }

          .par-piece {
            font-size: 0.76rem;
            color: #8a7f74;
          }

          .par-conditionnement {
            font-size: 0.72rem;
            color: #8a7f74;
            margin-top: 0.28rem;
            font-variant-numeric: tabular-nums;
          }

          .total-couleurs {
            font-weight: 600;
          }
        }
      }
    }
  }

  /* Fleches de navigation */
  .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(198, 158, 127, 0.25);
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    color: #705846;
    background-color: #ffffff;
    box-shadow: 0 4px 16px rgba(51, 51, 51, 0.12);
    cursor: pointer;
    z-index: 10;
    transition: background 0.18s ease, border-color 0.18s ease;

    &:hover {
      background: rgba(198, 158, 127, 0.12);
      border-color: #c69e7f;
    }

    &.prev {
      left: 20px;
    }
    &.next {
      right: 20px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .slider-wrapper .cards .card,
  .slider-wrapper .cards .card .img-produit img {
    transition: none;
  }
}
